Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Map qml : minimumZoomLevel does not block the zoomlevel at low value

Map qml : minimumZoomLevel does not block the zoomlevel at low value

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlmapzoomlevel
9 Posts 2 Posters 2.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kontiki
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Looks like a bug, please report it.

      (Z(:^

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Kontiki
        wrote on last edited by
        #3

        Do you confirm the same behavior ?

        sierdzioS 1 Reply Last reply
        0
        • K Kontiki

          Do you confirm the same behavior ?

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          @Kontiki said in Map qml : minimumZoomLevel does not block the zoomlevel at low value:

          Do you confirm the same behavior ?

          I haven't tried ;-)

          (Z(:^

          1 Reply Last reply
          0
          • K Offline
            K Offline
            Kontiki
            wrote on last edited by
            #5

            Can you just try it ? And Confirm or not ?
            It would be better to get a double check before I raise a Bug.

            sierdzioS 1 Reply Last reply
            0
            • K Kontiki

              Can you just try it ? And Confirm or not ?
              It would be better to get a double check before I raise a Bug.

              sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

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

              (Z(:^

              1 Reply Last reply
              0
              • K Offline
                K Offline
                Kontiki
                wrote on last edited by
                #7

                Thanks for the try.
                I am on Windows 7x64 and it does not work correctly... I'm gonna check the behavior on another computer.
                No idea where the difference comes from.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  Kontiki
                  wrote on last edited by
                  #8

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

                  1 Reply Last reply
                  1
                  • sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on last edited by
                    #9

                    Thanks, I've upvoted it.

                    (Z(:^

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved