laptop and a wrench

Bug

Reordered layers in a map service sample works incorrectly when all the layers are turned off.

Last Published: April 23, 2015 ArcGIS API for JavaScript
Bug ID Number BUG-000086608
SubmittedApril 2, 2015
Last ModifiedJanuary 2, 2021
Applies toArcGIS API for JavaScript
Version found3.13
Operating SystemWindows
Operating System Version7 64 Bit
Version Fixed3.14
StatusFixed

Workaround

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

Steps to Reproduce

Bug ID: BUG-000086608

Software:

  • ArcGIS API for JavaScript

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic