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

Map with Mapboxgl and transparent layers not transparent in quick scene

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.4
    • 5.9.2, 5.10.0 Beta 2
    • None
    • KDE Neon

    Description

      I'm trying to use a Map item as an overlay on top of other qt quick items, by setting most mapbox layers' fill colors transparent, including the "background" layer.

      However the map is not fully transparent - the background color is rendered as opaque black instead. I'm not sure if it's technically possible, but if it is, it would be very useful to have the transparency of the map work together with the rest of the qt quick scene.

      I've tried using the "use_fbo"-setting but it has no effect on this. The "color" property of the map item also has no effect as far as I can tell (tried setting it "transparent"). 

      In this example, the "BACKGROUND" text was supposed to be visible where the water layer is transparent:

       

      import QtQuick 2.8
      import QtQuick.Window 2.2
      import QtPositioning 5.8
      import QtLocation 5.9
      
      Window {
          visible: true
          width: 640
          height: 480
      
          Text {
              anchors.centerIn: parent
              text: "BACKGROUND"
              font.pixelSize: 80
          }
      
          Map {
              id: theMap
              anchors.fill: parent
              plugin: Plugin {
                  name: "mapboxgl"
                  PluginParameter { name: "mapboxgl.mapping.use_fbo"; value: true  } // no effect
              }
              center: QtPositioning.coordinate(58.5,10.5);
              color: "transparent"
      
              MapParameter {
                  type: "paint"
                  property var layer: "background"
                  property var backgroundOpacity: 0.0
                  property var backgroundColor: "#00ff0000"
              }
      
              MapParameter {
                  type: "paint"
                  property var layer: "water"
                  property var fillOpacity: 0.0
              }
      
              MapParameter {
                  type: "paint"
                  property var layer: "water-shadow"
                  property var fillOpacity: 0.0
              }
          }
      }
      
      
      

       

       

       

      Attachments

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

        Activity

          People

            brunoabinader Bruno de Oliveira Abinader
            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