I am using iphone application. I have a map and an array of objects that contain the coordinates that should be mapped. A polyline is drawn between this point. So I want to know how to remove this polyline. Do not Show / Hide, but delete.
here is my code of how i draw it
int pointCount = [routeLatitudes count] / 2; // routeLatitudes is an array that contains the latitude of coordinates, and then the longitude.
MKMapPoint* pointArr = malloc(sizeof(MKMapPoint) * pointCount); int pointArrIndex = 0; for (int idx = 0; idx < [routeLatitudes count]; idx=idx+2) { CLLocationCoordinate2D workingCoordinate; workingCoordinate.latitude=[[routeLatitudes objectAtIndex:idx] doubleValue]; workingCoordinate.longitude=[[routeLatitudes objectAtIndex:idx+1] doubleValue]; MKMapPoint point = MKMapPointForCoordinate(workingCoordinate); pointArr[pointArrIndex] = point; pointArrIndex++; }
And to show / hide polylines, I created a link MKOverlayView * overlayView = nil;
overlayView.hidden = false / true;
Now I need to know how to remove / delete the drawn polylines.
Thanks in advance.
source share