[英]Mapbox iOS Mutable RMPolylineAnnotation
我希望使用RMPolylineAnnotation對象在用戶后面繪制一條路徑,目前正在運行,但是我目前正在didUpdateUserLocation中創建一個新的RMPolylineAnnotation,這似乎導致滯后和鋸齒現象。 當在地圖上向下移動時,它似乎也沒有顯示用戶的路徑。
這是我的didUpdateUserLocation方法中的代碼:
CLLocation *location = [[CLLocation alloc] initWithLatitude:[[[mapView userLocation] location] coordinate].latitude longitude:[[[mapView userLocation] location] coordinate].longitude];
[locations addObject:location];
path = [[RMPolylineAnnotation alloc] initWithMapView:mapView points:locations];
[mapView addAnnotation:path];
有誰知道一種更好的方法來創建此路徑,並避免滯后和鋸齒?
您是否每次都刪除舊的注釋? 那可能會影響性能。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.