Select to view content in your preferred language

ArcGISTiledMapServiceLayer - Turning layers on and/or off

769
3
07-12-2011 07:30 AM
DaviKucharski
Deactivated User
I am new to the ArcGIS API for Flex, I have created a Tiled Service to use as my basemap. My company would still like the ability to turn layers on and/or off when they want.

With ArcGISDynamicMapServiceLayer I am able to give them this power. Can I give them this power by using the ArcGISTiledMapServiceLayer?

Thanks
Tags (2)
0 Kudos
3 Replies
ReneRubalcava
Esri Frequent Contributor
Yes you can.
Although the example here uses Dynamic layers to demonstrate turning layers on and off, you could modify it to accept Tile Layers as well.
http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=Dynamic_TOC

Looking at it, that example seems a little overcomplicated for what it's trying to demonstrate.

It basically boils down to wiring a layer to some action, say a togglebutton
<s:ToggleButton id="tb" selected="false" click="layer.visible = tb.selected />
0 Kudos
DaviKucharski
Deactivated User
I thought I could do that also, the problem is if the TiledLayerService has 10 individual layers inside of it, the tiles are cached images of how the layers would be presented at each scale.

At that point I don't believe I have control over any of the 10 layers inside the service because it is technically an image.

Let me know.
0 Kudos
ReneRubalcava
Esri Frequent Contributor
Oh, I'm sorry. You mean the individual layers in the actual service.

You are correct in that you cannot control the visibility of individual layers of a Tiled Service, as it is "fused". You could create a non-fused Tiled Map Service, but I have never tried that.

TiledMapLayer does not have a visibleLayers property like the DynamicLayer does to define visibility of individual layers of a service.
0 Kudos