google.maps.event.addListener(map, 'bounds_changed', alert("say sth"))
僅適用於第一次加載地圖。之後,無論我如何拖動地圖或縮放地圖,警報都不會彈出。google.maps.event.addListener(地圖,'bounds_changed',alert(「sth」))僅適用於第一次
與google.maps.event.addListener(map, 'idle', alert("just pop twice!"))
相同。
哪裏是你的代碼? – Marcelo
這次調用後可能會出現一些javascript錯誤,阻止它再次調用? – Michael
嗨@Marcelo,thx 4回覆!我在@ Dr.Molle的幫助下發現了問題,我失去了'function(){}'... – Matt