【发布时间】:2021-07-22 20:05:11
【问题描述】:
我想使用 ArcGIS Web API 显示位于https://cartes.nicecotedazur.org/portal/apps/webappviewer/index.html?id=237a9574a4b34ffaba8754a61235e828 的地图。
我首先尝试使用 ArcGIS Sandbox 显示它:https://developers.arcgis.com/javascript/latest/sample-code/sandbox/i
这是代码示例:
require(["esri/views/MapView", "esri/WebMap", "esri/config"], function (
MapView,
WebMap,
esriConfig
) {
esriConfig.portalUrl = "https://cartes.nicecotedazur.org/portal/";
var webmap = new WebMap({
portalItem: {
id: "b79f6b55f4a0427b8c32ba805fa6e71a"
}
});
var view = new MapView({
map: webmap,
container: "viewDiv"
});
});
但是在加载时控制台中会弹出此错误消息:
"Invalid portal item type 'Map Service', expected 'Web Map'"
我没有找到任何引用此错误的文章
我尝试了两个不同的 id:
-
b79f6b55f4a0427b8c32ba805fa6e71a是网络地图 ID -
237a9574a4b34ffaba8754a61235e828这是在 url 中找到的 id
【问题讨论】:
标签: javascript arcgis arcgis-js-api