Is it possible to change layer visibility in a AGSDynamicServiceMapLayer?

544
4
10-04-2010 02:18 AM
JavierAbadía_Miranda
New Contributor
I mean, changing visibility of the layers that are within each service.

Thanks,
0 Kudos
4 Replies
DiveshGoyal
Esri Regular Contributor
Yes, you need to set the visibleLayers property on AGSDynamicMapServiceLayer.

You'll see it in the MapViewDemo sample
self.dynamicLayer.visibleLayers = [NSArray arrayWithObjects:[NSNumber numberWithInt:2], nil];
0 Kudos
JavierAbadía_Miranda
New Contributor
Yes, you need to set the visibleLayers property on AGSDynamicMapServiceLayer.

You'll see it in the MapViewDemo sample
self.dynamicLayer.visibleLayers = [NSArray arrayWithObjects:[NSNumber numberWithInt:2], nil];


ok... what is the relationship between self.dynamicLayer.visibleLayers and each layerInfo.visible property?

when I load the service (AGSDynamicMapServiceLayer), visibleLayers array is empty, but all layerInfo.visible attributes are set to true.

Is this property updated when I change the visibleLayers array?

Thanks
0 Kudos
JavierAbadía_Miranda
New Contributor
ok... what is the relationship between self.dynamicLayer.visibleLayers and each layerInfo.visible property?

when I load the service (AGSDynamicMapServiceLayer), visibleLayers array is empty, but all layerInfo.visible attributes are set to true.

Is this property updated when I change the visibleLayers array?

Thanks


ok, answer to my own questions:

- initially visibleLayers array is nil.
- each layer's visible property is the default visibility and doesn't change when you update the visibleLayers array

Is it correct? Thanks.
0 Kudos
NimeshJarecha
Esri Regular Contributor
ok, answer to my own questions:

- initially visibleLayers array is nil.
- each layer's visible property is the default visibility and doesn't change when you update the visibleLayers array

Is it correct? Thanks.


Yes, correct!
0 Kudos