Windy Community
    • Unread
    • Categories
    • Groups
    • Go to windy.com
    • Register
    • Login

    Bug when setting fractional zoom (zoomSnap)

    Scheduled Pinned Locked Moved Windy API v4
    2 Posts 1 Posters 850 Views 1 Watching
    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.
    • A Offline
      asjustis
      last edited by

      Hi guys,

      Just ran into an issue while trying to set a fractional zoom value on Windy map.

      Leaflet by default snaps zoom levels to an integer value, and their documentation says a solution for that is to set zoomSnap value to other than 1 (i.e. 0.1 means we can use 8.1, 8.2, 8.3, and so on). Well, that works for zooming.

      However, while in these fractional zoom values, Windy labels are just gone. They are only visible only when zoom value is equal to an integer.

      windyInit(config.windyOptions, windyAPI => {
      
          const { map, colors, broadcast, store, picker, utils } = windyAPI;
      
          map.options.zoomSnap = 0.1;
          map.setZoom(8.4)
      }
      
      A 1 Reply Last reply Reply Quote 0
      • A Offline
        asjustis @asjustis
        last edited by

        @asjustis Additionally, I found that at least for labels, the issue is calculating the transform position for the label div. As in the screenshot, tile seems to perfectly positioned, and just the label position is somewhere far far away in the galaxy :))

        Any chance for a fix or a workaround?

        We were about to grab the pro license and launch our project, but bumped into this issue which is quite critical for us.

        Thanks,
        Justinas!

        Screenshot 2022-06-07 at 09.48.51.png

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Windy Community  |  Powered by excellent NodeBB
        Terms of Use     Privacy Policy     Windy.com