Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Similar ESRI can anyone give pointers on how to move layer up/down? And of possible include the context menu.

Update:Pardon me, Using Javascript API

Cheers, blueRace

share|improve this question
What platform are you working with: javascript or Silverlight? – Dan Walton Mar 8 '11 at 14:52

You can use the map's reorderLayer() method.

Changes the layer order in the map. Note that the first layer added is always the base layer, even if its order is changed.

reorderLayer(layer, index)

The index refers to the location for placing the layer. The bottom most layer has an index of 0.

something like:


for more information check the esri.Map class in the API Reference here:

share|improve this answer

The client-side APIs treat each map service as a layer, while the map service itself may also contain layers (as defined in your MXD, for example). If you are asking about layers within an ArcGIS Server map service, it cannot be done as AGS does not support it.

share|improve this answer
@ nw1: Erm are you sure about your statement? The link in my OP for does exactly what I'm looking to do, just want to know if anyone knows how they went about it. Thanks for your response anyway. – blueRace Mar 10 '11 at 9:18
is correct. You need to differentiate between map services and service layers. within the framework of the javascript API you cannot manipulate the layers of a service, you can only do this from the mxd. In the javascript API, however, each service added is treated essentially as a layer which can be manipulated as mentioned above by using the reorder method or the order in which the services are added. – badkins Apr 9 '11 at 8:11
Maybe, it wasn't supported back then but now you can reorder layers within map service:… – Matej Jul 3 '14 at 14:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.