주어진 위치 (위도/경도)의 배열을 가진 MapKit으로 경로를 그리는 방법을 알아 내려고하고 있습니다. MKPolyline 및 MKOverlayRenderer를 사용해야한다고 생각합니다. 나는 MKRoute와 MKDirections에 관한 정보 만 찾을 수 있지만, 이것이 내가 필요한 것은 아니다.MapKit에서 실시간으로 경로를 그리는 방법 (iOS7 +)
처음에는 한 점을 갖습니다. 매 10 초마다 다른 지점이 추가됩니다. 시간이 지남에 따라 배열이 늘어나는 점들의 배열이 주어지면 실시간으로지도에 선을 그릴 수 있습니까?
이 모든입니다 지금까지 가지고
- (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id<MKOverlay>)overlay {
if ([overlay isKindOfClass:[MKPolyline class]]) {
MKPolyline *route = overlay;
MKPolylineRenderer *routeRenderer = [[MKPolylineRenderer alloc] initWithPolyline:route];
routeRenderer.strokeColor = [UIColor blueColor];
return routeRenderer;
}
return nil;
}
MKAnnotation (http://www.raywenderlich.com/21365/introduction-to-mapkit-in-ios-6-tutorial) 또는 지연된 선을 그리는 것입니까? –