AnsweredAssumed Answered

map.graphicLayerIds and map.layerIds

Question asked by processing... on Jan 29, 2016
Latest reply on Feb 4, 2016 by processing...

Please correct me if I'm wrong:

 

Assume gLayer is a graphic layer and flayer is a feature layer.

 

If I call map.reorderLayer(gLayer, 0), I will only be reordering the map.graphicLayerIds collection where 0 is the going to appear under any other graphic layer.

If I call map.reorderLayer(fLayer, 1), I will be reordering all other layers where 1 will be just on top of the basemap but appear under all other layers.

 

Right?

 

Is there a way to reorder all layers at once? It appears that graphic layers will always appear on top of other layers.

 

Is there a way to send a specific layer all the way to the front (appear on top of everything)? If 0 is the basemap, and 1 is the first layer added... how can I reorder a layer to be set to the front if don't know how many total layers there are? I know how many graphic layers, and I know how many other layers there are. Ideally, if I have 5 layers on the map (including the basemap), I would want to call map.reorderLayer(fLayer, 4).

 

I haven't found a good way to manage the appearance order of all graphics. Must I order graphic layers and all other layers separately?

 

Thoughts?

 

Thanks!

Outcomes