summaryrefslogtreecommitdiff
path: root/src/imports/location/qdeclarativegeomap.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2016-12-05 12:43:52 +0100
committerAlex Blasche <alexander.blasche@qt.io>2016-12-05 12:43:52 +0100
commit335116ea024f51e1693bba39f78e15131870f1b0 (patch)
tree148ccdb4703b4a35afb1b0e3875573b1eb90d0ce /src/imports/location/qdeclarativegeomap.cpp
parent5e4bc1fe908896e9b90e8ad9c3896f35b5ec37be (diff)
parentba9b7b9ef674d93680070f6c4bb1053d0d2325dd (diff)
downloadqtlocation-335116ea024f51e1693bba39f78e15131870f1b0.tar.gz
Merge remote-tracking branch 'gerrit/5.8' into dev
Conflicts: src/imports/location/qdeclarativegeomap.cpp src/location/maps/maps.pri src/location/maps/qgeomap_p_p.h src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp src/plugins/geoservices/osm/qgeoroutereplyosm.cpp Change-Id: I18d31cff9233648178fe3e2636ce294026dfaeb7
Diffstat (limited to 'src/imports/location/qdeclarativegeomap.cpp')
-rw-r--r--src/imports/location/qdeclarativegeomap.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp
index 49d6ddd1..d432e776 100644
--- a/src/imports/location/qdeclarativegeomap.cpp
+++ b/src/imports/location/qdeclarativegeomap.cpp
@@ -306,7 +306,7 @@ void QDeclarativeGeoMap::initialize()
// try to keep center change signal in the end
bool centerHasChanged = false;
- setMinimumZoomLevel(m_map->minimumZoomAtMapSize(width(), height()));
+ setMinimumZoomLevel(m_map->minimumZoomAtViewportSize(width(), height()));
// set latitude bundary check
m_maximumViewportLatitude = m_map->maximumCenterLatitudeAtZoom(m_cameraData.zoomLevel());
@@ -573,7 +573,7 @@ void QDeclarativeGeoMap::mappingManagerInitialized()
// after this has been called at least once, after creation.
if (!m_initialized && width() > 0 && height() > 0) {
- m_map->setSize(QSize(width(), height()));
+ m_map->setViewportSize(QSize(width(), height()));
initialize();
}
@@ -634,7 +634,7 @@ void QDeclarativeGeoMap::setMinimumZoomLevel(qreal minimumZoomLevel)
if (m_map) {
minimumZoomLevel = qBound(qreal(m_map->cameraCapabilities().minimumZoomLevel()), minimumZoomLevel, maximumZoomLevel());
- double minimumViewportZoomLevel = m_map->minimumZoomAtMapSize(width(),height());
+ double minimumViewportZoomLevel = m_map->minimumZoomAtViewportSize(width(),height());
if (minimumZoomLevel < minimumViewportZoomLevel)
minimumZoomLevel = minimumViewportZoomLevel;
}
@@ -907,6 +907,9 @@ void QDeclarativeGeoMap::fitViewportToGeoShape()
QGeoRectangle rect = m_region;
topLeft = rect.topLeft();
bottomRight = rect.bottomRight();
+ if (bottomRight.longitude() < topLeft.longitude())
+ bottomRight.setLongitude(bottomRight.longitude() + 360.0);
+
break;
}
case QGeoShape::CircleType:
@@ -1054,8 +1057,8 @@ void QDeclarativeGeoMap::pan(int dx, int dy)
if (dx == 0 && dy == 0)
return;
QGeoCoordinate coord = m_map->itemPositionToCoordinate(
- QDoubleVector2D(m_map->width() / 2 + dx,
- m_map->height() / 2 + dy));
+ QDoubleVector2D(m_map->viewportWidth() / 2 + dx,
+ m_map->viewportHeight() / 2 + dy));
setCenter(coord);
}
@@ -1415,12 +1418,12 @@ void QDeclarativeGeoMap::geometryChanged(const QRectF &newGeometry, const QRectF
if (!m_map || !newGeometry.size().isValid())
return;
- m_map->setSize(newGeometry.size().toSize());
+ m_map->setViewportSize(newGeometry.size().toSize());
if (!m_initialized) {
initialize();
} else {
- setMinimumZoomLevel(m_map->minimumZoomAtMapSize(newGeometry.width(), newGeometry.height()));
+ setMinimumZoomLevel(m_map->minimumZoomAtViewportSize(newGeometry.width(), newGeometry.height()));
// Update the center latitudinal threshold
double maximumCenterLatitudeAtZoom = m_map->maximumCenterLatitudeAtZoom(m_cameraData.zoomLevel());