开发者

Edit existing google map?

开发者 https://www.devze.com 2023-02-28 04:51 出处:网络
I used the following command 开发者_StackOverflowto create a google map on a page: map = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions);

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

精彩评论

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