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

Description

A location data source that uses a route tracker and a generic location data source to output locations snapped to a route.

Setting the AGSRouteTrackerLocationDataSource is optional when desiring to have the location display symbol navigate along a route. Using this object provides the benefit of having the current location snapped to the route polyline during navigation. If the AGSRouteTrackerLocationDataSource is not used, you may notice that the actual GPS location tends to wander off the route polyline due to the accuracy provided by the GPS unit.

No distance tolerance needs to be specified to enable the snapping effect of having the location display symbol follow along the route polyline. An internal algorithm is used by the AGSRouteTrackerLocationDataSource to determine if location is 'on route' or 'off route'. If the location is seen as 'on route' then snapping will occur, otherwise the output location will be the original input GPS location. If it is determined that the tracking along the route is no longer needed, stop (AGSLocationDataSource(AGSDeprecated)) can be called or the AGSLocationDisplay can be reset to a different data source.

To provide some insight on how the AGSRouteTrackerLocationDataSource works, the data source will pass the locations to trackLocation:completion: (AGSRouteTracker). The AGSTrackingStatus::displayLocation property will then be returned in locationDataSource:locationDidChange: (AGSLocationChangeHandlerDelegate-p).

To control the orientation of the location display symbol as it navigates along a route refer to the AGSLocationDisplay class.

Since
100.9
Inheritance diagram for AGSRouteTrackerLocationDataSource:
AGSLocationDataSource AGSObject

Instance Methods

(void) - didStartOrFailWithError:
 
(void) - didStop
 
(void) - didUpdateHeading:
 
(void) - didUpdateLocation:
 
(void) - doStart
 
(void) - doStop
 
(instancetype) - initWithRouteTracker:
 
(instancetype) - initWithRouteTracker:locationDataSource:
 
(void) - startWithCompletion:
 
(void) - stop
 
(void) - stopWithCompletion:
 

Class Methods

(instancetype) + routeTrackerLocationDataSourceWithRouteTracker:
 
(instancetype) + routeTrackerLocationDataSourceWithRouteTracker:locationDataSource:
 

Properties

NSError * error
 
id< AGSLocationChangeHandlerDelegatelocationChangeHandlerDelegate
 
BOOL started
 
AGSLocationDataSourceStatus status
 

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).

◆ initWithRouteTracker:

- (instancetype) initWithRouteTracker: (AGSRouteTracker *)  routeTracker

Creates an AGSRouteTrackerLocationDataSource object using the passed in AGSRouteTracker and the platform's default location data source.

Parameters
routeTrackerAn AGSRouteTracker object.
Since
100.9

◆ initWithRouteTracker:locationDataSource:

- (instancetype) initWithRouteTracker: (AGSRouteTracker *)  routeTracker
locationDataSource: (AGSLocationDataSource *)  locationDataSource 

Creates an AGSRouteTrackerLocationDataSource object.

Parameters
routeTrackerAn AGSRouteTracker object.
locationDataSourceAn AGSLocationDataSource object.
Since
100.9

◆ routeTrackerLocationDataSourceWithRouteTracker:

+ (instancetype) routeTrackerLocationDataSourceWithRouteTracker: (AGSRouteTracker *)  routeTracker

Creates an AGSRouteTrackerLocationDataSource object using the passed in AGSRouteTracker and the platform's default location data source.

Parameters
routeTrackerAn AGSRouteTracker object.
Returns
A new location data source.
Since
100.9

◆ routeTrackerLocationDataSourceWithRouteTracker:locationDataSource:

+ (instancetype) routeTrackerLocationDataSourceWithRouteTracker: (AGSRouteTracker *)  routeTracker
locationDataSource: (AGSLocationDataSource *)  locationDataSource 

Creates an AGSRouteTrackerLocationDataSource object.

Parameters
routeTrackerAn AGSRouteTracker object.
locationDataSourceAn AGSLocationDataSource object.
Returns
A new location data source.
Since
100.9

◆ 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

◆ 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

◆ 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