16 #ifndef QGSQUICKPOSITIONKIT_H
17 #define QGSQUICKPOSITIONKIT_H
20 #include <QtPositioning>
24 #include "qgis_quick.h"
49 Q_PROPERTY(
QgsPoint position READ position NOTIFY positionChanged )
56 Q_PROPERTY(
QgsPoint projectedPosition READ projectedPosition NOTIFY projectedPositionChanged )
63 Q_PROPERTY( QPointF screenPosition READ screenPosition NOTIFY screenPositionChanged )
70 Q_PROPERTY(
bool hasPosition READ hasPosition NOTIFY hasPositionChanged )
77 Q_PROPERTY(
double accuracy READ accuracy NOTIFY accuracyChanged )
84 Q_PROPERTY(
double screenAccuracy READ screenAccuracy NOTIFY screenAccuracyChanged )
91 Q_PROPERTY(
double direction READ direction NOTIFY directionChanged )
98 Q_PROPERTY(
bool isSimulated READ isSimulated NOTIFY isSimulatedChanged )
105 Q_PROPERTY(
QgsQuickMapSettings *mapSettings READ mapSettings WRITE setMapSettings NOTIFY mapSettingsChanged )
115 Q_PROPERTY( QVector<double> simulatePositionLongLatRad READ simulatePositionLongLatRad WRITE setSimulatePositionLongLatRad NOTIFY simulatePositionLongLatRadChanged )
121 Q_PROPERTY( QGeoPositionInfoSource *source READ source NOTIFY sourceChanged )
128 bool hasPosition()
const;
137 QPointF screenPosition()
const;
140 double accuracy()
const;
143 double screenAccuracy()
const;
151 double direction()
const;
154 bool isSimulated()
const;
163 QVector<double> simulatePositionLongLatRad()
const;
166 void setSimulatePositionLongLatRad(
const QVector<double> &simulatePositionLongLatRad );
172 QGeoPositionInfoSource *source()
const;
192 Q_INVOKABLE
void useSimulatedLocation(
double longitude,
double latitude,
double radius );
197 Q_INVOKABLE
void useGpsLocation();
237 void onPositionUpdated(
const QGeoPositionInfo &info );
238 void onMapSettingsUpdated();
239 void onUpdateTimeout();
240 void onSimulatePositionLongLatRadChanged( QVector<double> simulatePositionLongLatRad );
243 void replacePositionSource( QGeoPositionInfoSource *source );
244 QString calculateStatusLabel();
245 double calculateScreenAccuracy();
246 void updateProjectedPosition();
247 void updateScreenPosition();
248 void updateScreenAccuracy();
250 QGeoPositionInfoSource *gpsSource();
251 QGeoPositionInfoSource *simulatedSource(
double longitude,
double latitude,
double radius );
255 QPointF mScreenPosition;
256 double mAccuracy = -1;
257 double mScreenAccuracy = 2;
258 double mDirection = -1;
259 bool mHasPosition =
false;
260 bool mIsSimulated =
false;
261 QVector<double> mSimulatePositionLongLatRad;
262 std::unique_ptr<QGeoPositionInfoSource> mSource;
This class represents a coordinate reference system (CRS).
Point geometry type, with support for z-dimension and m-values.
The QgsQuickMapSettings class encapsulates QgsMapSettings class to offer settings of configuration of...
Convenient set of tools to read GPS position and accuracy.
double directionChanged() const
GPS direction, bearing in degrees clockwise from north to direction of travel.
void positionChanged()
GPS position in WGS84 coords.
void simulatePositionLongLatRadChanged(QVector< double > simulatePositionLongLatRad)
Uses of GPS and simulated position and sets its parameters.
double screenAccuracyChanged() const
Screen horizontal accuracy, 2 if not available or resolution is too small.
void hasPositionChanged()
hasPosition changed
void mapSettingsChanged()
Associated map settings.
double accuracyChanged() const
GPS horizontal accuracy in accuracyUnits, -1 if not available.
Q_INVOKABLE QString accuracyUnitsChanged() const
GPS horizontal accuracy units - meters (constant)
void isSimulatedChanged()
GPS position and accuracy is simulated (not real from GPS sensor).
void sourceChanged()
Emitted when the internal source of GPS location data has been replaced.
void projectedPositionChanged()
GPS position in map coords.
void screenPositionChanged()
GPS position in device coords (pixels).
DistanceUnit
Units of distance.