QGeoManeuverclass represents the information relevant to the point at which two QGeoRouteSegments meet. 更多 …
def
__eq__
(other)
def
__ne__
(other)
def
direction
()
def
distanceToNextInstruction
()
def
extendedAttributes
()
def
instructionText
()
def
isValid
()
def
position
()
def
setDirection
(direction)
def
setDistanceToNextInstruction
(distance)
def
setExtendedAttributes
(extendedAttributes)
def
setInstructionText
(instructionText)
def
setPosition
(position)
def
setTimeToNextInstruction
(secs)
def
setWaypoint
(coordinate)
def
timeToNextInstruction
()
def
waypoint
()
QGeoRouteSegmentinstances can be thought of as edges on a routing graph, withQGeoManeuverinstances as optional labels attached to the vertices of the graph.The most interesting information help in a
QGeoManeuverinstance is normally the textual navigation to provide and the position at which to provide it, accessible byinstructionText()andposition()分别。It is also possible to determine if a routing waypoint has been passed by checking if
waypoint()returns a validQGeoCoordinate.
QGeoManeuver
¶
QGeoManeuver(other)
- param other
Constructs a invalid maneuver object.
The maneuver will remain invalid until one of
setPosition()
,
setInstructionText()
,
setDirection()
,
setTimeToNextInstruction()
,
setDistanceToNextInstruction()
or
setWaypoint()
被调用。
PySide2.QtLocation.QGeoManeuver.
InstructionDirection
¶
Describes the change in direction associated with the instruction text that is associated with a QGeoManaeuver.
|
常量 |
描述 |
|---|---|
|
QGeoManeuver.NoDirection |
There is no direction associated with the instruction text. |
|
QGeoManeuver.DirectionForward |
The instruction indicates that the direction of travel does not need to change. |
|
QGeoManeuver.DirectionBearRight |
The instruction indicates that the direction of travel should bear to the right. |
|
QGeoManeuver.DirectionLightRight |
The instruction indicates that a light turn to the right is required. |
|
QGeoManeuver.DirectionRight |
The instruction indicates that a turn to the right is required. |
|
QGeoManeuver.DirectionHardRight |
The instruction indicates that a hard turn to the right is required. |
|
QGeoManeuver.DirectionUTurnRight |
The instruction indicates that a u-turn to the right is required. |
|
QGeoManeuver.DirectionUTurnLeft |
The instruction indicates that a u-turn to the left is required. |
|
QGeoManeuver.DirectionHardLeft |
The instruction indicates that a hard turn to the left is required. |
|
QGeoManeuver.DirectionLeft |
The instruction indicates that a turn to the left is required. |
|
QGeoManeuver.DirectionLightLeft |
The instruction indicates that a light turn to the left is required. |
|
QGeoManeuver.DirectionBearLeft |
The instruction indicates that the direction of travel should bear to the left. |
PySide2.QtLocation.QGeoManeuver.
direction
(
)
¶
Returns the direction associated with the associated instruction.
另请参阅
PySide2.QtLocation.QGeoManeuver.
distanceToNextInstruction
(
)
¶
qreal
Returns the distance, in meters, between the point at which the associated instruction was issued and the point that the next instruction should be issued.
PySide2.QtLocation.QGeoManeuver.
extendedAttributes
(
)
¶
Returns the extended attributes associated with this maneuver.
PySide2.QtLocation.QGeoManeuver.
instructionText
(
)
¶
unicode
Returns the textual navigation instructions.
另请参阅
PySide2.QtLocation.QGeoManeuver.
isValid
(
)
¶
bool
Returns 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
实例。
PySide2.QtLocation.QGeoManeuver.
__ne__
(
other
)
¶
other
–
QGeoManeuver
bool
Returns whether this maneuver is not equal to
other
.
PySide2.QtLocation.QGeoManeuver.
__eq__
(
other
)
¶
other
–
QGeoManeuver
bool
Returns whether this maneuver is equal to
other
.
PySide2.QtLocation.QGeoManeuver.
position
(
)
¶
QGeoCoordinate
Returns the position where
instructionText()
should be displayed.
另请参阅
PySide2.QtLocation.QGeoManeuver.
setDirection
(
direction
)
¶
direction
–
InstructionDirection
Sets the direction associated with the associated instruction to
direction
.
另请参阅
PySide2.QtLocation.QGeoManeuver.
setDistanceToNextInstruction
(
distance
)
¶
distance
–
qreal
Sets the distance, in meters, between the point at which the associated instruction was issued and the point that the next instruction should be issued to
distance
.
PySide2.QtLocation.QGeoManeuver.
setExtendedAttributes
(
extendedAttributes
)
¶
extendedAttributes –
Sets the extended attributes
extendedAttributes
associated with this maneuver.
另请参阅
PySide2.QtLocation.QGeoManeuver.
setInstructionText
(
instructionText
)
¶
instructionText – unicode
Sets the textual navigation instructions to
instructionText
.
另请参阅
PySide2.QtLocation.QGeoManeuver.
setPosition
(
position
)
¶
position
–
QGeoCoordinate
Sets the position where
instructionText()
should be displayed to
position
.
另请参阅
PySide2.QtLocation.QGeoManeuver.
setTimeToNextInstruction
(
secs
)
¶
secs
–
int
Sets 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, to
secs
.
PySide2.QtLocation.QGeoManeuver.
setWaypoint
(
coordinate
)
¶
coordinate
–
QGeoCoordinate
Sets the waypoint associated with this maneuver to
coordinate
.
另请参阅
PySide2.QtLocation.QGeoManeuver.
timeToNextInstruction
(
)
¶
int
Returns 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.
PySide2.QtLocation.QGeoManeuver.
waypoint
(
)
¶
QGeoCoordinate
Returns the waypoint associated with this maneuver.
If there is not waypoint associated with this maneuver an invalid
QGeoCoordinate
将被返回。
另请参阅