Navigation

    Windy Community

    • Register
    • Login
    • Search
    • Unread
    • Categories
    • Groups
    • Go to windy.com

    Leaflet config not working (worldCopyJump)

    Windy API v4
    2
    6
    160
    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.
    • B
      BSS_LH | Premium last edited by

      Hi, we are creating our system, incorporating your Windy API, Leaflet, and our internal position info.
      We are having difficulties only during Windy mode (when windy API info is displayed)
      It seems that the Zoom/Bounds options are working correctly, but the worldCopyJump is not working correctly,
      and causing the icons to jump to the other side of the map.

      Please advise us if there is a way to incorporate the worldCopyJump properly.

      Image 1: target code/option
      log.png

      Image 2: Leaflet situation (when the center crosses the international day line, icons still appear)

      Image 3: Windy situation (when the center crosses the international day line, icons disappear)

      1 Reply Last reply Reply Quote 0
      • B
        BSS_LH | Premium last edited by

        sorry, seems the other 2 GIF images are too big.
        I have sent the files to Simona Poláčková for reference.

        1 Reply Last reply Reply Quote 0
        • marekd
          marekd Administrator last edited by

          @BSS_LH We use worldCopyJump: true at Windy website. Are you sure this property is not overwritten by our setting?

          B 1 Reply Last reply Reply Quote 0
          • B
            BSS_LH @marekd | Premium last edited by

            @marekd
            We want to use "worldCopyJump: false" in our system, but it seems that it is being overwritten to "true" somehow.
            We were confirming the API specifications and other user manuals of Windy, and it has not stated about the "worldCopyJump" or any other features which are being restricted through API.

            Thus, we want to confirm why this is happening.

            1 Reply Last reply Reply Quote 0
            • marekd
              marekd Administrator last edited by marekd

              @BSS_LH According to this Stackoverflow question (https://stackoverflow.com/questions/51947327/how-to-change-worldcopyjump-value-dynamically-in-leaflet) you can change the value dynamically. Just put it into windyInit function:

              windyInit(options, ({ map }) => {
                  map.dragging.disable();
                  delete map.dragging._draggable;
                  map.options.worldCopyJump = false;
                  map.dragging.enable();
              
                  // your current code
              })
              

              It is kind of hack, but at this moment probably the only option.

              1 Reply Last reply Reply Quote 0
              • B
                BSS_LH | Premium last edited by

                Dear @marekd

                We have tested and seems the hack you have shared us, has worked as expected.
                Thank you for your support!

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post
                Windyty, S.E. - all rights reserved. Powered by excellent NodeBB
                NodeBB & contributors, OSM & contributors, HERE maps
                Terms and Conditions     Privacy Policy