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'm working on our first Flex server page using the Flex Viewer 2.3.1. The Legend widget works, but I cannot get the excludelayer tag to work. Here's where the problem probably is - it's a cached map service. Can the excludelayer tag be used on a cached map service? The layer I'm trying to exclude is an image service. Thanks in advance.

Here's the snippet of code:

<?xml version="1.0" ?>

The image service is within the base map layers. I'm trying to remove the entire image service from the legend, and not just the boundary/footprint,etc.

share|improve this question
up vote 0 down vote accepted

Yes, the excludelayer tag can be used to exclude cached map services.

Anything you've added as can be excluded using anything.

Note that you can not use the excludelayer to exclude individual layers within a service.

What is the syntax that you tried?

share|improve this answer
Hi Bjorn, see above for the code snippet. Thanks! – Evan Jul 27 '11 at 14:16

I misread the help file for the legend widget, and misunderstood Bjorn's answer. The excludelayer tag only works for each map service that is within the config.xml. For instance if your config.xml is:

   <layer label="Floodplain" type="tiled" visible="true" url="..."/>
   <layer label="Floodplain" type="dynamic" visible="true" url="..."/>
   <layer label="Aerial"  type="image" visible="false" url="..."/>
   <layer label="Topo"    type="dynamic" visible="false" url="..."/>

Then when using the excludelayer tag it would be as follow:


This removes both the tiled and dynamic "Floodplain" services that I have in the basemaps tag. When I originally read the help file I thought it removed individual services or data sets within the document.

The answer is that it can't be done unless a separate service is created in the basemaps tag that included only the data that is not supposed to be represented in the legend. For instance if I placed the cached image service in the "Aerial" layer, I could then remove it from the legend by excluding "Aerial" in the excludelayers tag.

Thank you Bjorn and pdog for responding.

share|improve this answer

I believe this only works with map services.

share|improve this answer

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.