Map qml : minimumZoomLevel does not block the zoomlevel at low value
-
When setting a minimumZoomlevel to a QML map, the lower threshold is exceeded.
Here is a simple code based on the minimal map exemple :
Main.cpp
#include <QGuiApplication> #include <QQmlApplicationEngine> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec(); }
and main.qml
import QtQuick 2.0 import QtQuick.Window 2.0 import QtLocation 5.6 import QtPositioning 5.6 Window { width: 1440 height: 900 visible: true Map { anchors.fill: parent plugin: Plugin {name: "osm"} center: QtPositioning.coordinate(59.91, 10.75) // Oslo zoomLevel: 10 minimumZoomLevel: 6 //This does not block the zoomLevel onZoomLevelChanged: { console.log("minimumZoomLevel : " + minimumZoomLevel + " - current zoomLevel :" + zoomLevel) } } }
The result is here :
qml: minimumZoomLevel : 2.4918530963296748 - current zoomLevel :2.4918530963296748 qml: minimumZoomLevel : 2.4918530963296748 - current zoomLevel :19
So, despite having specified a minimum zoom value of 6, it is overridden and the zoom range goes from 19 to 2.49, instead of 19 to 6.
What is the matter ? Is this a Qt bug or did I misunderstand the way it works ?
Thanks for help.
-
Looks like a bug, please report it.
-
@Kontiki said in Map qml : minimumZoomLevel does not block the zoomlevel at low value:
Do you confirm the same behavior ?
I haven't tried ;-)
-
@Kontiki said in Map qml : minimumZoomLevel does not block the zoomlevel at low value:
Can you just try it ? And Confirm or not ?
It would be better to get a double check before I raise a Bug.Hm, looks like it works fine on my end (Linux 64 bit, Qt 5.10.0):
qml: minimumZoomLevel : 6 - current zoomLevel :6.280000000000002 qml: minimumZoomLevel : 6 - current zoomLevel :6.160000000000002 qml: minimumZoomLevel : 6 - current zoomLevel :6.040000000000002 qml: minimumZoomLevel : 6 - current zoomLevel :6 qml: minimumZoomLevel : 6 - current zoomLevel :6
I zoom out and it stops at level 6. Then when I zoom back in and out it still upholds the limit.
-
Bug raised here : https://bugreports.qt.io/browse/QTBUG-66107
-
Thanks, I've upvoted it.