ArcGISTiledMapServiceLayer don't have VisibleLayers  property

2900
10
12-05-2011 01:07 AM
ImtiyazPasha1
New Contributor
Hi,

ArcGISDynamicMapServiceLayer have VisibleLayers  property  to check visible subLayers on Map.
But How to check with ArcGISTiledMapServiceLayer's subLayers visible on  Map or not.

I want sublayer visibility on Map not DefaultVisibility of subLayers.

Please help me regarding this.


imtpa777
0 Kudos
10 Replies
DominiqueBroux
Esri Frequent Contributor
You can't change the sublayer visibilities of an ArcGISTiledMapServiceLayer.

The reason being that the tiles are not generated dynamically  but are pre-generated in the server cache with the visibilities defined by the service.

Sidenote : you can't either change the sublayer visibilities of an ArcGISDynamicMapServiceLayer when this one is cached.
0 Kudos
ImtiyazPasha1
New Contributor
You can't change the sublayer visibilities of an ArcGISTiledMapServiceLayer.

The reason being that the tiles are not generated dynamically  but are pre-generated in the server cache with the visibilities defined by the service.

Sidenote : you can't either change the sublayer visibilities of an ArcGISDynamicMapServiceLayer when this one is cached.


Thanks dbroux,

I have list of layers in TOC, I can make layer visible and invisible by checking the checkbox using ArcGISDynamicMapServiceLayer but there is no way with ArcGISTiledMapServiceLayer? I have performance problem with ArcGISDynamicMapsServiceLayer. Please help me regarding this...
0 Kudos
DominiqueBroux
Esri Frequent Contributor

I have list of layers in TOC, I can make layer visible and invisible by checking the checkbox using ArcGISDynamicMapServiceLayer but there is no way with ArcGISTiledMapServiceLayer?

Yes no way with an ArcGISTiledMapServiceLayer. The tiles are cached and can't be changed dynamically.
The caching mechanism allows good performance.


I have performance problem with ArcGISDynamicMapsServiceLayer.

It's the counterpart of the dynamicity.

Try to organize your services on the server by taking care of these constraints (not always easy, but...)
0 Kudos
ImtiyazPasha1
New Contributor
Yes no way with an ArcGISTiledMapServiceLayer. The tiles are cached and can't be changed dynamically.
The caching mechanism allows good performance.


It's the counterpart of the dynamicity.

Try to organize your services on the server by taking care of these constraints (not always easy, but...)


Thanks for your reply.

I think it need to be overcome in next release.
0 Kudos
LeenD_hondt
New Contributor III
Hi,

I have been searching for quiet a while on this issue and I saw on your thread that you managed to make a sublayer of an ArcGISDynamicMapServiceLayer visible and invisible.
Can you help me out with this?

I have a mapservice with two sublayers: On my service directory is mentioned:
Layers:
Tracks(0)
Trackselevation(1)

(So I suppose they are sublayers - they are actually just a different symbology of a layer but refering to same data)

I saw on one of the forum threads (http://forums.arcgis.com/threads/29105-visibleLayers-and-setVisibleLayers?highlight=sublayer) from a person of ESRI:"The key way to dynamically manipulate what's visible is by adding or subtracting layer index values in an array which gets passed into setVisibleLayers(). This can be done by using native splice and push JavaScript methods. See this Esri sample, specifically the toggle function."

I have no knowledge of Java code he was refering to and I was wondering how to put sublayers on and off with just flex code.

Any help on this would be really great,
Thanks in advance,
Kindly,
Leen

(on an old forum http://forums.esri.com/Thread.asp?c=158&f=2421&t=300662 I did find a solution, but in the current flexviewer, I do not have the property 'visiblelayers' presented there)


Thanks dbroux,

I have list of layers in TOC, I can make layer visible and invisible by checking the checkbox using ArcGISDynamicMapServiceLayer but there is no way with ArcGISTiledMapServiceLayer? I have performance problem with ArcGISDynamicMapsServiceLayer. Please help me regarding this...
0 Kudos
JenniferNery
Esri Regular Contributor
If you are using Flex Viewer, please post your question to: http://forums.arcgis.com/forums/111-ArcGIS-Viewer-for-Flex. If you are using Flex API: http://forums.arcgis.com/forums/18-ArcGIS-API-for-Flex. This forum is for ArcGIS API for Silverlight. Although Flex API have same property on ArcGISDynamicMapServiceLayer http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/ArcGISDynamicMapServiceLayer.html#v..., we target a different technology so code will be different. It is best to post your question there.
0 Kudos
LeenD_hondt
New Contributor III
Dear Jennifer,

Thanks. I will!
Kindly,

Leen

If you are using Flex Viewer, please post your question to: http://forums.arcgis.com/forums/111-ArcGIS-Viewer-for-Flex. If you are using Flex API: http://forums.arcgis.com/forums/18-ArcGIS-API-for-Flex. This forum is for ArcGIS API for Silverlight. Although Flex API have same property on ArcGISDynamicMapServiceLayer http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/ArcGISDynamicMapServiceLayer.html#v..., we target a different technology so code will be different. It is best to post your question there.
0 Kudos
JulianaLandor
New Contributor
You can't change the sublayer visibilities of an ArcGISTiledMapServiceLayer.
0 Kudos
AlejandroVargas
New Contributor
So in ArcGIS API for Flex 3.0, how does one obtain the visible layers of an ArcGISTiledMapServiceLayer for the sake of knowing which layers are visible?  I don't need to change the visible layers (I know this is impossible for a cached/tiled map service), but I would like to know what layers are visible.

How do I obtain the list of visible layers?
0 Kudos