最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - GUnload() a single Google Map - Stack Overflow

programmeradmin0浏览0评论

I've got some Javascript/HTML code which displays a variable number of maps dependent on what the user selects.

I've worked how to dynamically create multiple maps on a page - that's well documented.

However, what I'm not so sure on is... how can I safely destroy a map after it's been created - normally I just leave this to GUnload() to sort out.

Thanks for any help!

I've got some Javascript/HTML code which displays a variable number of maps dependent on what the user selects.

I've worked how to dynamically create multiple maps on a page - that's well documented.

However, what I'm not so sure on is... how can I safely destroy a map after it's been created - normally I just leave this to GUnload() to sort out.

Thanks for any help!

Share Improve this question edited Dec 22, 2009 at 21:40 Daniel Vassallo 345k72 gold badges512 silver badges446 bronze badges asked Nov 18, 2009 at 16:33 StuartStuart
Add a ment  | 

1 Answer 1

Reset to default 3

Unfortunately the Google Maps API does not yet provide a documented method to GUnload() a single map.

There is an open Issue #772 for this feature on the Google Maps API Issue Tracker. On May 24 2009 it was marked as Acknowledged, but it remains open to this day.

In the first ment of that issue, a Google Maps team member confirmed that a possible "partial" workaround at the moment is to call:

map_to_delete.clearOverlays();
GEvent.clearInstanceListeners(map_to_delete);
发布评论

评论列表(0)

  1. 暂无评论