kontiki
kontiki

Reputation: 216

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, 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.

Upvotes: 0

Views: 489

Answers (1)

kontiki
kontiki

Reputation: 216

It seems this problem can be related to windows 7 64.

Bug raised here : https://bugreports.qt.io/browse/QTBUG-66107

Upvotes: 0

Related Questions