【发布时间】:2020-07-26 12:50:14
【问题描述】:
【问题讨论】:
-
你试过 noWrap: false
-
不,我尝试过这个选项,我需要在哪里定义没有 Wrap 属性?
标签: angular leaflet maps zooming react-leaflet
【问题讨论】:
标签: angular leaflet maps zooming react-leaflet
在包含平铺层时,您需要包含 noWrap 选项。像这样:
L.tileLayer(urlTemplate, {
noWrap: true, //this is the crucial line!
bounds: [
[-90, -180],
[90, 180]
]
}).addTo(map);
【讨论】:
map.fitWorld(); 或map.fitBounds(); 以超越整个世界。
fitBounds() 添加了一些界限?像 map.fitBound([[-90, -180],[90, 180]]) 或任何其他对您的地图有意义的值。这也假设您的地图对象称为“地图”。有些人称它为“mymap”或完全不同的东西。
在配置选项中添加 noWrap
{
noWrap: true,
bounds: [
[-x, -y],
[x, y]
]
}
【讨论】: