Select to view content in your preferred language

get rid of a layer in a map without deleting it in server?

1439
10
01-14-2011 12:37 PM
GeorgiannaStrode
Deactivated User
A quick question:
How can I get rid of a layer in a Flex application(not to show up), but keep it in the map server and ArcMap software?
I think it might be some codes in config.xml file, in these following lines:
      
<map>
<operationallayers>
 
   <layer url="..." />
 
 
        </operationallayers>
    </map>


probably I can add some lines such as <exclude .. >

Anyone having any ideas on that? Thanks in advance
Tags (2)
0 Kudos
10 Replies
DasaPaddock
Esri Regular Contributor
If the layer type is dynamic, arcims or wms, you can set the visiblelayers in the layer tag to only the layers you want to be on.

See:
http://help.arcgis.com/en/webapps/flexviewer/help/layer_tag.htm
0 Kudos
GeorgiannaStrode
Deactivated User
I used to write codes like:
<layer label="Control Points" type="dynamic" visible="true" alpha="1"
   url=".../MapServer" />

and this enabled me to have assess to all the layers in the mapserver.

Now that I tried:
<layer label="Control Points" type="dynamic" visible="true" alpha="1"
   url=".../MapServer/1" />
   
    <layer label="Control Points" type="dynamic" visible="false" alpha="1"
   url=".../MapServer/2" />


but in this way no layer come out. Is there anyway to split these layers up and set the visible attribute of them separately?
0 Kudos
DasaPaddock
Esri Regular Contributor
You can control which layers are visible in the service like this:

<layer label="Control Points" type="dynamic" visible="true" alpha="1"
   url=".../MapServer" visiblelayers="0,1,2" />
0 Kudos
GeorgiannaStrode
Deactivated User
actually the difference made by
visiblelayers="0,1,2"
is just to choose which layers to be on, and which to be off by default. I want those layers to not just be off, but not in the list at all. But for some reason, I dont wanna delete them in the server and ArcMap.
0 Kudos
DasaPaddock
Esri Regular Contributor
This isn't currently supported. It would require customization to the TOC component inside the com.esri.viewer.components.toc package.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dasa,

   So you guys have no plan to add layerDefinitions support to applicable layers in the viewer?
0 Kudos
DasaPaddock
Esri Regular Contributor
Dasa,

   So you guys have no plan to add layerDefinitions support to applicable layers in the viewer?


You can set a definitionexpression on a "feature" layer, but we haven't had requests to add support for this to the config for "dynamic" layers. Would you have a use for this? I don't think it would help with what I think Georgianna is looking for.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dasa,

   OK, thanks for the info I just thought that if the layer had a layerDefinition then the toc would honor that as well and not show the other layers of the map service.
0 Kudos
GeorgiannaStrode
Deactivated User
This isn't currently supported. It would require customization to the TOC component inside the com.esri.viewer.components.toc package.


Since it's not supported, I gave up the trying on that. Thanks for telling me. But that feature might be really helpful if it is supported someday
0 Kudos