In my application, I use MKPolyline to track the user path. Sometimes (and not all the time, which I don’t understand), when a new new segment is added to the map, the entire line blinks. This is sometimes not the case. This is the code used to add lines:
CLLocationCoordinate2D coords[2]; coords[0] = CLLocationCoordinate2DMake(newLocation.coordinate.latitude, newLocation.coordinate.longitude); coords[1] = CLLocationCoordinate2DMake(oldLocation.coordinate.latitude, oldLocation.coordinate.longitude); MKPolyline* line = [MKPolyline polylineWithCoordinates:coords count:2]; [mapView addOverlay:line];
Did I miss something?
Edit: This usually happens when the application returns from the background. I'm not quite sure why, though, because I only add the overlay without changing the entire mapView.overlays array .... right?
source share