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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • 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.

    Description

      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

       

       

      Attachments

        1. image-2017-09-08-13-13-42-266.png
          image-2017-09-08-13-13-42-266.png
          285 kB
        2. main.qml
          0.8 kB
        3. main.qml
          0.7 kB
        4. qml-map-bug.mkv
          4.48 MB
        5. qt-fit-to-map-test-5.7.1.png
          qt-fit-to-map-test-5.7.1.png
          408 kB
        6. qt-fit-to-map-test-5.9.1.png
          qt-fit-to-map-test-5.9.1.png
          285 kB
        7. test.qml
          1 kB
        8. test2.qml
          2 kB
        9. video (3).mp4
          4.68 MB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes