Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Map Objects fade when zooming out

Map Objects fade when zooming out

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 521 Views 1 Watching
  • 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 Offline
    E Offline
    erikm
    wrote on last edited by erikm
    #1

    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
    0
    • E Offline
      E Offline
      erikm
      wrote on last edited by
      #2

      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. RoginaP 1 Reply Last reply
      0
      • E erikm

        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. RoginaP Offline
        Pablo J. RoginaP Offline
        Pablo J. Rogina
        wrote on last edited by
        #3

        @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
        0
        • Pablo J. RoginaP Pablo J. Rogina

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

          E Offline
          E Offline
          erikm
          wrote on last edited by
          #4

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

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved