Qt 5.13 | Qt Location | QML Types | Navigator QML Type

Qt 5.13.2 Reference Documentation

# Navigator QML Type

The Navigator type offers functionalities to perform turn-by-turn navigation. More...

Import Statement: | import Qt.labs.location 1.0

- List of all members, including inherited members

## Properties

- active : bool
- directions
  - directions.nextManeuverIcon : Variant
  - directions.distanceToNextManeuver : real
  - directions.remainingTravelDistance : real
  - directions.remainingTravelDistanceToNextWaypoint : real
  - directions.traveledDistance : real
  - directions.timeToNextManeuver : int
  - directions.remainingTravelTime : int
  - directions.remainingTravelTimeToNextWaypoint : int
  - directions.traveledTime : int
  - directions.currentRoute : Route
  - directions.currentRouteLeg : RouteLeg
  - directions.currentSegment : int
- error : enumeration
- map : Map
- navigatorReady : bool
- plugin : Plugin
- positionSource : PositionSource
- route : Route
- trackPositionSource : bool

## Signals

- directions.destinationReached()
- directions.waypointReached(waypoint)

## Detailed Description

The Navigator purpose is to use a plugin's turn-by-turn navigation implementation in a QML application in a seamless manner. This object may take control of the map position, orientation, tilting and zoom, as well as changing the map style, elements on the map such as direction information. In certain cases, it may also restrict user interaction with the Map and with the items on it.

## Property Documentation

active : bool

This property tells whether the Navigator is navigating or not. Set this property to `true` to start the navigation. Set it to `false` to stop an active navigation session.

directions group
[read-only] directions.nextManeuverIcon : Variant
[read-only] directions.distanceToNextManeuver : real
[read-only] directions.remainingTravelDistance : real
[read-only] directions.remainingTravelDistanceToNextWaypoint : real
[read-only] directions.traveledDistance : real
[read-only] directions.timeToNextManeuver : int
[read-only] directions.remainingTravelTime : int
[read-only] directions.remainingTravelTimeToNextWaypoint : int
[read-only] directions.traveledTime : int
[read-only] directions.currentRoute : Route
[read-only] directions.currentRouteLeg : RouteLeg
[read-only] directions.currentSegment : int

These read-only properties are part of the directions property group. This property group holds the navigation progress information that can be used to access the route data and to extract directions.

Note: Some backends might not provide a full set of navigation progress information.

- The `nextManeuverIcon` property holds the next turn icon.
- The `distanceToNextManeuver` property holds the distance to the next maneuver, in meters.
- The `remainingTravelDistance` property holds the remaining travel distance, in meters.
- The `remainingTravelDistanceToNextWaypoint` property holds the remaining travel distance to the next waypoint, in meters.
- The `traveledDistance` property holds the traveled distance, in meters.
- The `timeToNextManeuver` property holds the time to the next maneuver, in milliseconds.
- The `remainingTravelTime` property holds the remaining travel time, in milliseconds.
- The `remainingTravelTimeToNextWaypoint` property holds the remaining travel time to the next waypoint, in milliseconds.
- The `traveledTime` property holds the traveled time, in milliseconds.
- The `currentRoute` property holds the current route the navigator is following. This can be the same as route, or can be different, if the navigator cannot follow the user-specified route. For example, if the position coming from positionSource is considerably off route, the navigation engine may recalculate and start to follow a new route.
- The `currentRouteLeg` property holds the current route leg the navigator is following. This is always a part of `currentRoute`, so the overallRoute property of `currentRouteLeg` holds the same route as `currentRoute`.
- The `currentSegment` property holds the index of the current RouteSegment in the `currentRoute`.

See also directions.waypointReached(), directions.destinationReached(), Route, RouteLeg, RouteSegment, and Waypoint.

[read-only] error : enumeration

This read-only property holds the latest error value of the geocoding request.

Constant | Description
--- | ---
`Navigator.NoError` | No error has occurred.
`Navigator.NotSupportedError` | Navigation is not supported by the service provider.
`Navigator.ConnectionError` | An error occurred while communicating with the service provider.
`Navigator.LoaderError` | The geoservice provider library could not be loaded. Setting QT_DEBUG_PLUGINS environment variable may help diagnosing the problem.
`Navigator.UnknownParameterError` | An unknown parameter was specified.
`Navigator.MissingRequiredParameterError` | Required parameter was not specified.
`Navigator.UnknownError` | Unknown error occurred.

map : Map

This property holds the Map that the navigator is in charge of controlling.

This is a write-once property. Once the Navigator has a Map associated with it, any attempted modifications of the map property will be ignored.

See also Map.

navigatorReady : bool

This read-only property tells whether the navigator is ready to start the navigation or not. A Navigator becomes ready once the plugin is attached and a navigation engine has been instantiated, and the other required properties are set to valid values.

plugin : Plugin

This property holds the plugin which provides the navigation functionality.

This is a write-once property. Once the Navigator has a plugin associated with it, any attempted modifications of the plugin property will be ignored.

See also Plugin.

positionSource : PositionSource

This property holds the PositionSource that the navigator will receive position updates from to perform the navigation.

This is a write-once property. Once the Navigator has a PositionSource associated with it, any attempted modifications of the positionSource property will be ignored.

See also PositionSource.

route : Route

This property holds the Route that the navigator is supposed to use to perform the navigation.

Note: This property is not necessarily the same as currentRoute. currentRoute may differ, during routing, for various reasons. It is reasonable to assume, however, that currentRoute's destination will be the same as route's destination. Setting this property while a navigation session is ongoing will stop the navigation.

See also Route.

trackPositionSource : bool

This property tells whether the Navigator should control the Map camera to keep track of position source updates. This property is enabled (`true`) by default, and setting it to `false` is useful in cases where e.g. the user starts gesturing over the map area.

Navigator plugins can also control this property directly e.g. user map interaction could trigger the property change. Honoring the user-specified value of this property is plugin dependent.

## Signal Documentation

directions.destinationReached()

This signal is emitted when the last waypoint of the route, the destination, has been reached.

See also directions and directions.waypointReached().

directions.waypointReached(waypoint)

This signal is emitted when a waypoint has been reached.

See also directions and directions.destinationReached().