Manages the display of a device's location in a MapView. Location display can retrieve the device's current location from a LocationDataSource and display it on top of an ArcGISMap. As the device moves, the map view can respond to new locations by updating the position of the location symbol on the display. It can also set the viewpoint when an updated location is received, or automatically pan and rotate the map when the current location, heading, or course changes.
Each MapView has its own instance of LocationDisplay so you don't have to explicitly instantiate the location display. The location information is provided by a LocationDataSource. The current position of the device is provided by default from the operating system. To start receiving location updates, and display the current location, you must start the location display's data source.
Apart from the device operating system's built-in location, you can also display locations from other sources, including external (high accuracy) GPS, an indoor positioning system (IPS), or simulated locations (for mocking location updates) using the following location data sources:
By default, the location display uses a blue, round symbol to show the current location. Depending on signal strength, satellite positions, and other factors, the accuracy of the reported location can vary. An additional blue circle (LocationDisplay.accuracySymbol) around the location symbol indicates the estimated range of accuracy for the current location. As locations are read from the configured LocationDataSource, this outer circle may contract and expand as accuracy increases or decreases. You can display further information about the location using the following symbols:
You can change the default symbology of these symbols to make them more visible against the underlying map cartography, increase their visibility for visually impaired users, or match an app's visual appearance.
A symbol used to represent location accuracy. The accuracy of the location can vary depending on signal strength, satellite positions, and other factors. This circle may contract and expand as the accuracy of the locations, read from the LocationDataSource, increases or decreases.
The symbol used to display the last known location while the current location is being acquired. The symbol will be shown until a new location fix is found. This symbol may be used immediately after starting the LocationDisplay. Once an up-to-date location is acquired, the LocationDisplay.defaultSymbol, LocationDisplay.courseSymbol, or LocationDisplay.headingSymbol is used, depending on the current settings of the LocationDisplay. The default symbol is a grey circle.
Defines how the MapView reacts when location updates are received. The different auto-pan modes are suited for different types of app, including modes designed for navigation on foot and in a vehicle. They affect the symbols used to display device location, the initial zooming behavior, and the panning behavior of the MapView.
The symbol used to display the current location and the course (direction of travel) when moving. This symbol rotates with the heading of the movement. If course information is not available (for example if the device is not moving), the LocationDisplay.defaultSymbol is used.
The heading angle of the current location in degrees relative to north. This is only applicable when the auto-pan mode is LocationDisplayAutoPanMode.CompassNavigation. The value 0 means the device is pointed toward magnetic north, 90 means it is pointed due east, 180 means it is pointed due south, and so on. A negative value indicates that the heading could not be determined.
The symbol used for the location when the auto-pan mode is LocationDisplayAutoPanMode.CompassNavigation. The symbol is rotated to match with the heading of the compass. If there is no heading information (for example, if the device does not have a compass sensor), the LocationDisplay.defaultSymbol is used.
The scale that the map should automatically be zoomed to upon receiving the first location update. The initial map scale to which the MapView will zoom when the first location update is received after the auto-pan mode is changed from LocationDisplayAutoPanMode.Off to any other value. The default value is 10,000.
The navigation point height factor. The factor will decide the location symbol position vertically from the bottom of the map when the auto-pan mode is LocationDisplayAutoPanMode.Navigation. When navigating in a map, the current location is typically vertically positioned near the bottom of the map, and horizontally centered in the map, so that the map displays as much of the route ahead as possible.
True if the LocationDisplay.courseSymbol is used to display current location, when the location updates indicate the device is moving, false otherwise. If no course information is available, the default symbol will be used instead. The LocationDisplay.courseSymbol is rotated in order to indicate the device's direction of travel. Generally, course information is only available if the device is actively moving (the location has a positive speed).
The wander extent factor controls the re-centering behavior of the MapView when the location changes. The proportion of the current extent within which the location can be without automatically panning the map. Permitted values are in the range between 0 (continuous panning) and 1 (only pan when the location reaches the edge of the current extent). This value only applies when the auto-pan mode is LocationDisplayAutoPanMode.Recenter. Lower values within this range will cause the map to re-center more often, leading to higher CPU and battery consumption.