[英]Google Maps API - Event Listeners
Is it necessary to remove Event listeners in when using google maps javascript api? 使用Google Maps JavaScript API时是否需要删除事件侦听器? "assume that code is working fine"
“假设代码工作正常”
In other words do even listeners hinder website performance in such a way that one should ALWAYS remove/minimized unused listeners. 换句话说,即使是听众,也确实会妨碍网站的性能,以至于人们应该总是删除/最小化未使用的听众。
Thanks 谢谢
I assume you talk about GEvent
's from the Google Maps API. 我假设您是通过Google Maps API谈论
GEvent
的。 Personally, I haven't had any difficulties with them. 就我个人而言,我没有遇到任何困难。
Nor have I had any problems with adding say jQuery .mouseup()
on the map canvas to trigger map events, although I recommend using GEvent
's for triggering and handling map-related stuff. 尽管我建议使用
GEvent
来触发和处理与地图相关的内容,但在地图画布上添加jQuery .mouseup()
来触发地图事件也没有任何问题。
Edit: It'd be interesting with some profiling on having a simple map canvas, and see if other actions and performance is affected by removing GEvents. 编辑:在具有简单的地图画布上进行一些剖析会很有趣,并查看是否通过删除GEvents影响其他动作和性能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.