BrianBunker / cmv-widgets

Widgets based on the Esri jsapi, configured for the Configurable Map Viewer. Widgets include Drag and Drop, Goto, Map Navigation Hash, and Nearby.
https://brianbunker.github.com/cmv-widgets
MIT License
18 stars 24 forks source link

Getting all map layers #37

Open deepal13 opened 8 years ago

deepal13 commented 8 years ago

@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

tmcgee commented 8 years ago

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

deepal13 commented 8 years ago

@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?

tmcgee commented 8 years ago

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

deepal13 commented 8 years ago

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

tmcgee commented 8 years ago

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

deepal13 commented 8 years ago

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