4 #include <QGraphicsGeoMap>
5 #include <QGeoPositionInfo>
6 #include <QGeoPositionInfoSource>
7 #include <QGeoCoordinate>
9 using namespace QtMobility;
11 class FilteredFriendModel;
15 class GeoMap : public QGraphicsGeoMap
19 Q_PROPERTY(qreal angleToGpsLocation READ angleToGpsLocation NOTIFY positionChanged)
20 Q_PROPERTY(qreal distanceToGpsLocation READ distanceToGpsLocation NOTIFY positionChanged)
21 Q_PROPERTY(double centerLatitude READ centerLatitude WRITE setCenterLatitude NOTIFY positionChanged)
22 Q_PROPERTY(double centerLongitude READ centerLongitude WRITE setCenterLongitude NOTIFY positionChanged)
23 Q_PROPERTY(double gpsLocationLatitude READ gpsLocationLatitude NOTIFY gpsLocationChanged)
24 Q_PROPERTY(double gpsLocationLongitude READ gpsLocationLongitude NOTIFY gpsLocationChanged)
27 GeoMap(QGraphicsItem* parent = 0);
30 qreal angleToGpsLocation() const;
31 qreal distanceToGpsLocation() const;
33 double centerLatitude() const;
34 void setCenterLatitude(const double latitude);
35 double centerLongitude() const;
36 void setCenterLongitude(const double longitude);
37 double gpsLocationLatitude() const;
38 double gpsLocationLongitude() const;
40 void setFriendModels(FriendModel* friendModel, FilteredFriendModel* friendFilterModel);
43 void positionChanged();
44 void screenCenterChanged();
45 void gpsLocationChanged();
48 void goToGpsLocation();
49 void onClicked(qreal mouseX, qreal mouseY);
52 void positionUpdated(const QGeoPositionInfo& positionInfo);
54 void onFriendModelReset();
57 Q_DISABLE_COPY(GeoMap);
58 Q_DECLARE_PRIVATE(GeoMap);
59 QScopedPointer<GeoMapPrivate> d_ptr;
61 QGeoPositionInfoSource *source;
62 QGeoCoordinate prevGpsLocation;