javascript - 缩放超过 13 会在 ArcGis JS API 中引发分辨率错误

标签 javascript esri esri-maps

我有一个非常基本的 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 的缩放功能。

切换到 osmtopostreets 可以解决该问题。

解决方案是将basemap: "terrain",更改为basemap: "topo",

关于javascript - 缩放超过 13 会在 ArcGis JS API 中引发分辨率错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44412175/

相关文章:

javascript - Node JS Web 服务上的 Angular - GET http://127.0.0.1 net::ERR_CONNECTION_REFUSED

javascript - typescript 打字 - 重复名称 promise /找不到名称 promise

image - 如何使用免费工具将 ESRI 或 MapInfo GIS 数据转换为图像?

esri - 使用 Python 将自定义要素属性添加到 ESRI Shapefile

multithreading - ESRI 映射提供主线程检查器 : UI API called on a background thread in iOS 11

android - 将 Esri ArcGIS 4.3 中的 basemap URL 更改为以 https ://instead of file://开头

javascript - 按大小获取元素

如果输入字段连接到数据库,Javascript 无法获取值?

javascript - ESRI - 单击要素时返回属性

java - Esri-Maps 中的聚类点