summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-05-25 14:46:00 +0200
committerPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-05-31 08:54:18 +0000
commitf46abef02cf5c883deba753afeff0042fa36b6e4 (patch)
tree709ec5d97ca57f5a0a5cdc2aee9b4f24c709ded9
parent73f7665a7f78c59c55e31905609d7718eab08a01 (diff)
downloadqtlocation-f46abef02cf5c883deba753afeff0042fa36b6e4.tar.gz
Fix setZoomLevel and setCenter when called before initialization
setZoomLevel and setCenter must not do value clamping before the map has been fully initialized. Initialize() will take care of adjusting these values when called. Task-number: QTBUG-52030 Change-Id: I1b2004668c8482a4a0f54b00cbd8efb2dce1feca Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
-rw-r--r--src/imports/location/qdeclarativegeomap.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp
index a685a0f7..545ef608 100644
--- a/src/imports/location/qdeclarativegeomap.cpp
+++ b/src/imports/location/qdeclarativegeomap.cpp
@@ -684,7 +684,7 @@ void QDeclarativeGeoMap::setZoomLevel(qreal zoomLevel)
//small optiomatization to avoid double setCameraData
bool centerHasChanged = false;
- if (m_map) {
+ if (m_initialized) {
m_cameraData.setZoomLevel(qBound(minimumZoomLevel(), zoomLevel, maximumZoomLevel()));
m_maximumViewportLatitude = m_map->maximumLatitudeForZoom(m_cameraData.zoomLevel());
QGeoCoordinate coord = m_cameraData.center();
@@ -724,7 +724,7 @@ void QDeclarativeGeoMap::setCenter(const QGeoCoordinate &center)
if (!center.isValid())
return;
- if (m_map) {
+ if (m_initialized) {
QGeoCoordinate coord(center);
coord.setLatitude(qBound(-m_maximumViewportLatitude, center.latitude(), m_maximumViewportLatitude));
m_cameraData.setCenter(coord);