layerIds or _layers ?  I'm missing something in the management layers.

731
2
06-08-2014 08:37 AM
JulienPETAUX
New Contributor
Hi,

I use a piece of code that loops through a configuration file and create layers according to their type. Then all the layers and add to the map.
It works without any problem layers appear correctly on the map, but after when I want to loop over layerId I can not find my layers.
I put two screenshots to show in debug mode content.

this.map.layerId is empty :

[ATTACH=CONFIG]34434[/ATTACH]

this.map._layers contains my layers :

[ATTACH=CONFIG]34435[/ATTACH]


Someone has an answer or perhaps has already across this problem ?

Thanks


The code is an extract of the great customizable viewer of David Spriggs here:
https://github.com/DavidSpriggs/ConfigurableViewerJSAPI
0 Kudos
2 Replies
JulienPETAUX
New Contributor
Okay i found my mistake. My layers are in the graphicLayerId array because they are feature's type layer. If i use Dynamic layer or Tiled it's working.
So i think i need to read some details on feature service to understand well why i can not use map.getLayer
I let my message if that can help somebody.
0 Kudos
KnoxvilleRegional
New Contributor

Thanks for posting. I ran across this post when I was trying to figure out why my feature layers were not listed in layerIDs. Just in case anyone else lands here for the same reason, it should be noted that feature layers (and other "graphic layers") will be listed in graphicsLayerIds.  Your previous post spelled that as "graphicLayerId" and it didn't work when I pasted that word into my code.

Thanks again for posting that follow up.