Map Objects fade when zooming out
Unsolved
QML and Qt Quick
-
Hi,
is there a way to prevent the fading of mapobjects when zooming out of the map?I am using the "osm" Plugin.
They start fading at a zoom level < 2.5 and are completely gone at zoom level of 1
This happens to all objects i have put on the map so far (MapCircle, MapQuickItem, MapRectangle, ...)
I could not find the cause for this behaviour, nor any documentation about it.
Thanks
Erik -
Ok, I found it.
\qmlproperty bool QtLocation::MapQuickItem::autoFadeIn This property holds whether the item automatically fades in when zooming into the map starting from very low zoom levels. By default this is \c true. Setting this property to \c false causes the map item to always have the opacity specified with the \l QtQuick::Item::opacity property, which is 1.0 by default. \since 5.14
The problem is, prior to 5.14 it is hard coded:
static const double opacityRampMin = 1.5; static const double opacityRampMax = 2.5; /*! \internal */ float QDeclarativeGeoMapItemBase::zoomLevelOpacity() const { if (quickMap_->zoomLevel() > opacityRampMax) return 1.0; else if (quickMap_->zoomLevel() > opacityRampMin) return quickMap_->zoomLevel() - opacityRampMin; else return 0.0; }
Oh, I see, there was even a bug report for it: QTBUG-76867
Any idea for a workaround in 5.12 or 5.13 ???
-
Ok, I found it.
\qmlproperty bool QtLocation::MapQuickItem::autoFadeIn This property holds whether the item automatically fades in when zooming into the map starting from very low zoom levels. By default this is \c true. Setting this property to \c false causes the map item to always have the opacity specified with the \l QtQuick::Item::opacity property, which is 1.0 by default. \since 5.14
The problem is, prior to 5.14 it is hard coded:
static const double opacityRampMin = 1.5; static const double opacityRampMax = 2.5; /*! \internal */ float QDeclarativeGeoMapItemBase::zoomLevelOpacity() const { if (quickMap_->zoomLevel() > opacityRampMax) return 1.0; else if (quickMap_->zoomLevel() > opacityRampMin) return quickMap_->zoomLevel() - opacityRampMin; else return 0.0; }
Oh, I see, there was even a bug report for it: QTBUG-76867
Any idea for a workaround in 5.12 or 5.13 ???
-