Reordered layers in a map service sample works incorrectly when all the layers are turned off.
上次发布: April 23, 2015ArcGIS API for JavaScript
漏洞 ID 编号
BUG-000086608
已提交
April 2, 2015
上次修改时间
January 2, 2021
适用范围
ArcGIS API for JavaScript
找到的版本
3.13
服务器平台
Windows
客户端平台
7 64 Bit
Version Fixed
3.14
状态
Fixed
此漏洞已得到修复。 有关详细信息,请参阅“版本修复”和“其他信息”(如果适用)。
解决办法
Find the attached sample.
Replace the code for Toggle Layers function with the following:
function toggleLayer(e) {
showLoading();
for (var info in infos) {
var i = infos[info];
if (i.name === e.target.name) {
i.visible = !i.visible;
}
}
var visible = getVisibleLayers();
if (visible.length === 0) {
usaLayer.setVisibleLayers([-1]);
} else {
usaLayer.setDynamicLayerInfos(visible);
}
}