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.

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" ?>
<configuration>
    <usebasemaps>true</usebasemaps>
    <useoperationallayers>false</useoperationallayers>
    <respectcurrentmapscale>true</respectcurrentmapscale>
    <excludelayer>SJCounty_2009_1ft</excludelayer>
</configuration>

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
add comment

3 Answers

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
add comment

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:

 <basemaps>
   <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="..."/>
 </basemaps>

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

<configuration>
<usebasemaps>true</usebasemaps>
<useoperationallayers>false</useoperationallayers>
<respectcurrentmapscale>true</respectcurrentmapscale>
<excludelayer>Floodplain</excludelayer>

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
add comment

I believe this only works with map services.

share|improve this answer
add comment

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.