我有一个非常基本的 map 示例: (JsFiddle)
require(["esri/map"],
function(Map) {
var baseMap = new Map("map", {
basemap: "terrain",
center: [10, 51],
zoom: 12,
maxZoom: 22
});
});
当我超过一定的缩放级别时,我收到以下错误:
init.js:587 Uncaught TypeError: Cannot read property 'resolution' of undefined
at Object.__getExtentForLevel (init.js:587)
at Object._extentUtil (init.js:579)
at Object._wheelZoom (init.js:1254)
at Object.<anonymous> (init.js:63)
at Object.c [as onMouseWheel] (init.js:119)
at Object._fire (init.js:1279)
at Object._onMouseWheelHandler (init.js:1286)
at HTMLDivElement.<anonymous> (init.js:63)
使用相同代码(但基于 3.13)内部托管的其他几个应用程序能够放大,直到可以看到所有街道名称和门牌号。
是什么导致了这些错误?
最佳答案
看起来“地形” basemap 的分辨率没有最终用户所希望的那么高,并且 ESRI 忘记限制该 basemap 的缩放功能。
切换到 osm
、topo
或 streets
可以解决该问题。
解决方案是将basemap: "terrain",
更改为basemap: "topo",
。
关于javascript - 缩放超过 13 会在 ArcGis JS API 中引发分辨率错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44412175/