Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的网页上有 Google Maps API2,我想要“zoom_change”事件来防止用户缩小。
在谷歌地图 API3 中有一个名为“zoom_changed”的事件,但如果有人知道请帮助我,我找不到 API2 的相同事件。
事件是zoomend。
zoomend
https://developers.google.com/maps/documentation/javascript/v2/reference#GMap2.zoomend
.... var map = new GMap2(document.getElementById("map_canvas")); .... GEvent.addListener(map, "zoomend", function(oldzoomlevel, newzoomlevel) { alert(oldzoomlevel +" " + newzoomlevel); });
这里的例子。
关于更多 GEvents