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

I am pretty new to ArcGIS Server and am building a map applications using the Javascript API. I can easily load the map layer below by adding it as a ArcGISDynamicMapServiceLayer

As you can see there are many layers as part of the above url. What if I just want to load the roads layer as a ArcGISDynamicMapServiceLayer? I've tried replacing the above url with the road specific URL below and that does not seem to work

Is there something else I can do as the front end developer or is it up to those that are hosting and managing the server to create a unique url for the roads?

share|improve this question
up vote 0 down vote accepted

Make use of the layers property when asking for the exportmap operation from a dynamic map service.

REST API Help on Exportmap operation.

This service was published with 3 visible layers. However, can make a request for certain layers.

  • show: Only the layers specified in this list will be exported.
  • hide: All layers except those specified in this list will be exported.
  • include: In addition to the layers exported by default, the layers specified in this list will be exported.
  • exclude: The layers exported by default excluding those specified in this list will be exported.

Also take a look at what additional behaviour you can do with the use of dynamic layers.

share|improve this answer
I'm not sure if this really answers the OP question. The example above exports an image from the map service layer, though. – Matej May 15 '14 at 21:23

Check out the ESRI API Reference Page for DynamicMapServiceLayer. I believe you will want to incorporate setVisibleLayers into your code.

share|improve this answer
I am not going to be managing the server for this project, just building the front-end. For easier management in the future would it make more sense for all the map layers to be setup/organized differently on the backend? Eventually I will build the front end to give users controls of many layers visibility, opacity etc. – snowgage Oct 29 '12 at 21:00

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.