實現,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
步驟:
- 定義一個 mapView 對象。
AGSMapView* _mapView;
- 使用 locationDisplay 方法
[self.mapView.locationDisplay addObserver:self forKeyPath:@"navigationMode" options:(NSKeyValueObservingOptionNew) context:NULL];self.mapView.locationDisplay.autoPanMode
= AGSLocationDisplayAutoPanModeNavigation;
- 切換定位開關功能
-(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]; } }
- 實現定位方法
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {}