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

Description

A datasource for AGSLocationDisplay based on Core Location.

Instances of this class represent a datasource that provides device location based on Apple's Core Location services.

Note
The datasource needs the app to be authorized in order to access the device's location. The app's Info.plist must contain appropriate purpose strings (NSLocationWhenInUseUsageDescription, NSLocationAlwaysUsageDescription, or NSLocationAlwaysAndWhenInUseUsageDescription keys) to permit this functionality. When the datasource is started it will attempt to request when-in-use authorization if the app's authorization status is not determined, otherwise it will reuse the authorization that has already been granted. If authorization is denied, location updates will not be available.
Since
100
See also
AGSLocationDisplay
Inheritance diagram for AGSCLLocationDataSource:
AGSLocationDataSource AGSObject

Instance Methods

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

Properties

NSError * error
 
id< AGSLocationChangeHandlerDelegatelocationChangeHandlerDelegate
 
CLLocationManager * locationManager
 
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).

◆ 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

◆ locationManager

- (CLLocationManager*) locationManager
readnonatomicstrong

The location manager used by this datasource. You should not call the start/stop methods on the location manager directly (startUpdatingLocation, startUpdatingHeading, stopUpdatingLocation, stopUdpdatingHeading, etc). Also do not assign yourself as the delegate to this location manager.

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