如何跟踪用户';s的位置,并使用MapBox iOS sdk显示经过的路径

如何跟踪用户';s的位置,并使用MapBox iOS sdk显示经过的路径,ios,iphone,map,mapbox,Ios,Iphone,Map,Mapbox,如何使用RMShape显示路径 我想做现场跟踪和绘制旅行路线 - (RMMapLayer *)mapView:(RMMapView *)mapView layerForAnnotation:(KRRMAnnotation *)annotation { if (annotation.isUserLocationAnnotation) return nil; KRCalloutView *calloutView = [[[UINib nibWithNibName:@

如何使用RMShape显示路径

我想做现场跟踪和绘制旅行路线

- (RMMapLayer *)mapView:(RMMapView *)mapView layerForAnnotation:(KRRMAnnotation *)annotation
{
    if (annotation.isUserLocationAnnotation)
        return nil;

    KRCalloutView *calloutView = [[[UINib nibWithNibName:@"KRRMCalloutView" bundle:nil] instantiateWithOwner:self options:nil] lastObject];
    calloutView.maxTitleLabelWidth = 250.0f;
    [calloutView setTitle:annotation.placeModel.title withAttributes:[KRStyleUtilities mapViewCalloutTextAttributes]];

    KRRMMarker *marker = [[KRRMMarker alloc]initWithUIImage:annotation.placeModel.pinImage andContentView:calloutView inMapView:mapView];
    marker.delegate = self.markerDelegateHandler;
    marker.cornerRadius = 10.0f;
    marker.correctCalloutPositionEnabled = YES;
    marker.canShowCallout = NO;

    return marker;
}

您可以删除并重新添加注释,强制重新绘制注释图层,也可以查看此修补程序,它将允许您调用图层重新绘制: