hiding legend cells in tableview

1295
2
12-11-2012 11:11 AM
HamzaHaroon
Occasional Contributor
im using this offline tiled example to hide legend items for certain layers. I am able to hide the cells, but what this also does is hide the mapview layer aswell. how can i modify this code to not turn off the map view layers and use another boolean variable instead of the current invisible, since i need to use invisible for something else.
0 Kudos
2 Replies
AaronConnolly
Occasional Contributor
im using this offline tiled example to hide legend items for certain layers. I am able to hide the cells, but what this also does is hide the mapview layer aswell. how can i modify this code to not turn off the map view layers and use another boolean variable instead of the current invisible, since i need to use invisible for something else.


You can comment out line 83 from DynamicTOCViewController.m, specifically in the layerTransparencySwitchUpdated event. You'll notice that it sets the alpha of the UIView that represents the map layer to 0 when the switch in the psuedo-section header is OFF and 1 when it is ON.

I'm not sure what you mean by "current invisible"? The hidden property of UIView doesn't seem to work either because as soon as you flip it to OFF the layer can never me turned on again. This might be why you set the alpha on the layer.

- Aaron
0 Kudos
HamzaHaroon
Occasional Contributor
Thanks for the reply. I got what i wanted working by using 2 extra boolean variables. what i meant by current visible is that the cells use the visible property of the legenInfo objects to check if they should show or not. I plan on using that for something else, so i needed to use another method to be able to hide and show the legend layers. line 83 did the trick for not turning off the actual layers.

thanks for the help.
0 Kudos