Show / Hide Table of Contents

Class LocationDataSource

A base class for location information. The datasource can be used with the LocationDisplay and displayed on a map using the MapView's LocationDisplay property.

Inheritance
System.Object
LocationDataSource
IndoorsLocationDataSource
NmeaLocationDataSource
RouteTrackerLocationDataSource
SimulatedLocationDataSource
SystemLocationDataSource
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Esri.ArcGISRuntime.Location
Assembly: Esri.ArcGISRuntime.dll
Syntax
public abstract class LocationDataSource
Remarks

This is a base class for a number of different location data sources, such as IndoorsLocationDataSource, NmeaLocationDataSource, RouteTrackerLocationDataSource, and SimulatedLocationDataSource. Call StartAsync() to receive location updates and display the current location using the LocationDisplay.

Constructors

Name Description
LocationDataSource()

Initializes a new instance of the LocationDataSource class.

Properties

Name Description
Error

Gets an System.Exception that describes a problem encountered while starting or running the LocationDataSource.

Status

Gets the current status of the location datasource.

Methods

Name Description
CreateDefault()

Creates a default location datasource using the system location.

OnStartAsync()

Called when location tracking has started

OnStopAsync()

Called when location tracking has stopped

StartAsync()

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

StopAsync()

Stops location tracking.

UpdateHeading(Double)

Updates the current heading angle, in degrees clockwise, relative to north.

UpdateLocation(Location)

Updates the position of the current location.

Events

Name Description
ErrorChanged

Indicates that the Error property has changed.

HeadingChanged

Raised when the compass heading has changed.

LocationChanged

Raised when the location data source has a new location.

StatusChanged

Raised when the data source status has changed.

See Also

SystemLocationDataSource

Applies to

TargetVersions
.NET Standard 2.0100.3 - 200.7
.NET100.13 - 200.7
.NET Windows100.13 - 200.7
.NET Android200.0 - 200.7
.NET iOS200.0 - 200.7
.NET Framework100.0 - 200.7
Xamarin.Android100.0 - 100.15
Xamarin.iOS100.0 - 100.15
UWP100.0 - 200.7

Relevant samples

Display device location: Display your current position on the map, as well as switch between different types of auto pan Modes.
Find place: Find places of interest near a location or within a specific area.
Navigate route: Use a routing service to navigate between points.
Show location history: Display your location history on the map.
In This Article
Back to top Copyright © 2022 Esri.