4 #include <QGraphicsGeoMap>
5 #include <QGeoPositionInfo>
6 #include <QGeoPositionInfoSource>
7 #include <QGeoCoordinate>
9 using namespace QtMobility;
11 class FilteredFriendModel;
16 class GeoMap : public QGraphicsGeoMap
20 Q_PROPERTY(qreal angleToGpsLocation READ angleToGpsLocation NOTIFY positionChanged)
21 Q_PROPERTY(qreal distanceToGpsLocation READ distanceToGpsLocation NOTIFY positionChanged)
22 Q_PROPERTY(double centerLatitude READ centerLatitude WRITE setCenterLatitude NOTIFY positionChanged)
23 Q_PROPERTY(double centerLongitude READ centerLongitude WRITE setCenterLongitude NOTIFY positionChanged)
24 Q_PROPERTY(double gpsLocationLatitude READ gpsLocationLatitude NOTIFY gpsLocationChanged)
25 Q_PROPERTY(double gpsLocationLongitude READ gpsLocationLongitude NOTIFY gpsLocationChanged)
28 GeoMap(QGraphicsItem* parent = 0);
31 qreal angleToGpsLocation() const;
32 qreal distanceToGpsLocation() const;
34 double centerLatitude() const;
35 void setCenterLatitude(const double latitude);
36 double centerLongitude() const;
37 void setCenterLongitude(const double longitude);
38 double gpsLocationLatitude() const;
39 double gpsLocationLongitude() const;
41 void setFriendModels(FriendModel* friendModel, FilteredFriendModel* friendFilterModel);
42 void setRouteModel(RouteModel* routeModel);
45 void positionChanged();
46 void screenCenterChanged();
47 void gpsLocationChanged();
50 void goToGpsLocation();
51 void onClicked(qreal mouseX, qreal mouseY);
54 void positionUpdated(const QGeoPositionInfo& positionInfo);
56 void onFriendModelReset();
57 void onRouteModelReset();
60 Q_DISABLE_COPY(GeoMap);
61 Q_DECLARE_PRIVATE(GeoMap);
62 QScopedPointer<GeoMapPrivate> d_ptr;
64 QGeoPositionInfoSource *source;
65 QGeoCoordinate prevGpsLocation;