【问题标题】:How to track a user's location and display the path travelled using MapBox iOS sdk如何使用 MapBox iOS sdk 跟踪用户的位置并显示经过的路径
【发布时间】:2014-12-08 04:42:13
【问题描述】:

如何使用 RShape 显示路径?

我想做实时跟踪器和绘制旅行线。

- (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;
}

【问题讨论】:

    标签: ios iphone map mapbox


    【解决方案1】:

    您可以删除并重新添加注释,强制重绘注释图层,或者您可以查看此补丁,它允许您调用图层重绘:

    https://github.com/tracyharton/mapbox-ios-sdk/commit/31cda12f5bcc04dad42db2e07558b95eb43604a7

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-12-06
      • 1970-01-01
      • 2011-02-21
      • 1970-01-01
      • 2016-01-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多