有谁知道在尝试创建传单地图时可能导致以下错误的原因是什么?它与自定义 CRS 有关。由于各种原因,我不能发布很多代码,所以如果有人能指出我正确的方向,我将不胜感激。
this._map.getPixelWorldBounds() 为空
L.map(containerId, {
maxBounds: L.latLngBounds(L.latLng(-90, -180), L.latLng(90,180)),
maxZoom: 15,
minZoom: 1,
center: centerLatLng,
zoom: 2,
crs: getCrs(),
worldCopyJump: true,
zoomControl: false,
attributionControl: false
});
function getCrs() {
return new L.Proj.CRS('EPSG:4326', '+proj=longlat +datum=WGS84 +no_defs', {
origin: [-180, 90],
tileSize: 512,
resolutions: [...]
});
}
//Removed resolutions for brevity.