4 #include <QGraphicsGeoMap>
5 #include <QGeoPositionInfo>
6 #include <QGeoPositionInfoSource>
7 #include <QGeoCoordinate>
10 using namespace QtMobility;
12 class GeoMap : public QGraphicsGeoMap
16 Q_PROPERTY(qreal angleToGpsLocation READ angleToGpsLocation NOTIFY positionChanged)
17 Q_PROPERTY(qreal distanceToGpsLocation READ distanceToGpsLocation NOTIFY positionChanged)
18 Q_PROPERTY(double centerLatitude READ centerLatitude WRITE setCenterLatitude NOTIFY positionChanged)
19 Q_PROPERTY(double centerLongitude READ centerLongitude WRITE setCenterLongitude NOTIFY positionChanged)
20 Q_PROPERTY(double gpsLocationLatitude READ gpsLocationLatitude NOTIFY gpsLocationChanged)
21 Q_PROPERTY(double gpsLocationLongitude READ gpsLocationLongitude NOTIFY gpsLocationChanged)
24 GeoMap(QGraphicsItem* parent = 0);
27 qreal angleToGpsLocation() const;
28 qreal distanceToGpsLocation() const;
30 double centerLatitude() const;
31 void setCenterLatitude(const double latitude);
32 double centerLongitude() const;
33 void setCenterLongitude(const double longitude);
34 double gpsLocationLatitude() const;
35 double gpsLocationLongitude() const;
38 void positionChanged();
39 void screenCenterChanged();
40 void gpsLocationChanged();
43 void goToGpsLocation();
46 void positionUpdated(const QGeoPositionInfo& positionInfo);
50 QGeoPositionInfoSource *source;
51 QGeoCoordinate prevGpsLocation;