summaryrefslogtreecommitdiff
path: root/src/location/maps/qgeomap.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-02-01 10:45:24 +0100
committerPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-03-02 14:41:22 +0000
commit820f79284248e5fcc9910282055e67f07c918559 (patch)
tree8bdfb0b283f463b13453c04c5a28f6734cf568f5 /src/location/maps/qgeomap.cpp
parent3a079a1e6761f3a26223e360d22530f22b5aeade (diff)
downloadqtlocation-820f79284248e5fcc9910282055e67f07c918559.tar.gz
Adjustment for the minimum zoom level to prevent gray bands
This patch introduces a lower bound for the minimum zoom level of a map element so that it becomes canvas size dependent, and it will also prevent the map from being smaller than the canvas size in either dimension, avoiding gray bands. It also bounds the center of the map so that the map cannot be panned or flicked out of bounds. The documentation for QDeclarativeGeoMap::minimumZoomLevel has been modified to reflect the new behavior. A few testcases have been modified to reflect this new behavior and its implications. Change-Id: I3c8160d0295e8dda2f7001e8fec68a5200ea2172 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
Diffstat (limited to 'src/location/maps/qgeomap.cpp')
-rw-r--r--src/location/maps/qgeomap.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/location/maps/qgeomap.cpp b/src/location/maps/qgeomap.cpp
index 37bf139a..4cc2bbfe 100644
--- a/src/location/maps/qgeomap.cpp
+++ b/src/location/maps/qgeomap.cpp
@@ -119,7 +119,13 @@ const QGeoMapType QGeoMap::activeMapType() const
return d->m_activeMapType;
}
-QGeoCameraCapabilities QGeoMap::cameraCapabilities()
+double QGeoMap::minimumZoom() const
+{
+ Q_D(const QGeoMap);
+ return d->m_minimumZoom;
+}
+
+QGeoCameraCapabilities QGeoMap::cameraCapabilities() const
{
Q_D(const QGeoMap);
if (!d->m_engine.isNull())
@@ -143,6 +149,7 @@ QGeoMapPrivate::QGeoMapPrivate(QGeoMappingManagerEngine *engine)
m_width(0),
m_height(0),
m_aspectRatio(0.0),
+ m_minimumZoom(0.0),
m_engine(engine),
m_controller(0),
m_activeMapType(QGeoMapType())