toggling map symbols

781
5
Jump to solution
09-10-2012 05:53 AM
HamzaHaroon
Occasional Contributor
i have my legend using story board. i want to put a switch in the legend to toggle the map icons on and off. all of my map symbols are of the AGSDynamicMapServicelLayer class. how do i attach a button with each of the symbols so that when the button/switch is pressed, the symbols on the map appear, and dissappear?
0 Kudos
1 Solution

Accepted Solutions
NimeshJarecha
Esri Regular Contributor
You should set the layerDefinitions on AGSDynamicMapServiceLayer so that features with those symbol are not visible and refresh the layer.

Regards,
Nimesh

View solution in original post

0 Kudos
5 Replies
FrankLin1
New Contributor
I think it's not possible by AGSDynamicServiceMapLayer , AGSDynamicLayerView is just a subclass of UIImageView and what you see on the AGSMapView is an image without any attribute.

If I were you , I would use AGSGraphicsLayer to add those symbols , by "graphic in [AGSGraphicsLayer graphics]" can access symbol.

Frank
0 Kudos
HamzaHaroon
Occasional Contributor
i dont add the symbols myself. they come through a service. they are pretty much icons on the map. if i were to change them to somehow add as a graphics layer, i would have to change alot of code in my app. i added the switch in the legend, just need a way to make each type of icon appear and dissappear on the map.
0 Kudos
NimeshJarecha
Esri Regular Contributor
You should set the layerDefinitions on AGSDynamicMapServiceLayer so that features with those symbol are not visible and refresh the layer.

Regards,
Nimesh
0 Kudos
HamzaHaroon
Occasional Contributor
is there any example/sample of doing this? right now my legend is setup similar to the legend sample, except its using storyboard.
0 Kudos
HamzaHaroon
Occasional Contributor
thanks nimesh. layerdefinitions worked. i made an array that was edited from the swith buttons and passed that to the dynamicMapServiceLayer.
0 Kudos