laptop and a wrench

Bug

When an empty array is passed to the ArcGISDynamicMapServiceLayer.setVisibleLayers() function, it throws exception "404 Invalid layer ID specified".

Last Published: August 25, 2014 ArcGIS API for JavaScript
Bug ID Number NIM065413
SubmittedFebruary 19, 2011
Last ModifiedJune 5, 2024
Applies toArcGIS API for JavaScript
Version found2.1
Program languageJavaScript
Operating SystemWindows OS
Operating System Version2003
Version Fixed2.0
StatusFixed

Additional Information

Updated the documentation for the 2.2 release to explain how to set no layers visible.

Workaround

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);

Steps to Reproduce

Bug ID: NIM065413

Software:

  • ArcGIS API for JavaScript

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options