作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
有谁知道在尝试创建传单 map 时可能导致以下错误的原因是什么?和自定义的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.
最佳答案
我正是遇到了这个问题,通过使用Proj4Leaflet向Leaflet添加EPSG:32661支持.
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)
我发现该问题是由使用 worldCopyJump
引发的。通过删除它,错误就会消失。
关于javascript - 如何解决此传单错误? getPixelWorldBounds(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46550541/
有谁知道在尝试创建传单 map 时可能导致以下错误的原因是什么?和自定义的CRS有关系。由于各种原因,我无法发布大部分代码,因此如果有人能指出我正确的方向,我将不胜感激。 this._map.getP
我是一名优秀的程序员,十分优秀!