2016-09-23 75 views
0
多個處理程序

我的谷歌我每次初始化ex.click處理程序添加到document.The同爲keydown, keyup. 我已經嘗試通過谷歌地圖 - 避免文件

google.maps.event.clearInstanceListeners(this.googleMapInstance); 

,但要刪除所有監聽時間地圖沒有工作。其他情況下,如果我做對了,請打開我的腦海。 這就是它是如何在開始初始化:

this.googleMapInstance = new google.maps.Map(element, options); 

我只需要手動管理它,因爲我的用戶可以調用谷歌地圖多次,我不需要保留舊的處理程序,當實例不存在了(誰真的需要嗎?)

處理器來源於: https://maps.google.com/maps/api/js

rb=function(a, b) 

感謝,我正在做錯誤的任何建議。

+0

貌似叫: google.maps.event.clearInstanceListeners(窗口); google.maps.event.clearInstanceListeners(document); 做我需要的工作。感謝我自己! – Arek

回答

0

正如您在您的評論說:

google.maps.event.clearInstanceListeners(window); 
google.maps.event.clearInstanceListeners(document);