Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Map Objects fade when zooming out

    QML and Qt Quick
    2
    4
    165
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      erikm last edited by erikm

      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

      1 Reply Last reply Reply Quote 0
      • E
        erikm last edited by

        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 ???

        Pablo J. Rogina 1 Reply Last reply Reply Quote 0
        • Pablo J. Rogina
          Pablo J. Rogina @erikm last edited by

          @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?

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          E 1 Reply Last reply Reply Quote 0
          • E
            erikm @Pablo J. Rogina last edited by

            @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

            1 Reply Last reply Reply Quote 0
            • First post
              Last post