how to execute google maps event “bounds_changed” only once

▼魔方 西西 提交于 2020-05-17 06:33:47

问题


How do I tell the google map event "bounds_change" to only work when the map is initially loaded, and not after user change?


回答1:


from the documentation

addListenerOnce(instance:Object, eventName:string, handler:function(?))
Return Value: MapsEventListener Like addListener, but the handler removes itself after handling the first event.

google.maps.event.addListenerOnce(map,'bounds_changed', function() {});


来源:https://stackoverflow.com/questions/30601828/how-to-execute-google-maps-event-bounds-changed-only-once

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!