开发者

Google Maps API v3: search for map in a container

I have multiple Google Maps on a page. After I initialized them, I have a 开发者_StackOverflow社区need to change options for one, which is in a particular container. So, as I understand, I need to get a variable, which contains the link to this map.

The question is: how can I get the link for the google map if I know its container (for example, $("#map1"))?


you can use this

var latlng = new google.maps.LatLng(x, y);
var mapOptions = {
        center: latlng,
        zoom: 14,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };   

var map = new google.maps.Map(document.getElementById("map1"), mapOptions);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜