LocationDataSource

sealed class LocationDataSource

The location data source provides location information that can be displayed on a map using the com.arcgismaps.mapping.view.MapView.locationDisplay. This is a base class for a number of different location data sources, such as IndoorsLocationDataSource, NmeaLocationDataSource, RouteTrackerLocationDataSource, and SimulatedLocationDataSource. Call LocationDataSource.start to receive location updates and display the current location using the com.arcgismaps.mapping.view.MapView.locationDisplay.

Since

200.1.0

Inheritors

Properties

Link copied to clipboard
val error: StateFlow<Throwable?>

An error that describes a problem encountered while starting or running the LocationDataSource. This property is used to notify the user about errors that occur in LocationDataSource. Such errors are critical for LocationDataSource and will cause it stop. If LocationDataSource cannot be started, or it stopped after a successful start, this property will store information related to what caused LocationDataSource to stop.

Link copied to clipboard
val headingChanged: SharedFlow<Double>

A SharedFlow that emits heading changes.

Link copied to clipboard
open val locationChanged: SharedFlow<Location>

A SharedFlow that emits location changes.

Link copied to clipboard

The current status of the location data source. The status indicates if the location data source is starting, started, stopping, stopped, and has failed to start.

Functions

Link copied to clipboard
suspend fun start(): Result<Unit>

Starts the location data source asynchronously and prepares to begin receiving location updates.

Link copied to clipboard
suspend fun stop(): Result<Unit>

Stop the location data source asynchronously.