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 )
122 bool hasPosition() const;
131 QPointF screenPosition() const;
134 double accuracy() const;
137 double screenAccuracy() const;
145 double direction() const;
148 bool isSimulated() const;
157 QVector<
double> simulatePositionLongLatRad() const;
160 void setSimulatePositionLongLatRad( const QVector<
double> &simulatePositionLongLatRad );
180 Q_INVOKABLE
void useSimulatedLocation(
double longitude,
double latitude,
double radius );
185 Q_INVOKABLE
void useGpsLocation();
189 void positionChanged();
192 void projectedPositionChanged();
195 void screenPositionChanged();
198 void hasPositionChanged();
201 double accuracyChanged() const;
204 double screenAccuracyChanged() const;
207 Q_INVOKABLE QString accuracyUnitsChanged() const;
210 double directionChanged() const;
213 void isSimulatedChanged();
216 void mapSettingsChanged();
219 void simulatePositionLongLatRadChanged( QVector<
double> simulatePositionLongLatRad );
222 void onPositionUpdated( const QGeoPositionInfo &info );
223 void onMapSettingsUpdated();
224 void onUpdateTimeout();
225 void onSimulatePositionLongLatRadChanged( QVector<
double> simulatePositionLongLatRad );
228 void replacePositionSource( QGeoPositionInfoSource *source );
229 QString calculateStatusLabel();
230 double calculateScreenAccuracy();
231 void updateProjectedPosition();
232 void updateScreenPosition();
233 void updateScreenAccuracy();
235 QGeoPositionInfoSource *gpsSource();
236 QGeoPositionInfoSource *simulatedSource(
double longitude,
double latitude,
double radius );
240 QPointF mScreenPosition;
241 double mAccuracy = -1;
242 double mScreenAccuracy = 2;
243 double mDirection = -1;
244 bool mHasPosition = false;
245 bool mIsSimulated = false;
246 QVector<
double> mSimulatePositionLongLatRad;
247 std::
unique_ptr<QGeoPositionInfoSource> mSource;
252 #endif // QGSQUICKPOSITIONKIT_H Helper functions for various unit types.
Convenient set of tools to read GPS position and accuracy.
The QgsQuickMapSettings class encapsulates QgsMapSettings class to offer settings of configuration of...
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
Point geometry type, with support for z-dimension and m-values.
This class represents a coordinate reference system (CRS).