开发者

Edit existing google map?

I used the following command 开发者_StackOverflowto create a google map on a page:

map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

I would now like to edit this map, but I do not have the JS object ("map") available. Is there a way that I can get the map object back into javascript (so I can edit it) by reading the "map_canvas" div or by doing something like that?

Thanks for the help.


I've been able to get this to work by creating a global variable "var globalmap" and then assigning the Google map that gets created "var map = new google.map..." to it "globalmap = map".

I can now refer to "globalmap" in other javascript functions.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜