ESRI arcgis 10.1.1 ios skd 中通过gps 设备进行地图上的导航功能

来源:互联网 发布:linux 文件夹写权限 编辑:程序博客网 时间:2024/06/05 19:47

实现,ESRI arcgis 10.1.1 ios skd 中通过gps 设备进行地图上的导航功能。

参考 资料: http://gis.stackexchange.com/questions/57487/force-arcgis-ios-to-use-gps-data-from-external-gps-device

相关例子 :  http://www.arcgis.com/home/item.html?id=5e9fe50031f5461796b5d158a11d0bad

步骤:

  1. 定义一个 mapView 对象。
    AGSMapView* _mapView;

  2. 使用 locationDisplay 方法

    [self.mapView.locationDisplay addObserver:self forKeyPath:@"navigationMode" options:(NSKeyValueObservingOptionNew) context:NULL];self.mapView.locationDisplay.autoPanMode = AGSLocationDisplayAutoPanModeNavigation;

  3. 切换定位开关功能

    -(IBAction)locationBtnClicked:(id)sender{    NSLog(@"开始定位");    if(!self.mapView.locationDisplay.dataSourceStarted)    {        [self.mapView.locationDisplay startDataSource];        self.mapView.locationDisplay.autoPanMode = AGSLocationDisplayAutoPanModeDefault;        //Set a wander extent equal to 75% of the map's envelope        //The map will re-center on the location symbol only when        //the symbol moves out of the wander extent        //self.mapView.locationDisplay.wanderExtentFactor = 0.75;    }else{        [self.mapView.locationDisplay stopDataSource];    } }



  4. 实现定位方法
    - (void)observeValueForKeyPath:(NSString *)keyPath  ofObject:(id)object                        change:(NSDictionary *)change                       context:(void *)context {}



原创粉丝点击