ArcGIS Runtime SDK for iOS: AGSGPXLocationDataSource Class Reference
ArcGIS Runtime SDK for iOS  100.15
AGSGPXLocationDataSource Class Reference

Description

Simulates location updates based on a GPX file.

Instances of this class represent a datasource that can simulate location updates from a GPX file. If a track exists, it will use the first track segment in the file. Else, if a route exists, it will use the full route.

Note
The GPX file is loaded and parsed asynchronously when startWithCompletion: (AGSLocationDataSource) is invoked.
Since
100
See also
AGSLocationDisplay
Inheritance diagram for AGSGPXLocationDataSource:
AGSSimulatedLocationDataSource <AGSRemoteResource> AGSLocationDataSource AGSObject

Instance Methods

(void) - didStartOrFailWithError:
 
(void) - didStop
 
(void) - didUpdateHeading:
 
(void) - didUpdateLocation:
 
(void) - doStart
 
(void) - doStop
 
(instancetype) - initWithData:
 
(instancetype) - initWithName:
 
(instancetype) - initWithURL:
 
(void) - setLocationsWithPolyline:
 
(void) - startWithCompletion:
 
(void) - stop
 
(void) - stopWithCompletion:
 

Class Methods

(instancetype) + GPXLocationDataSourceWithData:
 
(instancetype) + GPXLocationDataSourceWithName:
 
(instancetype) + GPXLocationDataSourceWithURL:
 

Properties

AGSCredentialcredential
 
NSError * error
 
id< AGSLocationChangeHandlerDelegatelocationChangeHandlerDelegate
 
NSArray< AGSLocation * > * locations
 
AGSRequestConfigurationrequestConfiguration
 
BOOL started
 
AGSLocationDataSourceStatus status
 
NSURL * URL
 

Method Documentation

◆ didStartOrFailWithError:

- (void) didStartOrFailWithError: (nullable NSError *)  error

Subclasses must call this in doStart (AGSLocationDataSource(ForSubclassEyesOnly)) once the datasource has started.

Since
100

Provided by category AGSLocationDataSource(ForSubclassEyesOnly).

◆ didStop

- (void) didStop

Subclasses must call this in doStop (AGSLocationDataSource(ForSubclassEyesOnly)) once the datasource has stopped.

Since
100

Provided by category AGSLocationDataSource(ForSubclassEyesOnly).

◆ didUpdateHeading:

- (void) didUpdateHeading: (double)  heading

Subclasses must call this once they have a new heading.

Since
100

Provided by category AGSLocationDataSource(ForSubclassEyesOnly).

◆ didUpdateLocation:

- (void) didUpdateLocation: (AGSLocation *)  location

Subclasses must call this once they have a new location.

Since
100

Provided by category AGSLocationDataSource(ForSubclassEyesOnly).

◆ doStart

- (void) doStart

Subclasses must implement this method to start the datasource. Once the datasource has started or failed to start it should call didStartOrFailWithError: (AGSLocationDataSource(ForSubclassEyesOnly)). As updates are received, the datasource should call didUpdateLocation: (AGSLocationDataSource(ForSubclassEyesOnly)) or didUpdateHeading: (AGSLocationDataSource(ForSubclassEyesOnly)).

Since
100

Provided by category AGSLocationDataSource(ForSubclassEyesOnly).

◆ doStop

- (void) doStop

Subclasses must implement this method to stop the datasource. Once the datasource has stopped it should call didStop (AGSLocationDataSource(ForSubclassEyesOnly))

Since
100

Provided by category AGSLocationDataSource(ForSubclassEyesOnly).

◆ GPXLocationDataSourceWithData:

+ (instancetype) GPXLocationDataSourceWithData: (NSData *)  gpxData

Initialize the datasource using GPX data

Parameters
gpxDataRepresentation of data in a GPX file
Since
100

◆ GPXLocationDataSourceWithName:

+ (instancetype) GPXLocationDataSourceWithName: (NSString *)  name

Initialize this object with the name of a GPX (.gpx file) within the application bundle or shared documents directory.

Parameters
nameof GPX file (same as the name of the .gpx file without the file extension)
Since
100

◆ GPXLocationDataSourceWithURL:

+ (instancetype) GPXLocationDataSourceWithURL: (NSURL *)  URL

Initializes the datasource using a URL to the GPX file (on the web or on disk)

Parameters
URLURL to a GPX file on the web or on disk
Since
100

◆ initWithData:

- (instancetype) initWithData: (NSData *)  gpxData

Initialize the datasource using GPX data

Parameters
gpxDataRepresentation of data in a GPX file
Since
100

◆ initWithName:

- (instancetype) initWithName: (NSString *)  name

Initialize this object with the name of a GPX (.gpx file) within the application bundle or shared documents directory.

Parameters
nameof GPX file (same as the name of the .gpx file without the file extension)
Since
100

◆ initWithURL:

- (instancetype) initWithURL: (NSURL *)  URL

Initializes the datasource using a URL to the GPX file (on the web or on disk)

Parameters
URLURL to a GPX file on the web or on disk
Since
100

◆ setLocationsWithPolyline:

- (void) setLocationsWithPolyline: (AGSPolyline *)  polyline

Each vertex in the supplied polyline is used to simulate a location update. For example, if you have a polyline geometry representing a route and you want to simulate device movement along the route. A location update will be fired every second.

Parameters
polylineThe polyline must have valid spatial reference.
Since
100

◆ startWithCompletion:

- (void) startWithCompletion: (nullable void(^)(NSError *__nullable error))  completion

This is invoked by the location display on the datasource to initiate requesting location updates. Internally this method calls doStart (AGSLocationDataSource(ForSubclassEyesOnly)) which subclasses must implement.

Parameters
completionblock which will be invoked when the operation completes. If the dataSource failed to start, the error property will be populated.
Since
100

◆ stop

- (void) stop

This is invoked by the location display on the datasource to stop requesting location updates. Internally this method calls doStop (AGSLocationDataSource(ForSubclassEyesOnly)) which subclasses must implement.

Since
100
Deprecated:
100.14. Replaced by stopWithCompletion:.

Provided by category AGSLocationDataSource(AGSDeprecated).

◆ stopWithCompletion:

- (void) stopWithCompletion: (nullable void(^)(void))  completion

This is invoked by the location display on the datasource to stop requesting location updates. Internally this method calls doStop (AGSLocationDataSource(ForSubclassEyesOnly)) which subclasses must implement.

Since
100.14

Property Documentation

◆ credential

- (AGSCredential*) credential
readwritenonatomicstrong

Security credentials to access the remote GPX file. Only applicable if the file is secured.

Since
100

◆ error

- (NSError*) error
readnonatomicstronginherited

The error that prevented the datasource from starting or was encountered while retrieving a location udpate

Since
100

◆ locationChangeHandlerDelegate

- (id<AGSLocationChangeHandlerDelegate>) locationChangeHandlerDelegate
readwritenonatomicweakinherited

The delegate which will receive location, heading and status updates from the data source.

Since
100.6

◆ locations

- (NSArray<AGSLocation*>*) locations
readwritenonatomiccopyinherited

An array of AGSLocation objcts that this datasource will use to simulate location updates. A location update will be fired every second.

Since
100

◆ requestConfiguration

- (AGSRequestConfiguration*) requestConfiguration
readwritenonatomicstrong

Configuration which defines the behavior and policies to use when accessing the remote GPX file. The default will be nil. If it is nil the globalConfiguration (AGSRequestConfiguration) will be used.

Since
100

◆ started

- (BOOL) started
readnonatomicassigninherited

YES if the data source has been started, NO otherwise.

Since
100.0
Deprecated:
100.14. Replaced by AGSLocationDataSource::status.

Provided by category AGSLocationDataSource(AGSDeprecated).

◆ status

- (AGSLocationDataSourceStatus) status
readnonatomicassigninherited

The status of the data source.

Since
100.14

◆ URL

- (NSURL*) URL
readnonatomicstrong

URL to a GPX file on the web or on disk

Since
100