From b6294cfca675bd5aa9a34e15c93692a0f1b8fdb2 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Tue, 8 Aug 2017 18:06:40 +0200 Subject: 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 --- src/location/declarativemaps/qdeclarativegeomap.cpp | 4 ++-- 1 file 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(minimumZoomLevel(), zoomLevel() - zoomRatio); - setZoomLevel(newZoom); + setProperty("zoomLevel", QVariant::fromValue(newZoom)); // not using setZoomLevel(newZoom) to honor a possible animation set on the zoomLevel property } -- cgit v1.2.1