Google Maps JavaScript API V3 - 卸载/解构/删除/移除
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9435909/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Google Maps JavaScript API V3 - Unload / Deconstructor / Delete / Remove
提问by Jamie G
I can't find any way to remove and clean up a Google map when using the V3 API.
使用 V3 API 时,我找不到任何删除和清理 Google 地图的方法。
I've got it running in an AJAX site so I want to kill it off completely without the page having to be reloaded.
我让它在 AJAX 站点上运行,所以我想完全关闭它,而不必重新加载页面。
I was hoping for a .unload()
or .deconstruct()
method, but can't seem to find one.
我希望有一个.unload()
or.deconstruct()
方法,但似乎找不到。
Any thoughts?
有什么想法吗?
采纳答案by bamnet
The V3 API should do a much better job managing it's memory. Does simply destroying the div that holds the map not meet your needs?
V3 API 应该在管理内存方面做得更好。简单地销毁保存地图的 div 不能满足您的需求吗?