Qt 5.11 | Qt Location | QML Types | RouteManeuver QML Type

Qt 5.11.3 Reference Documentation

# RouteManeuver QML Type

The RouteManeuver type represents the information relevant to the point at which two RouteSegments meet. More...

Import Statement: | import QtLocation 5.11
Since: | QtLocation 5.5

- List of all members, including inherited members

## Properties

- direction : enumeration
- distanceToNextInstruction : real
- extendedAttributes : Object
- instructionText : string
- position : coordinate
- timeToNextInstruction : int
- valid : bool
- waypoint : coordinate
- waypointValid : bool

## Detailed Description

RouteSegment instances can be thought of as edges on a routing graph, with RouteManeuver instances as optional labels attached to the vertices of the graph.

The most interesting information held in a RouteManeuver instance is normally the textual navigation to provide and the position at which to provide it, accessible by instructionText and position respectively.

## Example

The following QML snippet demonstrates how to print information about a route maneuver:

      import QtQuick 2.3
      import QtPositioning 5.5
      import QtLocation 5.6

      Text {
          text: "Distance till next maneuver: " + routeManeuver.distanceToNextInstruction
                + " meters, estimated time: " + routeManeuver.timeToNextInstruction + " seconds."
      }

## Property Documentation

direction : enumeration

Describes the change in direction associated with the instruction text that is associated with a RouteManeuver.

- RouteManeuver.NoDirection - There is no direction associated with the instruction text
- RouteManeuver.DirectionForward - The instruction indicates that the direction of travel does not need to change
- RouteManeuver.DirectionBearRight - The instruction indicates that the direction of travel should bear to the right
- RouteManeuver.DirectionLightRight - The instruction indicates that a light turn to the right is required
- RouteManeuver.DirectionRight - The instruction indicates that a turn to the right is required
- RouteManeuver.DirectionHardRight - The instruction indicates that a hard turn to the right is required
- RouteManeuver.DirectionUTurnRight - The instruction indicates that a u-turn to the right is required
- RouteManeuver.DirectionUTurnLeft - The instruction indicates that a u-turn to the left is required
- RouteManeuver.DirectionHardLeft - The instruction indicates that a hard turn to the left is required
- RouteManeuver.DirectionLeft - The instruction indicates that a turn to the left is required
- RouteManeuver.DirectionLightLeft - The instruction indicates that a light turn to the left is required
- RouteManeuver.DirectionBearLeft - The instruction indicates that the direction of travel should bear to the left

distanceToNextInstruction : real

This read-only property holds the distance, in meters, between the point at which the associated instruction was issued and the point that the next instruction should be issued.

extendedAttributes : Object

This property holds the extended attributes of the maneuver and is a map. These attributes are plugin specific, and can be empty.

Consult the plugin documentation for what attributes are supported and how they should be used.

Note, due to limitations of the QQmlPropertyMap, it is not possible to declaratively specify the attributes in QML, assignment of attributes keys and values can only be accomplished by JavaScript.

This property was introduced in QtLocation 5.11.

instructionText : string

This read-only property holds textual navigation instruction.

position : coordinate

This read-only property holds where the instructionText should be displayed.

timeToNextInstruction : int

This read-only property holds the estimated time it will take to travel from the point at which the associated instruction was issued and the point that the next instruction should be issued, in seconds.

valid : bool

This read-only property holds whether this maneuver is valid or not.

Invalid maneuvers are used when there is no information that needs to be attached to the endpoint of a QGeoRouteSegment instance.

waypoint : coordinate

This property holds the waypoint associated with this maneuver. All maneuvers do not have a waypoint associated with them, this can be checked with waypointValid.

waypointValid : bool

This read-only property holds whether this waypoint, associated with this maneuver, is valid or not.