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

MapQuickItem's fade in points should be documentated, and preferably settable from application code

    XMLWordPrintable

Details

    • All
    • 3d2aac6ec0661e24acb166b4763b313d68993815 (qt/qtlocation/dev)

    Description

      Qt Location's src/location/declarativemaps/qdeclarativegeomapitembase.cpp contains a pair of constants, opacityRampMin and opacityRampMax.

      These are used to determine opacity for MapQuickItem instances via QDeclarativeGeoMapItemBase::zoomLevelOpacity():

          if (quickMap_->zoomLevel() > opacityRampMax)
              return 1.0;
          else if (quickMap_->zoomLevel() > opacityRampMin)
              return quickMap_->zoomLevel() - opacityRampMin;
          else
              return 0.0;
      

      This behavior should be documented, and preferably controllable from an application.

       

      Demo QML:

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtLocation 5.9
      import QtPositioning 5.8
      
      Window {
          visible: true
          width: 640
          height: 480
      
          Map {
              id: map
              anchors.fill: parent
              center: QtPositioning.coordinate(51.48, 0)
              zoomLevel: 5
      
              plugin: Plugin {
                  id: mapPlugin
                  name: "osm"
              }
      
              MapQuickItem {
                  coordinate {
                      latitude: 51.48
                      longitude: 0
                  }
                  sourceItem: Rectangle {
                      color: "red"
                      width: 50
                      height: 50
                  }
              }
          }
      
          Rectangle {
              width: 50
              height: 20
              Text {
                  anchors.centerIn: parent
                  text: map.zoomLevel.toFixed(1)
              }
          }
      }
      

      Attachments

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

        Activity

          People

            paangele Paolo Angelelli
            jkatz_at_volexity Jeremy Katz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes