summaryrefslogtreecommitdiff
path: root/src/imports/location/qdeclarativegeomap_p.h
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2016-03-01 16:24:40 +0100
committerMichal Klocek <michal.klocek@theqtcompany.com>2016-03-17 06:56:11 +0000
commitde165175549642c7fefa901d41ee96ef0702879c (patch)
treec89145289e0a7147870bef06bfb8755440837d10 /src/imports/location/qdeclarativegeomap_p.h
parent3d8da84e368f87386f14287b10fb6d08e3ce2b48 (diff)
downloadqtlocation-de165175549642c7fefa901d41ee96ef0702879c.tar.gz
Remove QGeoMapController from QGeoMap
Refactor code to use QGeoCameraData directly. All functionality related to zoom, center boundary checks are now handled in QDeclaratvieGeoMap class. This makes handling of center and zoomLevel properties much simpler and less error prone, since camera data can not be modified along the call stack. As result we avoid forwarding change signals back and forth: * qgeodeclarativegeomap::setCenter -> qgeomapcontroller::setCenter * qgeomapcontroller::setCenter -> qgeomap::setCameraData * qgeomap::setCameraData -> qgeomacontroller::cameraDataChanged * qgeomapcontroller::cameraDataChanged -> emit qdecalartivegeomap::centerChanged Call always setCenter and setZoomLevel on qdeclarativegeomap instance instead. Introduce initialize() method to handle cases where map plugin is loaded and scenegraph geometery is not yet set. This is required to correctly handle new boundary checks to limit grey areas. Change-Id: I6066cefd4a648dc76333dc241d1f261451a32e9c Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/imports/location/qdeclarativegeomap_p.h')
-rw-r--r--src/imports/location/qdeclarativegeomap_p.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/imports/location/qdeclarativegeomap_p.h b/src/imports/location/qdeclarativegeomap_p.h
index 06c39640..3db1aed2 100644
--- a/src/imports/location/qdeclarativegeomap_p.h
+++ b/src/imports/location/qdeclarativegeomap_p.h
@@ -168,10 +168,9 @@ protected:
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE;
void setError(QGeoServiceProvider::Error error, const QString &errorString);
-
+ void initialize();
private Q_SLOTS:
void mappingManagerInitialized();
- void mapZoomLevelChanged(qreal zoom);
void pluginReady();
void onMapChildrenChanged();
@@ -186,7 +185,6 @@ private:
QDeclarativeGeoServiceProvider *m_plugin;
QGeoServiceProvider *m_serviceProvider;
QGeoMappingManager *m_mappingManager;
- QGeoCoordinate m_center;
QDeclarativeGeoMapType *m_activeMapType;
QList<QDeclarativeGeoMapType *> m_supportedMapTypes;
QList<QDeclarativeGeoMapItemView *> m_mapViews;
@@ -197,13 +195,14 @@ private:
QMutex m_updateMutex;
QString m_errorString;
QGeoServiceProvider::Error m_error;
- qreal m_zoomLevel;
QGeoShape m_region;
QColor m_color;
+ QGeoCameraData m_cameraData;
bool m_componentCompleted;
bool m_mappingManagerInitialized;
bool m_pendingFitViewport;
bool m_copyrightsVisible;
+ double m_maximumViewportLatitude;
friend class QDeclarativeGeoMapItem;
friend class QDeclarativeGeoMapItemView;