Making ArcGISDynamicMapServiceLayer appear above FeatureLayer on a map

1871
3
06-09-2014 09:02 AM
DanielNwankwo
New Contributor II
I am using the ArcGISDynamicMapServiceLayer to display some labels and FeatureLayer objects to display shapes.
Both are added to the same map object but the ArcGISDynamicMapServiceLayer graphic is always beneath the FeatureLayer graphic.

I have tried map.reorder() but that does not work. I also tried adding one layer before the other but to no avail. I can set the opacity of the FeatureLayer but I don't really want to do that as it makes it difficult to see.

What am I missing?

Thanks
0 Kudos
3 Replies
KenBuja
MVP Esteemed Contributor
A FeatureLayer will always be placed on top of a dynamic layer. Refer to the documentation, where it states that the FeatureLayer  inherits from the GraphicLayer. Then look at the GraphicLayer page, where it states

  Also, all graphics layers are always on top of TiledMapServiceLayers and DynamicMapServiceLayers.
0 Kudos
JeffPace
MVP Alum
you have two options.

Render your dynamiclayer as a Feature Layer

Render your featurelayer as a Dynamic Layer

With one of each, you can not control the order.
0 Kudos
DanielNwankwo
New Contributor II
Thanks. The reason for having a feature layer was to use the infoTemplate property, which is not available in a dynamic layer. I may have to drop this idea.

Thanks.
0 Kudos