答案 0 :(得分:0)
这应该可以,将它放在一个在bounds_changed事件处理程序中调用的函数中:
var bounds = map.getBounds();
var northEastCorner = bounds.getNorthEast();
var southWestCorner = bounds.getSouthWest();
var northWestCorner = {
lat: northEastCorner.lat(),
lng: southWestCorner.lng()
};
var southEastCorner = {
lat: southWestCorner.lat(),
lng: northEastCorner.lng()
};