Please nominate your Qt Champions for 2021!

Map Objects fade when zooming out

  • 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.


  • 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;
    float QDeclarativeGeoMapItemBase::zoomLevelOpacity() const
        if (quickMap_->zoomLevel() > opacityRampMax)
            return 1.0;
        else if (quickMap_->zoomLevel() > opacityRampMin)
            return quickMap_->zoomLevel() - opacityRampMin;
            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 ???

  • @erikm

    Any idea for a workaround in 5.12 or 5.13 ???

    What if you apply the patch that fix the issue and rebuild 5.12 or 5.13 yourself?

  • @Pablo-J-Rogina
    I had hoped there would be a simpler solutuion.

    Since I am not the only one working at this project.
    This would add a whole other dimension of dependencies - custom build Qt-Versions ...

    Thanks anyway

Log in to reply