AnsweredAssumed Answered

Possible problem with JavaScript API 3.16 AcrGISDynamicMapServiceLayer visibleLayers property[non-issue]

Question asked by NickT_GDB on Jan 17, 2017
Latest reply on Jan 17, 2017 by NickT_GDB

The JavaScript API 3.16 AcrGISDynamicMapServiceLayer visibleLayers property does not refer to the property it is described to hold. One would suspect from this description:



That this property would hold an array of the layers in the ArcGISDynamicMapServiceLayer that are visible. So one would expect something like [0,3,5]. Representing that the layers in the service at those endpoints that are currently visible. Instead it appears to just return the amount of visible layers. THIS IS NOT HELPFUL. Here is an example of what it shows in the console(see the bottom property in the image below):



The property that closest resembles what I am looking for is "_defaultVisibleLayers", infact it shows exactly what visibleLayers is supposed to show but I am assuming it is the initial visibile layers and wouldn't change if I changed the visibility:




WHAT IS "0" ?

THAT REFERS TO NOTHING TO ME. None of my layers have a unique ID of "0".


As with all things with programming, it is easy to misunderstand or accidentally overlook something in the Docs so if someone can clear this up for me in regards of me misconstruing the intended purpose of the visibleLayers property please do. 


Otherwise this is a BUG, and it has persisted since atleast 3.16 and is still present at 3.16. It is odd that this has been overlooked and it needs to be addressed and or the property needs a new description.



Nick T