[英]Zoom_changed - Center
I want to add zoom_changed AddListner to my map but it is not working .Any one help me to resolve this Thanks in Advance.My code is 我想将zoom_changed AddListner添加到我的地图中,但是它不起作用。任何人可以帮助我解决此问题。
GEvent.addListener(map, "zoom_changed", function() {
alert("You before Zoomed the map.");
map.setCenter(new GLatLng(17.971599, 77.594563), 10);
alert("You After Zoomed the map.");
}
it works fine for click instead of zoom_changed. 它适合单击,而不是zoom_changed。
If you are using the google maps api v2, you can not use zoom_changed instead try zoomend. 如果您使用的是Google Maps API v2,则不能使用zoom_changed,而应尝试使用zoomend。
GEvent.addListener(map, "zoomend", function() {
alert("You before Zoomed the map.");
map.setCenter(new GLatLng(17.971599, 77.594563), 10);
alert("You After Zoomed the map.");
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.