So I have 4 different types of annotations that show specific pins (i.e. colors). I want to be able to have a segmented control that allows users to show/hide these annotations by type.
Is there a simple way to hide specific annotations on command? Or do I really have to remove, then rebuild the annotations with only the ones I want shown?
This app could potentially have hundreds or thousands of pins, all of which will be 1 of the 4 different types of pins.
Thanks!
Figured it out.
Basically when creating the annotations, I store them in different arrays (for each type).
Then, when my button is pressed to filter them, I use the following:
This seems to work fine and doesnt cause problems with duplicating annotations. I used an NSLog to output the _mapView.annotations.count to verify that the annotations were duplicating.
Hope this helps others!