cmv-widgets icon indicating copy to clipboard operation
cmv-widgets copied to clipboard

Getting all map layers

Open deepal13 opened this issue 9 years ago • 6 comments

@tmcgee I am trying to get all the layers using map.layerIds.length and then iterating through them. It gives me all the layers except from the ones added through DnD widget. How can I get those layers?

Also, The layers added through DnD doesn't move up or down with respect to already added operational layer. Can you please help me?

Thanks

deepal13 avatar Sep 13 '16 23:09 deepal13

@deepal13 These are graphic layers so you have to use map.graphicsLayerIds

tmcgee avatar Sep 13 '16 23:09 tmcgee

@tmcgee That worked fine. Thanks :) The layers added through DnD doesn't move up or down with respect to already added operational layer. Is it supposed to be this way?

deepal13 avatar Sep 19 '16 16:09 deepal13

@deepal13 In the Esri JavaScript API, graphic layers are always drawn on top so they cannot be moved below other non-graphic layers.

tmcgee avatar Sep 20 '16 00:09 tmcgee

@tmcgee Ok. But I am unable to move San Francisco 311 Incidents below louisvillePubSafety in the demo example.

deepal13 avatar Sep 26 '16 21:09 deepal13

@deepal13 yes, that is how it works. The San Francisco 311 layer is a feature layer (graphic) and the Louisville Public Safety layer is a dynamic layer (non-graphic)

tmcgee avatar Sep 26 '16 21:09 tmcgee

@tmcgee Ok. I got it. Thanks for your help.

deepal13 avatar Sep 26 '16 22:09 deepal13