【发布时间】:2021-05-16 07:44:03
【问题描述】:
在Arcgis 开发者网页中,有一篇文章介绍了如何使用自定义API url 添加新的自定义baseMap。看起来像这样:
require([
"esri/basemaps",
"esri/map",
"dojo/domReady!"
], function (esriBasemaps, Map){
esriBasemaps.delorme = {
baseMapLayers: [{url: "https://services.arcgisonline.com/ArcGIS/rest/services/Specialty/DeLorme_World_Base_Map/MapServer"}
],
thumbnailUrl: "https://www.example.com/images/thumbnail_2014-11-25_61051.png",
title: "Delorme"
};
var map = new Map("ui-map", {
basemap: "delorme",
center: [-111.879655861, 40.571338776], // long, lat
zoom: 13,
sliderStyle: "small"
});
});
现在我不明白如何使用react-arcgis 来做同样的事情。似乎react-arcgis 中没有内置方法可以使用custom API url`` as BaseMapbut is there an option to do something similar inReact`?
this.props.map.basemap = 'streets-relief-vector';
而不是使用内置的底图字符串。
还创建了一个简单的CodeSandbox 来测试它。
【问题讨论】:
标签: reactjs arcgis arcgis-js-api esri-maps