0
如何panTo()不是通過中心座標,而是通過邊緣座標(設置最小和最大latlon)。我非常需要它!傳單panTo(通過座標聚焦地圖)
如何panTo()不是通過中心座標,而是通過邊緣座標(設置最小和最大latlon)。我非常需要它!傳單panTo(通過座標聚焦地圖)
您可以使用map.fitBounds
var southWest = L.latLng(40.712, -74.227),
northEast = L.latLng(40.774, -74.125),
bounds = L.latLngBounds(southWest, northEast);
map.fitBounds(bounds);
感謝,但它的功能沒有做出正確的變焦.. –
就是你能正確的變焦意思?縮放級別應與您的可見地圖的邊界相對應。 – user2441511