Javascript 如何解决此传单错误?getPixelWorldBounds()
是否有人知道在尝试创建传单地图时可能导致以下错误的原因?这与定制CRS有关。由于各种原因,我不能发布很多代码,因此如果有人能为我指出正确的方向,我将不胜感激 此.\u map.getPixelWorldBounds()为nullJavascript 如何解决此传单错误?getPixelWorldBounds(),javascript,reactjs,leaflet,proj4js,Javascript,Reactjs,Leaflet,Proj4js,是否有人知道在尝试创建传单地图时可能导致以下错误的原因?这与定制CRS有关。由于各种原因,我不能发布很多代码,因此如果有人能为我指出正确的方向,我将不胜感激 此.\u map.getPixelWorldBounds()为null L.map(containerId, { maxBounds: L.latLngBounds(L.latLng(-90, -180), L.latLng(90,180)), maxZoom: 15, minZoom: 1, center:
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.
我正是在这个问题上添加了EPSG:32661支持,通过使用
我发现这个问题是由使用
worldCopyJump
引起的。通过删除它,错误消失了。我正好遇到了这个问题,通过使用向传单添加EPSG:32661支持
我发现这个问题是由使用
worldCopyJump
引起的。通过删除它,错误将消失。谢谢。我目前无法访问该网站,但我会尽快查看。我确实将getCrs()更改为L.CRS.EPSG4326,它修复了错误。我想我需要检查一下这个自定义函数,看看它为什么会导致这个问题。谢谢。我目前无法访问该网站,但我会尽快查看。我确实将getCrs()更改为L.CRS.EPSG4326,它修复了错误。我想我需要检查一下这个自定义函数,看看它为什么会导致这个问题。
Uncaught TypeError: Cannot read property 'getSize' of null
at NewClass._onZoomEnd (leaflet-src.js?8af6:13235)
at NewClass.whenReady (leaflet-src.js?8af6:4450)
at NewClass.addHooks (leaflet-src.js?8af6:13157)
at NewClass.enable (leaflet-src.js?8af6:5722)
at NewClass.addHandler (leaflet-src.js?8af6:3736)
at NewClass.init (leaflet-src.js?8af6:385)
at NewClass.proto.callInitHooks (leaflet-src.js?8af6:357)
at NewClass.initialize (leaflet-src.js?8af6:3148)
at new NewClass (leaflet-src.js?8af6:301)
at Map.createLeafletElement (Map.js?fe6c:87)