IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

routeSegment QML Type

The routeSegment type represents a segment of a Route.

This type was introduced in QtLocation 5.5.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

routeSegment QML Type

  • Import Statement: import QtLocation 6.5

  • Since: QtLocation 5.5

  • Group: routeSegment is part of qml-QtLocation5-routing

Detailed Description

A routeSegment instance has information about the physical layout of the route segment, the length of the route and estimated time required to traverse the route segment and optional routeManeuvers associated with the end of the route segment.

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

The primary means of acquiring Route objects is via Routes via RouteModel.

Example

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

 
Sélectionnez
import QtQuick
import QtPositioning
import QtLocation

Text {
    text: "Segment distance " + routeSegment.distance + " meters, " + routeSegment.path.length + " points."
}

Property Documentation

 

distance : real

Read-only property which holds the distance covered by this segment of the route, in meters.

maneuver : RouteManeuver

Read-only property which holds the maneuver for this route segment.

Will return invalid maneuver if no information has been attached to the endpoint of this route segment.

path : list<coordinate>

Read-only property which holds the geographical coordinates of this segment. Coordinates are listed in the order in which they would be traversed by someone traveling along this segment of the route.

To access individual segments you can use standard list accessors: 'path.length' indicates the number of objects and 'path[index starting from zero]' gives the actual object.

See Also

travelTime : int

Read-only property which holds the estimated amount of time it will take to traverse this segment, in seconds.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+