6#ifndef MARBLEQUICKITEM_H
7#define MARBLEQUICKITEM_H
10#include "GeoDataAccuracy.h"
11#include "GeoDataCoordinates.h"
12#include "GeoDataLineString.h"
14#include "MarbleGlobal.h"
17#include "PositionProviderPluginInterface.h"
20#include <QQuickPaintedItem>
21#include <QSharedPointer>
22#include <qqmlregistration.h>
26class GeoDataLatLonBox;
27class GeoDataPlacemark;
29class MarbleInputHandler;
30class MarbleQuickItemPrivate;
36 QML_NAMED_ELEMENT(MarbleItem)
40 Q_PROPERTY(
int mapWidth READ mapWidth WRITE setMapWidth NOTIFY mapWidthChanged)
41 Q_PROPERTY(
int mapHeight READ mapHeight WRITE setMapHeight NOTIFY mapHeightChanged)
42 Q_PROPERTY(
int zoom READ zoom WRITE setZoom NOTIFY zoomChanged)
43 Q_PROPERTY(
int minimumZoom READ minimumZoom NOTIFY minimumZoomChanged)
44 Q_PROPERTY(
int maximumZoom READ maximumZoom NOTIFY maximumZoomChanged)
45 Q_PROPERTY(
int radius READ radius WRITE setRadius NOTIFY radiusChanged)
46 Q_PROPERTY(qreal heading READ heading WRITE setHeading NOTIFY headingChanged)
48 Q_PROPERTY(
bool showFrameRate READ showFrameRate WRITE setShowFrameRate NOTIFY showFrameRateChanged)
49 Q_PROPERTY(Projection projection READ projection WRITE setProjection NOTIFY projectionChanged)
51 Q_PROPERTY(Marble::MapTheme *mapTheme READ mapTheme NOTIFY mapThemeChanged)
52 Q_PROPERTY(
QString mapThemeId READ mapThemeId WRITE setMapThemeId NOTIFY mapThemeIdChanged)
53 Q_PROPERTY(
bool showAtmosphere READ showAtmosphere WRITE setShowAtmosphere NOTIFY showAtmosphereChanged)
54 Q_PROPERTY(
bool showCompass READ showCompass WRITE setShowCompass NOTIFY showCompassChanged)
55 Q_PROPERTY(
bool showClouds READ showClouds WRITE setShowClouds NOTIFY showCloudsChanged)
56 Q_PROPERTY(
bool showCrosshairs READ showCrosshairs WRITE setShowCrosshairs NOTIFY showCrosshairsChanged)
57 Q_PROPERTY(
bool showGrid READ showGrid WRITE setShowGrid NOTIFY showGridChanged)
58 Q_PROPERTY(
bool showOverviewMap READ showOverviewMap WRITE setShowOverviewMap NOTIFY showOverviewMapChanged)
59 Q_PROPERTY(
bool showOtherPlaces READ showOtherPlaces WRITE setShowOtherPlaces NOTIFY showOtherPlacesChanged)
60 Q_PROPERTY(
bool showScaleBar READ showScaleBar WRITE setShowScaleBar NOTIFY showScaleBarChanged)
61 Q_PROPERTY(
bool showBackground READ showBackground WRITE setShowBackground NOTIFY showBackgroundChanged)
62 Q_PROPERTY(
bool showPositionMarker READ showPositionMarker WRITE setShowPositionMarker NOTIFY showPositionMarkerChanged)
63 Q_PROPERTY(
bool showPublicTransport READ showPublicTransport WRITE setShowPublicTransport NOTIFY showPublicTransportChanged)
64 Q_PROPERTY(
bool showOutdoorActivities READ showOutdoorActivities WRITE setShowOutdoorActivities NOTIFY showOutdoorActivitiesChanged)
65 Q_PROPERTY(
QString positionProvider READ positionProvider WRITE setPositionProvider NOTIFY positionProviderChanged)
66 Q_PROPERTY(
bool positionAvailable READ positionAvailable NOTIFY positionAvailableChanged)
67 Q_PROPERTY(
bool positionVisible READ positionVisible NOTIFY positionVisibleChanged)
68 Q_PROPERTY(MarbleMap *marbleMap READ map NOTIFY marbleMapChanged)
69 Q_PROPERTY(Placemark *currentPosition READ currentPosition NOTIFY currentPositionChanged)
70 Q_PROPERTY(qreal speed READ speed NOTIFY speedChanged)
71 Q_PROPERTY(qreal angle READ angle NOTIFY angleChanged)
72 Q_PROPERTY(
bool inertialGlobeRotation READ inertialGlobeRotation WRITE setInertialGlobeRotation NOTIFY inertialGlobeRotationChanged)
73 Q_PROPERTY(
bool animationViewContext READ animationViewContext WRITE setAnimationViewContext NOTIFY animationViewContextChanged)
74 Q_PROPERTY(
bool animationsEnabled READ animationsEnabled WRITE setAnimationsEnabled NOTIFY animationsEnabledChanged)
75 Q_PROPERTY(
QQmlComponent *placemarkDelegate READ placemarkDelegate WRITE setPlacemarkDelegate NOTIFY placemarkDelegateChanged)
76 Q_PROPERTY(
bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged)
77 Q_PROPERTY(
bool invertColorEnabled READ invertColorEnabled WRITE setInvertColorEnabled NOTIFY invertColorEnabledChanged)
78 Q_PROPERTY(
bool workOffline READ workOffline WRITE setWorkOffline NOTIFY workOfflineChanged)
94 MarbleInputHandler *inputHandler();
100 void setZoom(
int zoom, FlyToMode mode =
Instant);
102 void setRadius(
int radius);
103 void centerOn(
const GeoDataPlacemark &placemark,
bool animated =
false);
104 void centerOn(
const GeoDataLatLonBox &box,
bool animated =
false);
105 void centerOn(
const GeoDataCoordinates &coordinate);
106 void centerOn(qreal longitude, qreal latitude);
107 Q_INVOKABLE void centerOnCoordinates(qreal longitude, qreal latitude);
112 void zoomOut(FlyToMode mode =
Automatic);
118 void setMapWidth(
int mapWidth);
119 void setMapHeight(
int mapHeight);
120 void setShowFrameRate(
bool showFrameRate);
121 void setProjection(Projection projection);
122 void setMapThemeId(
const QString &mapThemeId);
123 void setShowAtmosphere(
bool showAtmosphere);
124 void setShowCompass(
bool showCompass);
125 void setShowClouds(
bool showClouds);
126 void setShowCrosshairs(
bool showCrosshairs);
127 void setShowGrid(
bool showGrid);
128 void setShowOverviewMap(
bool showOverviewMap);
129 void setShowOtherPlaces(
bool showOtherPlaces);
130 void setShowScaleBar(
bool showScaleBar);
131 void setShowBackground(
bool showBackground);
132 void setShowPositionMarker(
bool showPositionMarker);
133 void setShowPublicTransport(
bool showPublicTransport);
134 void setShowOutdoorActivities(
bool showOutdoorActivities);
135 void setPositionProvider(
const QString &positionProvider);
137 void setInertialGlobeRotation(
bool inertialGlobeRotation);
138 void setAnimationViewContext(
bool animationViewContext);
139 void setAnimationsEnabled(
bool animationsEnabled);
146 void setWorkOffline(
bool enabled);
150 Q_INVOKABLE void setShowRuntimeTrace(
bool showRuntimeTrace);
151 Q_INVOKABLE void setShowDebugPolygons(
bool showDebugPolygons);
152 Q_INVOKABLE void setShowDebugPlacemarks(
bool showDebugPlacemarks);
153 Q_INVOKABLE void setShowDebugBatches(
bool showDebugBatches);
165 void setHeading(qreal heading);
166 void setHoverEnabled(
bool hoverEnabled);
167 qreal centerLongitude()
const;
168 qreal centerLatitude()
const;
171 void paint(
QPainter *painter)
override;
175 void classBegin()
override;
176 void componentComplete()
override;
183 int mapWidth()
const;
184 int mapHeight()
const;
185 qreal heading()
const;
187 bool showFrameRate()
const;
188 Projection projection()
const;
190 Marble::MapTheme *mapTheme()
const;
191 bool showAtmosphere()
const;
192 bool showCompass()
const;
193 bool showClouds()
const;
194 bool showCrosshairs()
const;
195 bool showGrid()
const;
196 bool showOverviewMap()
const;
197 bool showOtherPlaces()
const;
198 bool showScaleBar()
const;
199 bool showBackground()
const;
200 bool showPositionMarker()
const;
201 bool showPublicTransport()
const;
202 bool showOutdoorActivities()
const;
203 QString positionProvider()
const;
204 bool positionAvailable()
const;
205 bool positionVisible()
const;
206 Q_INVOKABLE qreal distanceFromPointToCurrentLocation(
const QPoint &position)
const;
208 Placemark *currentPosition()
const;
210 Q_INVOKABLE QPointF screenCoordinatesFromGeoDataCoordinates(
const GeoDataCoordinates &coordinates)
const;
211 bool screenCoordinatesFromGeoDataLineString(
const GeoDataLineString &lineString,
QList<QPolygonF *> &polygons)
const;
213 bool screenCoordinatesToGeoDataCoordinates(
const QPoint &point, GeoDataCoordinates &coordinates);
218 MarbleModel *model();
219 const MarbleModel *model()
const;
222 const MarbleMap *map()
const;
224 bool inertialGlobeRotation()
const;
225 bool animationViewContext()
const;
226 bool animationsEnabled()
const;
229 void reverseGeocoding(
const QPoint &point);
231 bool hoverEnabled()
const;
240 int minimumZoom()
const;
242 int maximumZoom()
const;
245 void mapWidthChanged(
int mapWidth);
246 void mapHeightChanged(
int mapHeight);
247 void showFrameRateChanged(
bool showFrameRate);
248 void projectionChanged(Projection projection);
249 void mapThemeIdChanged(
const QString &mapThemeId);
250 void mapThemeChanged();
251 void showAtmosphereChanged(
bool showAtmosphere);
252 void showCompassChanged(
bool showCompass);
253 void showCloudsChanged(
bool showClouds);
254 void showCrosshairsChanged(
bool showCrosshairs);
255 void showGridChanged(
bool showGrid);
256 void showOverviewMapChanged(
bool showOverviewMap);
257 void showOtherPlacesChanged(
bool showOtherPlaces);
258 void showScaleBarChanged(
bool showScaleBar);
259 void showBackgroundChanged(
bool showBackground);
260 void showPositionMarkerChanged(
bool showPositionMarker);
261 void showPublicTransportChanged(
bool showPublicTransport);
262 void showOutdoorActivitiesChanged(
bool showOutdoorActivities);
263 void positionProviderChanged(
const QString &positionProvider);
264 void positionAvailableChanged(
bool positionAvailable);
265 void positionVisibleChanged(
bool positionVisible);
266 void marbleMapChanged();
267 void visibleLatLonAltBoxChanged();
268 void currentPositionChanged(Placemark *currentPosition);
271 void headingChanged(qreal heading);
273 void radiusChanged(
int radius);
274 void inertialGlobeRotationChanged(
bool inertialGlobeRotation);
275 void animationViewContextChanged(
bool animationViewContext);
276 void placemarkDelegateChanged(
QQmlComponent *placemarkDelegate);
278 void animationsEnabledChanged(
bool animationsEnabled);
280 void hoverEnabledChanged(
bool hoverEnabled);
282 void lmbMenuRequested(
const QPoint &point);
283 void rmbMenuRequested(
const QPoint &point);
284 void hoverPositionChanged(
const QPoint &point);
286 void minimumZoomChanged(
int minimumZoom);
287 void maximumZoomChanged(
int maximumZoom);
289 void invertColorEnabledChanged(
bool enabled);
290 void workOfflineChanged();
292 void geoItemUpdateRequested();
295 QObject *getEventFilter()
const;
300 void positionDataStatusChanged(PositionProviderStatus
status);
301 void positionChanged(
const GeoDataCoordinates &, GeoDataAccuracy);
302 void updatePositionVisibility();
303 void updateCurrentPosition(
const GeoDataCoordinates &coordinates);
304 void updatePlacemarks();
305 void handleReverseGeocoding(
const GeoDataCoordinates &coordinates,
const GeoDataPlacemark &placemark);
306 void handleVisibleLatLonAltBoxChanged(
const GeoDataLatLonAltBox &latLonAltBox);
310 MarbleQuickItemPrivatePtr d;
311 friend class MarbleQuickItemPrivate;
This file contains the headers for MarbleMap.
Represents a coordinate with the properties of a name and coordinates.
Q_SCRIPTABLE CaptureState status()
Binds a QML item to a specific geodetic location in screen coordinates.
@ Automatic
A sane value is chosen automatically depending on animation settings and the action.
@ Instant
Change camera position immediately (no interpolation)
@ Mercator
Mercator projection.
@ VerticalPerspective
Vertical perspective projection.
@ AzimuthalEquidistant
Azimuthal Equidistant projection.
@ Gnomonic
Gnomonic projection.
@ LambertAzimuthal
Lambert Azimuthal Equal-Area projection.
@ Equirectangular
Flat projection ("plate carree")
@ Spherical
Spherical projection ("Orthographic")
@ Stereographic
Stereographic projection.
QVariant property(const char *name) const const
virtual bool event(QEvent *ev) override