【问题标题】:iOS tracking location while walking走路时iOS跟踪位置
【发布时间】:2013-06-19 10:57:36
【问题描述】:

嗨,朋友们,我是 iOS 应用程序开发的新手。我正在开发要在其中实现跟踪功能的 iOS 应用程序。

这意味着用户可以从他当前站立的位置开始跟踪,然后在Mapview 上继续显示他将要绘制的路径。

我已经尝试用谷歌搜索,但我不知道如何在行走时通过添加连续的经纬度来绘制连续路径。

谁能建议我如何实现这个?

任何建议都将受到高度赞赏。

谢谢。

【问题讨论】:

  • 试试 Apple 的面包屑样本。

标签: iphone objective-c ios6 geolocation mapkit


【解决方案1】:

阅读 CLLocationManager 上的文档: http://developer.apple.com/library/mac/#documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html

和 MKMapview: http://developer.apple.com/library/ios/#DOCUMENTATION/MapKit/Reference/MKMapView_Class/MKMapView/MKMapView.html

您很可能希望使用 CLLocationManagerDelegate 方法来获取有关用户位置的更新:

-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations 

您还需要实现 MKMapViewDelegate 以使用用户的当前位置注释视图:

-(void)mapView:(MKMapView *)mv didAddAnnotationViews:(NSArray *)views

我希望这会为您指明正确的方向。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-11-14
    • 2011-05-22
    • 1970-01-01
    • 2016-10-01
    • 1970-01-01
    • 2022-10-02
    • 2011-04-05
    相关资源
    最近更新 更多