Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-63093

[Regression] fitViewportToMapItems() fails to scale and position map correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.9.5, 5.10.1
    • 5.9.0, 5.9.1
    • None
    • Qt 5.9.0 and Qt 5.9.1 (installed using the Qt installer) on Ubuntu 17.04 running on amd64.

      Using the following QML the fitViewportToMapItems() method fails to correctly scale the map to show only the present map items. Testing with Qt 5.7.1 shows that this functionality used to work correctly, so this appears to be a regression.

      Test code:

      main.qml

       

      Expected result (from Qt 5.7.1):

       

      Actual result (in Qt 5.9.0 and Qt 5.9.1):

       

      The map actually starts at zoomLevel 10, so the fitViewportToMapItems() method is actively zooming out to an incorrect level (rather than just having no effect at all).

      I tested with both MapPolylines and MapQuickItems both giving the same results.

      Adding a MouseArea and calling fitViewportToMapItems() when clicked results in very inconsistent behaviour, with it sometimes fitting correctly to the path, sometimes zooming all the way out as seen when called on component completion and sometimes only displaying part of the path.

       

      Thanks!

      Mike

       

       

        1. main.qml
          0.7 kB
          Michael Sheldon
        2. qt-fit-to-map-test-5.7.1.png
          408 kB
          Michael Sheldon
        3. qt-fit-to-map-test-5.9.1.png
          285 kB
          Michael Sheldon
        4. image-2017-09-08-13-13-42-266.png
          285 kB
          Michael Sheldon
        5. main.qml
          0.8 kB
          Michael Sheldon
        6. qml-map-bug.mkv
          4.48 MB
          Michael Sheldon
        7. video (3).mp4
          4.68 MB
          Paolo Angelelli
        8. test.qml
          1 kB
          Vlad Seryakov
        9. test2.qml
          2 kB
          Vlad Seryakov
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            paangele Paolo Angelelli
            elleo Michael Sheldon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes