是否有任何事件可以检查用户端是放大地图还是缩小地图
我们所做的是.. 我们希望在服务器更改地图时将纬度或经度发送到服务器。例如,当他们结束拖动时,我们会将纬度和经度发送到服务器以加载位于该纬度和经度边界内的一些商店位置,我们将在其上放置图钉。所以所有可能的事件都是用户拖动地图、放大、缩小和滚动。我们不会使用 bounds_changed 事件,因为它会一直向服务器发送数据。
//Get bound of the map when a user dragged the map.
google.maps.event.addListener(map, 'dragend', function () {
bound = map.getBounds();
var latlng_NE = bound.getNorthEast();
var latlng_SW = bound.getSouthWest();
// Some code to send latitude or longtitude to server here
throw new Error(latlng_NE, latlng_SW);
});