Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Similar ESRI arcgis.com 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

2 Answers 2

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:

map.addLayer(myLayer);
map.reorderLayer(myLayer,1);

for more information check the esri.Map class in the API Reference here: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm

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 ESRI.com 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: developers.arcgis.com/javascript/jssamples/… –  Matej Jul 3 at 14:55

Your Answer

 
discard

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.