Select to view content in your preferred language

What determines display order of layers?

793
1
05-02-2011 06:38 AM
WaltBulawa
Emerging Contributor
On my map I have two graphics layers (one for queried polygons and one for Identify Results) and a ArcGISDynamicMapServiceLayer (for parcels).

My problem is that the parcel layer appears on top of the IdentifyResults layer, which I would rather be on top.  I tried to move it on top with the following:

clickGraphicsLayer.moveToTop(clickGraphic);
clickGraphic.symbol = new InfoSymbol(); // use default renderer
clickGraphic.attributes = resultGraphic.attributes;
clickGraphicsLayer.moveToTop(clickGraphic);

but, alas, it seems to have no effect --- the parcels still appear on top of the resultsGarphic.

Is there a way to make this specific layer appear on top of all the others?
Tags (2)
0 Kudos
1 Reply
DasaPaddock
Esri Regular Contributor
The order of the layers inside the Map are reflected by the order of the layers in the ArrayCollection exposed by the "layers" property:
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/Map.html#layers

You can manipulate this ArrayCollection directly or call reorderLayer()
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/Map.html#reorderLayer()
You can also choose where a layer is added by passing the position to addLayer()
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/Map.html#addLayer()
0 Kudos