I am using GoogleMap-IOS-1.8.1 SDK for displaying a map. I have to draw a GMSPolyline on the map. After a particular event I have to remove all GMSPolyline paths except for markers. I'm not sure of the best way to do that. The GoogleMaps documentation for iOS describe two methods to sue.
1. [mapView_ clear];
2. Set the GMSPolyline map property to nil
Here the first approach removes all Markers and Overlays as well. This isn't exactly what I want. And for 2nd one it doesn't seem like the best method to save all of the GMSPolyline object references and then go back and set them all to nil.
Is there a better way to do accomplish this task, or is this the only proper / correct way to do this?
I was hoping for something like the following.
for (GMSPolyline *polylineToremove in mapView_.polyline)
{
[mapView_ removeOverlay:overlayToRemove];
}