LocationDisplay QML Type

MapView."> LocationDisplay QML Type | ArcGISQtQml
  • Esri.ArcGISRuntime
  • LocationDisplay
  • Manages the display of a device's location in a MapView. More...

    Import Statement: import Esri.ArcGISRuntime
    Since: Esri.ArcGISRuntime 100.0
    Inherits:

    Object

    Properties

    Signals

    Methods

    Detailed Description

    Location display can retrieve the device's current location from a AbstractLocationDataSource and display it on top of a Map. 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 AbstractLocationDataSource. 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 (accuracySymbol) around the location symbol indicates the estimated range of accuracy for the current location. As locations are read from the configured AbstractLocationDataSource, 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.

    See also MapView::locationDisplay.

    Property Documentation

    accuracySymbol : Symbol

    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 AbstractLocationDataSource, increases or decreases.

    The default symbol is a blue outline with a semi-transparent white fill.


    acquiringSymbol : Symbol

    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 defaultSymbol, courseSymbol, or headingSymbol is used, depending on the current settings of the LocationDisplay. The default symbol is a grey circle.


    acquiringTimeoutMs : int

    The time in milliseconds between the last valid position update and displaying the acquiring symbol.

    The default timeout is 5 seconds. If the acquiringTimeout is passed, the location symbol will change to display the location acquiring symbol (which is gray in color).


    autoPanMode : Enums.LocationDisplayAutoPanMode

    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 auto-pan modes include:

    • Recenter - the map view attempts to keep the location symbol on-screen by re-centering the location symbol when the symbol moves outside an extent defined by the wanderExtentFactor.
    • Navigation - the location symbol is pinned to a point on the screen and always points toward the top edge of the device. The map pans and rotates based on location updates and the direction of travel.
    • Compass navigation - the location symbol is pinned to a point on the screen and always points toward the top edge of the device. The map rotates based on the user's bearing relative to magnetic north.
    • Off - the map only updates the position of the location symbol on the map.

    To start the LocationDisplay in a specific mode, call this method before you start the AbstractLocationDataSource.

    Any default zooming behavior (besides scrolling) or any operation that modifies the Viewpoint will automatically set the auto-pan mode to Enums.LocationDisplayAutoPanModeOff.

    The default auto-pan mode is Enums.LocationDisplayAutoPanModeOff.

    See also Enums.LocationDisplayAutoPanMode.


    courseSymbol : Symbol

    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 defaultSymbol is used.


    [since Esri.ArcGISRuntime 100.8] dataSource : AbstractLocationDataSource

    The location data source used for generating location updates.

    LocationDisplay uses a location data source to provide the current position of the device. To start receiving location updates, and display the current location, you must start the location data source.

    By default the location data source obtains locations from the device's operating system.

    Alternative location data sources include:

    This property was introduced in Esri.ArcGISRuntime 100.8.


    defaultSymbol : Symbol

    The symbol used for the location when not moving.

    Changing the location symbols is typically done if the existing symbols do not work well with the underlying map cartography, to increase visibility for visually impaired users, or to match an apps visual appearance.


    [read-only] heading : double

    The heading angle of the current location in degrees relative to north (read-only).

    This is only applicable when the auto-pan mode is Enums.LocationDisplayAutoPanModeCompassNavigation. 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.


    headingSymbol : Symbol

    The symbol used for the location when the auto-pan mode is Enums.LocationDisplayAutoPanModeCompassNavigation.

    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 defaultSymbol is used.


    initialZoomScale : double

    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 Enums.LocationDisplayAutoPanModeOff to any other value. The default value is 10,000.


    [read-only] location : Location

    The most recent location reported by the location data source (read-only).

    The Location provides data for the single location, including position, course, velocity, and accuracy.


    [read-only] mapLocation : Point

    The map position of the most recent location reported by the location data source in the projection of the current map view (read-only).


    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 Enums.LocationDisplayAutoPanModeNavigation.

    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.


    opacity : real

    The opacity of content (all symbols) displayed by the LocationDisplay.

    The default value is 1. The opacity can be set to any real value from 0-1.


    pingAnimationSymbol : Symbol

    The symbol that will be animated around the location symbol, to indicate when location updates are received.

    Location update animations are only shown when showPingAnimationSymbol is true.


    showAccuracy : bool

    Whether to show the accuracy symbol for display.

    Returns true if the accuracy symbol is displayed. The default value is true.


    showLocation : bool

    Whether to show the location symbol for display.

    Returns true if the location symbol is displayed. The default value is true.


    showPingAnimationSymbol : bool

    Whether to show the ping animation symbol for display.

    Returns true if the ping animation symbol is displayed. The default value is true.


    [read-only] started : bool

    Returns whether the LocationDisplay is active (read-only).

    Returns true if the LocationDisplay is active


    useCourseSymbolOnMovement : bool

    true if the 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 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).


    wanderExtentFactor : real

    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 Enums.LocationDisplayAutoPanModeRecenter. Lower values within this range will cause the map to re-center more often, leading to higher CPU and battery consumption.


    Signal Documentation

    accuracySymbolChanged()

    Emitted when the accuracySymbol property changes.

    Note: The corresponding handler is onAccuracySymbolChanged.


    acquiringSymbolChanged()

    Emitted when the acquiringSymbol property changes.

    Note: The corresponding handler is onAcquiringSymbolChanged.


    acquiringTimeoutMsChanged()

    Emitted when the acquiringTimeoutMs property changes.

    Note: The corresponding handler is onAcquiringTimeoutMsChanged.


    autoPanModeChanged()

    Emitted when the autoPanMode property changes.

    If the visible map extent is changed by the user navigating the map interactively, or by a programmatic navigation method call, this will cause autoPanMode to be reset to Enums.LocationDisplayAutoPanModeOff. You can respond to this event if your app needs to revert to the previously set mode after that navigation has finished.

    Note: The corresponding handler is onAutoPanModeChanged.


    courseSymbolChanged()

    Emitted when the courseSymbol property changes.

    Note: The corresponding handler is onCourseSymbolChanged.


    [since Esri.ArcGISRuntime 100.8] dataSourceChanged()

    Emitted when the dataSource property changes.

    Note: The corresponding handler is onDataSourceChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.8.


    defaultSymbolChanged()

    Emitted when the defaultSymbol property changes.

    Note: The corresponding handler is onDefaultSymbolChanged.


    headingChanged()

    Emitted when the heading property changes.

    Note: The corresponding handler is onHeadingChanged.


    headingSymbolChanged()

    Emitted when the headingSymbol property changes.

    Note: The corresponding handler is onHeadingSymbolChanged.


    initialZoomScaleChanged()

    Emitted when the initialZoomScale property changes.

    Note: The corresponding handler is onInitialZoomScaleChanged.


    locationChanged()

    Emitted when the location and mapLocation properties changes.

    Location updates are only received when started is true.

    Note: The corresponding handler is onLocationChanged.


    Emitted when the navigationPointHeightFactor property changes.

    Note: The corresponding handler is onNavigationPointHeightFactorChanged.


    opacityChanged()

    Emitted when the opacity property changes.

    Note: The corresponding handler is onOpacityChanged.


    pingAnimationSymbolChanged()

    Emitted when the pingAnimationSymbol property changes.

    Note: The corresponding handler is onPingAnimationSymbolChanged.


    showAccuracyChanged()

    Emitted when the showAccuracy property changes.

    Note: The corresponding handler is onShowAccuracyChanged.


    showLocationChanged()

    Emitted when the showLocation property changes.

    Note: The corresponding handler is onShowLocationChanged.


    showPingAnimationSymbolChanged()

    Emitted when the showPingAnimationSymbol property changes.

    Note: The corresponding handler is onShowPingAnimationSymbolChanged.


    startedChanged()

    Emitted when the started property changes.

    Note: The corresponding handler is onStartedChanged.


    useCourseSymbolOnMovementChanged()

    Emitted when the useCourseSymbolOnMovement property changes.

    Note: The corresponding handler is onUseCourseSymbolOnMovementChanged.


    wanderExtentFactorChanged()

    Emitted when the wanderExtentFactor property changes.

    Note: The corresponding handler is onWanderExtentFactorChanged.


    Method Documentation

    void start()

    Starts the LocationDisplay on the MapView.

    If a location data source is not explicitly set, a DefaultLocationDataSource will be assigned and started. If you attempt to start location display on a instance that is already started, it will complete without attempting to start it again. There is no need to check if it is started before calling start. If a user had previously denied the app access to location services, calling start again will again attempt to start.


    void stop()

    Stops the LocationDisplay on the MapView.

    Calling stop on the LocationDisplay will automatically attempt to stop its location data source.


    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.