Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I created an app that will display the map and the location of the external GPS device. The scenario is using a wifly module to broadcast the GPS data of the GPS receiver in wifi. The app is now receiving the data from the wifly module.

My question is: How do i force ArcGIS to use the data from the wifly module? Im using the AGSLocationDisplay of ArcGIS iOS but its using the data from the CLLocation.

share|improve this question
1  
You are not going to find a simple switch to enable this, you will need to use the ArcGIS API for IOS to access the other device via network connection (wifi in your case) to get to the exposed interface. It sounds like you have done the hardest part already, getting the devices to talk, you just will need to create a new interface to read that input. –  D.E.Wright Apr 8 '13 at 20:55
    
Thanks for the reply D.E Wright. I just dont know where to start. I was actually planning to not use the ArcGIS location display and probably just create a point from the coordinates retrieved from the wifly dongle. –  Juno Apr 8 '13 at 22:05
add comment

1 Answer

With the 10.1.1 version of ArcGIS SDK you can replace the AGSLocationDisplay object's data source that AGSMapView uses with your own location data source. You don't have to rely on CLLocationManager as a GPS data source. You'll be able to get GPS location data from anywhere you want.

First, create an object that conforms to the AGSLocationDisplayDataSource protocol (defined here.) This object will need to get data from your wifly module (how I don't know) and return it when called. It needs to conform to the AGSLocationDisplayDataSource protocol:

@interface WiflyDataSource <AGSLocationDisplayDataSource> : NSObject
...

Second, on your AGSMapView object (let's call it mapView), there is a property called locationDisplay, it has a property called dataSource. Set dataSource with your object, like this:

WiflyDataSource* wiflyDataSource = [WiflyDataSource alloc] initWith...];  
mapView.locationDisplay.dataSource = wiflyDataSource;

Now the mapView will get location updates from your data source instead of the default one which uses CLLocationManager.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.