Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.12.4
-
None
-
-
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) } } }