Select to view content in your preferred language

Map service layers

962
3
05-19-2011 03:49 PM
JonGottsegen
Deactivated User
Greetings,

A very similar question was posted in another thread, but I didn't see an answer, and there's got to be a simple solution. I have a dynamic map service with 11 layers. I'm trying to display one layer in flex viewer. I have the following in the operationallayers section:

            <layer label="Regions" type="dynamic" visible="true" alpha="0.5"
                url="http://10.9.5.18/ArcGIS/rest/services/regions_gov_office_OED/MapServer/2/">

I've tried it without the layer number and any other way I can think of. The layer does not show up. The service is listed in the TOC, with no ability to expand and see the name of a layer being show. Clicking on the check box in the TOC doesn't display anything. It seems so simple. what am I missing?

Thanks.
Tags (2)
0 Kudos
3 Replies
BjornSvensson
Esri Regular Contributor
Hello Gottsegen 🙂
I have a dynamic map service with 11 layers. I'm trying to display one layer in flex viewer.


To draw just some layers within a mapservice, use the visiblelayers property (a comma-separated list):
<layer label="Regions" type="dynamic" visible="true" alpha="0.5"
visiblelayers="2"
url="http://10.9.5.18/ArcGIS/rest/services/regions_gov_office_OED/MapServer"/>

http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/The_Layer_tag/01m30000000p000000/
0 Kudos
JonGottsegen
Deactivated User
Thanks, Dude. That worked. I guess those Krav Maga sessions back in the day helped...

So is it possible, to have a "sublayer" (i.e., a layer in a service) be treated as an individual layer in the viewer. Right now, when I add the service all the layers become available (which seems like even that didn't work before), but what if I want to treat each layer separately (e.g., with a transparency widget), and I don't want to separate them out into individual services? Is this only possible with feature services?


J
0 Kudos
BjornSvensson
Esri Regular Contributor
I'm not familiar with a transparency widget, but in general (for TOC etc) you have two options:

  1. add multiple layers of type "dynamic" (and set the visiblelayers property to an individual sublayer)

  2. or use multiple layers of type "feature" (which always only point to individual sublayers).

The main difference between these is that the "dynamic" maps are drawn on the server and sent to your browser as an image, while for "feature" the features are sent from the server as features, then drawn in the browser.

Note that currently (ArcGIS 10.0), the REST API doesn't support changing transparency on sub-layers, which is why you have to ask for multiple layers separately if you want them to have different transparencies (on-the-fly).  With the next release of ArcGIS, 10.1, this might change.
0 Kudos