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

    Leaflet config not working (worldCopyJump)

    Scheduled Pinned Locked Moved Windy API v4
    6 Posts 2 Posters 1.9k 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.
    • B Offline
      BSS_LH
      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)
      0_1580776715113_leaflet.gif

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

      1 Reply Last reply Reply Quote 0
      • B Offline
        BSS_LH
        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
        • marekdM Offline
          marekd Windy Staff
          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 Offline
            BSS_LH @marekd
            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
            • marekdM Offline
              marekd Windy Staff
              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 Offline
                BSS_LH
                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
                Windy Community  |  Powered by excellent NodeBB
                Terms of Use     Privacy Policy     Windy.com