summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-08-08 18:06:40 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-08-09 12:08:23 +0000
commitb6294cfca675bd5aa9a34e15c93692a0f1b8fdb2 (patch)
treeb6f7ad46857c66f081a3e18527aaa962c0b5afb8
parent016d3992e81fc351c13f9e747fa5798dc176e6c2 (diff)
downloadqtlocation-b6294cfca675bd5aa9a34e15c93692a0f1b8fdb2.tar.gz
Restore usage of setProperty on Map.fitViewportToGeoShape
setProperty was initially introduced with 2867f1efc989478667ea7ae56ff91cd991d74121 to animate center and zoom level, if an animation was present, but then removed. This change restores it. Change-Id: Id1f6da820b6cccb62b18eeb78d7dba21ebc073bc Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp
index bd9c9cf2..90ae2b34 100644
--- a/src/location/declarativemaps/qdeclarativegeomap.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomap.cpp
@@ -1423,7 +1423,7 @@ void QDeclarativeGeoMap::fitViewportToGeoShape()
QGeoCoordinate centerCoordinate = m_map->geoProjection().mapProjectionToGeo(center);
// position camera to the center of bounding box
- setCenter(centerCoordinate);
+ setProperty("center", QVariant::fromValue(centerCoordinate)); // not using setCenter(centerCoordinate) to honor a possible animation set on the center property
// if the shape is empty we just change center position, not zoom
double bboxWidth = (bottomRightPoint.x() - topLeftPoint.x()) * m_map->mapWidth();
@@ -1436,7 +1436,7 @@ void QDeclarativeGeoMap::fitViewportToGeoShape()
bboxHeight / (height() - margins));
zoomRatio = std::log(zoomRatio) / std::log(2.0);
double newZoom = qMax<double>(minimumZoomLevel(), zoomLevel() - zoomRatio);
- setZoomLevel(newZoom);
+ setProperty("zoomLevel", QVariant::fromValue(newZoom)); // not using setZoomLevel(newZoom) to honor a possible animation set on the zoomLevel property
}