A reference layer from multiple basemaps stay on a map when the basemap is switched in the basemap gallery.
上次发布: June 29, 2015ArcGIS API for JavaScript
漏洞 ID 编号
BUG-000085714
已提交
February 27, 2015
上次修改时间
June 5, 2024
适用范围
ArcGIS API for JavaScript
找到的版本
3.12
操作系统
Windows OS
操作系统版本
7 64 Bit
状态
Known Limit
经开发团队审核,已确定此问题与不受 Esri 控制的软件的已知限制有关。 问题的“其他信息”部分可能包含进一步说明。
附加信息
This is a known limit with 3.x and will be addressed in 4.x.
解决办法
Set one of the basemaps as a starting basemap, and add the following code in the application :
var bool = true; // declare this globally
basemapGallery.on("selection-change", function() {
if(bool == true){
map.removeLayer(map.getLayer("layer1"));
bool = false; // Since this happens only ones we don't need it anymore.
}
});