Commit c78af343 authored by Paolo Angelelli's avatar Paolo Angelelli
Browse files

Fix for wrong map center at startup in mapviewer example


This patches fixes an incorrect behavior (that is also a regression)
introduced as a side effect of the no gray bands patch in the map
viewer example

Task-number: QTBUG-55085
Change-Id: I2078ba72e1d1588357bb2002d0c8e38b2f59253c
Reviewed-by: default avatarAlex Blasche <alexander.blasche@qt.io>
Showing with 6 additions and 4 deletions
...@@ -377,7 +377,8 @@ Map { ...@@ -377,7 +377,8 @@ Map {
orientation : Qt.Vertical orientation : Qt.Vertical
value: map.zoomLevel value: map.zoomLevel
onValueChanged: { onValueChanged: {
map.zoomLevel = value if (value >= 0)
map.zoomLevel = value
} }
} }
......
...@@ -548,13 +548,14 @@ void QDeclarativeGeoMap::mappingManagerInitialized() ...@@ -548,13 +548,14 @@ void QDeclarativeGeoMap::mappingManagerInitialized()
//The zoom level limits are only restricted by the plugins values, if the user has set a more //The zoom level limits are only restricted by the plugins values, if the user has set a more
//strict zoom level limit before initialization nothing is done here. //strict zoom level limit before initialization nothing is done here.
//minimum zoom level might be changed to limit gray bundaries //minimum zoom level might be changed to limit gray bundaries
if (m_mappingManager->cameraCapabilities().minimumZoomLevel() > m_gestureArea->minimumZoomLevel())
setMinimumZoomLevel(m_mappingManager->cameraCapabilities().minimumZoomLevel());
if (m_gestureArea->maximumZoomLevel() < 0 if (m_gestureArea->maximumZoomLevel() < 0
|| m_mappingManager->cameraCapabilities().maximumZoomLevel() < m_gestureArea->maximumZoomLevel()) || m_mappingManager->cameraCapabilities().maximumZoomLevel() < m_gestureArea->maximumZoomLevel())
setMaximumZoomLevel(m_mappingManager->cameraCapabilities().maximumZoomLevel()); setMaximumZoomLevel(m_mappingManager->cameraCapabilities().maximumZoomLevel());
if (m_mappingManager->cameraCapabilities().minimumZoomLevel() > m_gestureArea->minimumZoomLevel())
setMinimumZoomLevel(m_mappingManager->cameraCapabilities().minimumZoomLevel());
// Map tiles are built in this call. m_map->minimumZoom() becomes operational // Map tiles are built in this call. m_map->minimumZoom() becomes operational
// after this has been called at least once, after creation. // after this has been called at least once, after creation.
......
...@@ -242,7 +242,7 @@ private: ...@@ -242,7 +242,7 @@ private:
bool m_enabled; bool m_enabled;
struct Zoom struct Zoom
{ {
Zoom() : m_minimum(-1.0), m_maximum(-1.0), m_start(0.0), m_previous(0.0), Zoom() : m_minimum(-1.0), m_maximum(20.0), m_start(0.0), m_previous(0.0),
maximumChange(4.0) {} maximumChange(4.0) {}
qreal m_minimum; qreal m_minimum;
qreal m_maximum; qreal m_maximum;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment