When an empty array is passed to the ArcGISDynamicMapServiceLayer.setVisibleLayers() function, it throws exception "404 Invalid layer ID specified".
上次发布: August 25, 2014ArcGIS API for JavaScript
漏洞 ID 编号
NIM065413
已提交
February 19, 2011
上次修改时间
June 5, 2024
适用范围
ArcGIS API for JavaScript
找到的版本
2.1
编程语言
JavaScript
操作系统
Windows OS
操作系统版本
2003
修正版本
2.0
状态
Fixed
此漏洞已得到修复。 有关详细信息,请参阅“版本修复”和“其他信息”(如果适用)。
附加信息
Updated the documentation for the 2.2 release to explain how to set no layers visible.
解决办法
To set no visible layers, set the array that is passed into setVisibleLayers equal to -1. This works for both 9.x and 10 if(visible.length === 0){ visible.push(-1); } layer.setVisibleLayers(visible);