是否可以指定将哪些 ArcGIS 底图用于 ESRI 底图库 (ArcGIS API)?
Is it possible to specify which ArcGIS base-maps to use for the ESRI basemap gallery (ArcGIS API)?
是否可以指定将哪些 ArcGIS 底图用于 ESRI 底图库 (esri/dijit/BasemapGallery)?
将 showArcGISBasemaps 设置为 true 会返回所有这些,但我只想要 select 几个,例如“道路”、“国家地理”和“卫星”。
var basemapGallery = new BasemapGallery({
showArcGISBasemaps: true,
map: map,
}, "myPlaceHolder");
查看文档 (https://developers.arcgis.com/javascript/3/jsapi/basemapgallery-amd.html) 我似乎找不到任何东西。
或者,是否可以在将 showArcGISBasemaps 设置为 false 后单独创建这些图层?
您可以在创建 BasemapGallery
时在 params.basemaps
对象中指定底图:new BasemapGallery()
link 中也有代码示例。祝你好运!
原来我不得不在 ArcGIS 服务上找到图层后手动定位它们:http://server.arcgisonline.com/ArcGIS/rest/service
var greyLayer = new esri.dijit.BasemapLayer({
url: "http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer"
});
var greyBasemap = new esri.dijit.Basemap({
url: [greyLayer],
id: "mybaselayerId",
title: "Grey"
});
basemaps.push(greyBasemap);
var basemapGallery = new BasemapGallery({
showArcGISBasemaps: false,
basemaps: basemaps,
map: map,
}, "myPlaceHolder");
似乎没有过滤从 showArcGISBasemaps
返回的底图的选项
是否可以指定将哪些 ArcGIS 底图用于 ESRI 底图库 (esri/dijit/BasemapGallery)?
将 showArcGISBasemaps 设置为 true 会返回所有这些,但我只想要 select 几个,例如“道路”、“国家地理”和“卫星”。
var basemapGallery = new BasemapGallery({
showArcGISBasemaps: true,
map: map,
}, "myPlaceHolder");
查看文档 (https://developers.arcgis.com/javascript/3/jsapi/basemapgallery-amd.html) 我似乎找不到任何东西。
或者,是否可以在将 showArcGISBasemaps 设置为 false 后单独创建这些图层?
您可以在创建 BasemapGallery
时在 params.basemaps
对象中指定底图:new BasemapGallery()
link 中也有代码示例。祝你好运!
原来我不得不在 ArcGIS 服务上找到图层后手动定位它们:http://server.arcgisonline.com/ArcGIS/rest/service
var greyLayer = new esri.dijit.BasemapLayer({
url: "http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer"
});
var greyBasemap = new esri.dijit.Basemap({
url: [greyLayer],
id: "mybaselayerId",
title: "Grey"
});
basemaps.push(greyBasemap);
var basemapGallery = new BasemapGallery({
showArcGISBasemaps: false,
basemaps: basemaps,
map: map,
}, "myPlaceHolder");
似乎没有过滤从 showArcGISBasemaps
返回的底图的选项