Class Navigation
Inherits the following classes: QObject
Public Properties
| Type | Name |
|---|---|
| property double | bearing |
| property QgsPoint | destination |
| property int | destinationFeatureCurrentVertex |
| property int | destinationFeatureVertexCount |
| property QString | destinationName |
| property double | distance |
| property Qgis::DistanceUnit | distanceUnits |
| property bool | isActive |
| property modelChanged QgsPoint | location |
| property QgsQuickMapSettings * | mapSettings |
| property NavigationModel * | model |
| property QgsGeometry | path |
| property bool | proximityAlarm |
| property double | proximityAlarmThreshold |
| property double | verticalDistance |
Public Signals
| Type | Name |
|---|---|
| signal void | destinationChanged |
| signal void | destinationFeatureCurrentVertexChanged |
| signal void | destinationFeatureVertexCountChanged |
| signal void | destinationNameChanged |
| signal void | detailsChanged |
| signal void | isActiveChanged |
| signal void | locationChanged |
| signal void | mapSettingsChanged |
| signal void | modelChanged |
| signal void | proximityAlarmChanged |
| signal void | proximityAlarmThresholdChanged |
Public Functions
| Type | Name |
|---|---|
| Navigation () |
|
| double | bearing () const |
| Q_INVOKABLE void | clear () |
| Q_INVOKABLE void | clearDestinationFeature () |
| QgsPoint | destination () const |
| int | destinationFeatureCurrentVertex () const |
| int | destinationFeatureVertexCount () const |
| QString | destinationName () const |
| double | distance () const |
| Qgis::DistanceUnit | distanceUnits () const |
| bool | isActive () const |
| QgsPoint | location () const |
| QgsQuickMapSettings * | mapSettings () const |
| NavigationModel * | model () const |
| Q_INVOKABLE void | nextDestinationVertex () |
| QgsGeometry | path () const |
| Q_INVOKABLE void | previousDestinationVertex () |
| bool | proximityAlarm () const |
| double | proximityAlarmThreshold () const |
| void | setDestination (const QgsPoint & point) |
| Q_INVOKABLE void | setDestinationFeature (const QgsFeature & feature, QgsVectorLayer * layer) |
| void | setLocation (const QgsPoint & point) |
| void | setMapSettings (QgsQuickMapSettings * mapSettings) |
| void | setProximityAlarm (const bool enabled) |
| void | setProximityAlarmThreshold (const double & threshold) |
| double | verticalDistance () const |
| ~Navigation () |
Public Properties Documentation
property bearing [1/2]
double Navigation::bearing;
property destination [1/2]
QgsPoint Navigation::destination;
property destinationFeatureCurrentVertex [1/2]
int Navigation::destinationFeatureCurrentVertex;
property destinationFeatureVertexCount [1/2]
int Navigation::destinationFeatureVertexCount;
property destinationName [1/2]
QString Navigation::destinationName;
property distance [1/2]
double Navigation::distance;
property distanceUnits [1/2]
Qgis::DistanceUnit Navigation::distanceUnits;
property isActive [1/2]
bool Navigation::isActive;
property location [1/2]
modelChanged QgsPoint Navigation::location;
property mapSettings [1/2]
QgsQuickMapSettings * Navigation::mapSettings;
property model [1/2]
NavigationModel * Navigation::model;
property path [1/2]
QgsGeometry Navigation::path;
property proximityAlarm [1/2]
bool Navigation::proximityAlarm;
property proximityAlarmThreshold [1/2]
double Navigation::proximityAlarmThreshold;
property verticalDistance [1/2]
double Navigation::verticalDistance;
Public Signals Documentation
signal destinationChanged
void Navigation::destinationChanged;
signal destinationFeatureCurrentVertexChanged
void Navigation::destinationFeatureCurrentVertexChanged;
signal destinationFeatureVertexCountChanged
void Navigation::destinationFeatureVertexCountChanged;
signal destinationNameChanged
void Navigation::destinationNameChanged;
signal detailsChanged
void Navigation::detailsChanged;
signal isActiveChanged
void Navigation::isActiveChanged;
signal locationChanged
void Navigation::locationChanged;
signal mapSettingsChanged
void Navigation::mapSettingsChanged;
signal modelChanged
void Navigation::modelChanged;
signal proximityAlarmChanged
void Navigation::proximityAlarmChanged;
signal proximityAlarmThresholdChanged
void Navigation::proximityAlarmThresholdChanged;
Public Functions Documentation
function Navigation
Navigation::Navigation ()
function bearing [2/2]
inline double Navigation::bearing () const
Returns the bearing between the current location and the destination points
function clear
Q_INVOKABLE void Navigation::clear ()
Clears any existing destination point and feature.
function clearDestinationFeature
Q_INVOKABLE void Navigation::clearDestinationFeature ()
Clears the current destination feature, as well as the current destination point.
function destination [2/2]
QgsPoint Navigation::destination () const
Returns the current destination point.
function destinationFeatureCurrentVertex [2/2]
int Navigation::destinationFeatureCurrentVertex () const
Returns the current focused vertex serving as destination point when a feature is used as destination.
Note:
for line and polygon geometries, vertex '0' represents the centroid of the geometry while it presents the first (or only) vertex in point geometries
function destinationFeatureVertexCount [2/2]
int Navigation::destinationFeatureVertexCount () const
Returns the vertex count available to cycle through as destination points when a feature is used as destination.
function destinationName [2/2]
QString Navigation::destinationName () const
Returns the current destination name.
See also: setDestinationFeature
function distance [2/2]
inline double Navigation::distance () const
Returns the 2D distance between the current location and the destination points
function distanceUnits [2/2]
inline Qgis::DistanceUnit Navigation::distanceUnits () const
Returns the distance unit used
function isActive [2/2]
bool Navigation::isActive () const
Returns TRUE when navigation is active.
function location [2/2]
QgsPoint Navigation::location () const
Returns the current location point.
function mapSettings [2/2]
inline QgsQuickMapSettings * Navigation::mapSettings () const
Returns the map settings object used to project points and calculate navigation details.
function model [2/2]
inline NavigationModel * Navigation::model () const
Returns the navigation model containing the destination point.
Note:
In the future, the model could contain intermediary stops
function nextDestinationVertex
Q_INVOKABLE void Navigation::nextDestinationVertex ()
Sets the destination point to the next vertex or centroid of the current destination feature.
Note:
if a destination feature has not been provided, calling this function does nothing
function path [2/2]
inline QgsGeometry Navigation::path () const
Returns the path between the current location and the destination points
function previousDestinationVertex
Q_INVOKABLE void Navigation::previousDestinationVertex ()
Sets the destination point to the previous vertex or centroid of the current destination feature.
Note:
if a destination feature has not been provided, calling this function does nothing
function proximityAlarm [2/2]
inline bool Navigation::proximityAlarm () const
Returns TRUE if the proximity alarm is enabled.
function proximityAlarmThreshold [2/2]
inline double Navigation::proximityAlarmThreshold () const
Returns the current distance threshold below which the proximity alarm will turn on when enabled.
function setDestination
void Navigation::setDestination (
const QgsPoint & point
)
Sets the current destination point.
function setDestinationFeature
Q_INVOKABLE void Navigation::setDestinationFeature (
const QgsFeature & feature,
QgsVectorLayer * layer
)
Sets a provided feature as navigation destination, which allows for users to cycle through the feature centroid and its individual vertices as destination point.
Parameters:
featurethe feature used as destinationlayerthe vector layer associated to the feature
function setLocation
void Navigation::setLocation (
const QgsPoint & point
)
Sets the current location point.
Note:
A null/empty geometry will be threated as a lack of available location information
function setMapSettings
void Navigation::setMapSettings (
QgsQuickMapSettings * mapSettings
)
Sets the map settings object used to project points and calculate navigation details.
function setProximityAlarm
void Navigation::setProximityAlarm (
const bool enabled
)
Sets whether the proximity alarm is enabled.
function setProximityAlarmThreshold
void Navigation::setProximityAlarmThreshold (
const double & threshold
)
Sets the distance threshold below which the proximity alarm will turn on when enabled. Once the distance threshold is met, the alarm sound will loop at a varying interval based on the distance between the device's current location and the destination. The closer to the destination, the shorter the interval.
function verticalDistance [2/2]
inline double Navigation::verticalDistance () const
Retuens the vertical distance between the current location and the destination points
Note:
if either points miss a Z value, the returned vertical distance value will be NaN
function ~Navigation
Navigation::~Navigation ()
The documentation for this class was generated from the following file src/core/navigation.h