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

MapPolygon with 2 points not drawn if using mapboxgl plugin

    XMLWordPrintable

Details

    Description

      The following code draws a polygon with 2 points. The resulting line is visible with the osm plugin, but not with the mapboxgl plugin.

       

       

      import QtQuick 2.8
      import QtQuick.Window 2.2
      import QtPositioning 5.8
      import QtLocation 5.9
      
      Window {
          visible: true
          width: 640
          height: 480
      
          Map {
              id: theMap
      
              anchors.fill: parent
              plugin: Plugin {
      //            name: "osm"
                  name: "mapboxgl"
      //            PluginParameter { name: "mapboxgl.mapping.use_fbo";             value: "false"  }
      //            PluginParameter { name: "mapboxgl.mapping.items.insert_before"; value: "false"  }
              }
              center: QtPositioning.coordinate(60,10);
      
              Timer {
                  property double counter: 0
      
                  interval: 16
                  repeat: true
                  running: true
                  triggeredOnStart: true
                  onTriggered: {
                      counter = counter + 0.01;
                      var path = thePolygon.path;
                      path[1] = QtPositioning.coordinate(60.0+Math.sin(counter), 10.0+Math.cos(counter));
                      thePolygon.path = path
                      theMap.center = path[1];
                  }
              }
      
              MapPolygon {
                  id: thePolygon
                  path: [
                      { latitude: 60,   longitude: 10 },
                      { latitude: 60.5, longitude: 10 },
                  ]
                  color: "#11223344"
                  border.color: "blue"
                  border.width: 2
              }
          }
      }
      
      

      Attachments

        For Gerrit Dashboard: QTBUG-63929
        # Subject Branch Project Status CR V

        Activity

          People

            paangele Paolo Angelelli
            pyrrhula Ola Røer Thorsen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes