Reorder Graphics layer

4693
5
07-28-2015 09:11 PM
NigelDsouza
Occasional Contributor

HI,

I have a dynamic layer which has point data and a graphics layer which displays polygon graphics. Since the graphic layer lies on top of the dynamic layers I unable to see my point features clearly inspite of setting the opacity of the graphic to 0.3. So i there any way of having the point dynamic layer reorder ontop of the graphicslayer? I am using the ArcGIS API for javascript.

Regards,

Nigel.

0 Kudos
5 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Nigel,

One way you can do this is to use the GraphicsLayer update event.  You can add the dynamic layer once this event fires.  Here is a JSFiddle example.

NigelDsouza
Occasional Contributor

Hi Jake,

The example you sent me uses feature layer, and since the featurelayers and graphics layers are in the same array in the map object they can be managed. But in your example if i use a "dynamic map service layer" then the layer does not display on top.

Regards,

Nigel.

0 Kudos
JaiSiva1
New Contributor III

Hi Nigel,

You can use the reorderLayer() method of the map class.

NigelDsouza
Occasional Contributor

HI Jai,

I tried using reorderLayer method. But when watch the map object expression while dubugging. The dynamic layers are shown in map.LayerIDs and graphic layers in map.graphicLayerIds. so this is a bit confusing as to which index should I move the graphic layer such that I gets positioned between two daymic layers.

Regards,

Nigel.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Nigel,

   In 3.x of the API graphics (GraphicsLayer) and thus FeatureLayer which inherits from GL will always been on top. This is planed to be changed in the 4.x API.

0 Kudos