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

Map.fromCoordinate sometimes returns wrong values during tilting

    XMLWordPrintable

    Details

      Description

      Steps to reproduce:

      1. Make sure that the target coordinate is outside of the visible map region.
      2. Tilt the map (I tested it with the mouse scroll wheel). At some tilt positions/angles "fromCoordinate" returns wrong values.

       

      ApplicationWindow {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          Map {
              id: map
              anchors.fill: parent
      
              onTiltChanged: {
                  var c = QtPositioning.coordinate(45.6, 17.67);
                  var p = map.fromCoordinate(c, false);
                  var r = map.toCoordinate(p, false);
                  if (c !== r)
                      console.log("tilt: " + tilt + " pos: " + c + " fromCoordinate: " + p + ", toCoordinate " + r)
              }
      
              plugin: Plugin {
                  name: "osm"
              }
         }
      }

      Output:

      qml: tilt: 6 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(5086.4, 2600.74), toCoordinate 45° 36' 0.0" N, 17° 40' 12.0" E, 0m
       qml: tilt: 12 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(9245.19, 4604.6), toCoordinate 45° 36' 0.0" N, 17° 40' 12.0" E, 0m
       qml: tilt: 18 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(61159.3, 29280.2), toCoordinate 45° 36' 0.0" N, 17° 40' 12.0" E, 0m
       qml: tilt: 24 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-12843.5, -5819.64), toCoordinate 52° 30' 20.5" N, 88° 47' 16.4" W, 0m
       qml: tilt: 30 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-5771.71, -2429.58), toCoordinate 52° 38' 4.5" N, 44° 6' 29.6" W, 0m
       qml: tilt: 36 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-3725.84, -1423.89), toCoordinate 52° 49' 4.7" N, 31° 55' 11.1" W, 0m
       qml: tilt: 42 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-2765.58, -931.643), toCoordinate 53° 5' 34.9" N, 27° 9' 31.7" W, 0m
       qml: tilt: 48 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-2217.58, -632.783), toCoordinate 53° 32' 30.7" N, 25° 56' 33.9" W, 0m
       qml: tilt: 54 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-1871.23, -426.865), toCoordinate 54° 23' 15.9" N, 28° 7' 39.8" W, 0m
       qml: tilt: 60 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-1639.74, -272.125), toCoordinate 56° 31' 31.6" N, 38° 13' 34.3" W, 0m
       qml: tilt: 66 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-1481.13, -147.93), toCoordinate 71° 10' 0.5" N, 142° 9' 23.4" W, 0m
       qml: tilt: 72 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-1372.97, -42.7477), toCoordinate 90° 0' 0.0" N, 63° 16' 59.5" W, 0m
       qml: tilt: 78 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-1302.6, 50.5673), toCoordinate 90° 0' 0.0" N, 52° 57' 26.5" E, 0m
       qml: tilt: 72 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-1372.97, -42.7477), toCoordinate 90° 0' 0.0" N, 63° 16' 59.5" W, 0m
       qml: tilt: 66 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-1481.13, -147.93), toCoordinate 71° 10' 0.5" N, 142° 9' 23.4" W, 0m
       qml: tilt: 60 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-1639.74, -272.125), toCoordinate 56° 31' 31.6" N, 38° 13' 34.3" W, 0m
       qml: tilt: 54 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-1871.23, -426.865), toCoordinate 54° 23' 15.9" N, 28° 7' 39.8" W, 0m
       qml: tilt: 48 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-2217.58, -632.783), toCoordinate 53° 32' 30.7" N, 25° 56' 33.9" W, 0m
       qml: tilt: 42 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-2765.58, -931.643), toCoordinate 53° 5' 34.9" N, 27° 9' 31.7" W, 0m
       qml: tilt: 36 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-3725.84, -1423.89), toCoordinate 52° 49' 4.7" N, 31° 55' 11.1" W, 0m
       qml: tilt: 30 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-5771.71, -2429.58), toCoordinate 52° 38' 4.5" N, 44° 6' 29.6" W, 0m
       qml: tilt: 24 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(-12843.5, -5819.64), toCoordinate 52° 30' 20.5" N, 88° 47' 16.4" W, 0m
       qml: tilt: 18 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(61159.3, 29280.2), toCoordinate 45° 36' 0.0" N, 17° 40' 12.0" E, 0m
       qml: tilt: 12 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(9245.19, 4604.6), toCoordinate 45° 36' 0.0" N, 17° 40' 12.0" E, 0m
       qml: tilt: 6 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(5086.4, 2600.74), toCoordinate 45° 36' 0.0" N, 17° 40' 12.0" E, 0m
       qml: tilt: 0 pos: 45° 36' 0.0" N, 17° 40' 12.0" E fromCoordinate: QPointF(3559.97, 1847.23), toCoordinate 45° 36' 0.0" N, 17° 40' 12.0" E, 0m

        Attachments

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

          Activity

            People

            • Assignee:
              paangele Paolo Angelelli
              Reporter:
              DanielSt Peter Staab
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes