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

    How to create marker on URL

    Scheduled Pinned Locked Moved Solved UI Glitches
    on mondayurlpickermarker
    19 Posts 5 Posters 12.2k Views 3 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.
    • rittelsR Online
      rittels Code contributor | Premium
      last edited by

      geohash type of system.

      Seems to be alphanumeric: starting bcd...z, A...Z, 0....8 (thus base 60), increments of 0.01 degree. Starting lat -90 and lon -180.

      there is an "a" between the lat and lon.

      G 1 Reply Last reply Reply Quote 0
      • G Offline
        GeGaX @rittels
        last edited by

        @rittels Ok thanks, I'm going to look on that side

        1 Reply Last reply Reply Quote 0
        • G Offline
          GeGaX @jmh2002
          last edited by

          @jmh2002 It is for a boat that sails so I have to create the "geohash" according to lat, lon

          rittelsR 1 Reply Last reply Reply Quote 0
          • rittelsR Online
            rittels Code contributor | Premium
            last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • rittelsR Online
              rittels Code contributor @GeGaX | Premium
              last edited by rittels

              @GeGaX

              JS function for you:

              function createCoordCode(coords){
                  let ar=[];
                  for (let i=98; i < 123; i++) ar.push(String.fromCharCode(i));
                  for (let i=65; i < 91; i++) ar.push(String.fromCharCode(i));
                  for (let i=0; i < 9; i++) ar.push(i);
              
                  let lat=Math.round(100*(coords.lat+90));
                  let lon=Math.round(100*(coords.lon+180));
              
                  lt1=Math.floor(lat/3600);
                  lt2=Math.floor((lat-lt1*3600)/60);
                  lt3=lat-lt1*3600-lt2*60;
              
                  ln1=Math.floor(lon/3600);
                  ln2=Math.floor((lon-ln1*3600)/60);
                  ln3=lon-ln1*3600-ln2*60;
              
                  return "m:"+ar[lt1]+ar[lt2]+ar[lt3]+"a"+ar[ln1]+ar[ln2]+ar[ln3];
              }
              
              console.log(createCoordCode({lat:-29,lon:100}));
              
              G 2 Replies Last reply Reply Quote 0
              • G Offline
                GeGaX @rittels
                last edited by

                @rittels Thanks, I test it and tell you πŸ˜‰

                1 Reply Last reply Reply Quote 0
                • G Offline
                  GeGaX @rittels
                  last edited by

                  @rittels
                  alt text
                  I have a shift of 7 second North and 11 second West between the real position and Windy position.
                  What should I correct in your code to obtain an identical position?
                  Thanks again for the code, it's cool πŸ˜‰

                  rittelsR 1 Reply Last reply Reply Quote 0
                  • rittelsR Online
                    rittels Code contributor @GeGaX | Premium
                    last edited by

                    @GeGaX

                    That happens, because the max resolution of the alphanum code is 0.01deg, thus 36 seconds (about 1km).

                    made code a bit shorter:

                    function createCoordCode(coords){
                        let ar=[];
                        for (let i=98;i < 123;i++)ar.push(String.fromCharCode(i));
                        for (let i=65;i < 91;i++)ar.push(String.fromCharCode(i));
                        for (let i=0;i < 9;i++)ar.push(i);
                    
                        let lat=Math.round(100*(coords.lat+90));
                        let lon=Math.round(100*(coords.lon+180));
                    
                        return "m:"
                                +ar[Math.floor(lat/3600)]
                                +ar[Math.floor((lat%3600)/60)]
                                +ar[lat%60]+"a"
                                +ar[Math.floor(lon/3600)]
                                +ar[Math.floor((lon%3600)/60)]
                                +ar[lon%60];
                    }
                    console.log(createCoordCode({lat:38,lon:-30}));
                    
                    G 1 Reply Last reply Reply Quote 1
                    • G Offline
                      GeGaX @rittels
                      last edited by

                      @rittels
                      ok understood, thanks for everything πŸ˜‰

                      G 1 Reply Last reply Reply Quote 0
                      • G Offline
                        GeGaX @GeGaX
                        last edited by GeGaX

                        @rittels
                        In place and functional, thanks πŸ˜‰

                        1 Reply Last reply Reply Quote 1
                        • T Offline
                          TomSlavkovsky API developers
                          last edited by

                          Hi, guys we will give the option to share the picker in URL. It will be possible very soon by adding d:picker` into the URL.

                          G 1 Reply Last reply Reply Quote 4
                          • G Offline
                            GeGaX @TomSlavkovsky
                            last edited by

                            @TomSlavkovsky
                            Hi TomSlavkovsky,
                            will you share the info here when it's possible?
                            Thanks πŸ˜‰

                            1 Reply Last reply Reply Quote 1
                            • T Offline
                              TomSlavkovsky API developers
                              last edited by

                              @GeGaX @rittels It's now possible to open Windy with picker.

                              Also recommend to check following topic: https://community.windy.com/topic/77/windy-com-url-parameters

                              G rittelsR 2 Replies Last reply Reply Quote 3
                              • G Offline
                                GeGaX @TomSlavkovsky
                                last edited by

                                @TomSlavkovsky
                                Thanks for this improvement, it works very well ;)
                                The GPS coordinates displayed, by the picker, are translated exactly as those sent despite the truncated display in the address bar, it's perfect !

                                @rittels
                                Thanks again for the JS code which has helped me well until here.
                                (And in addition I discovered the GeoHash system ;p)

                                1 Reply Last reply Reply Quote 0
                                • rittelsR Online
                                  rittels Code contributor @TomSlavkovsky | Premium
                                  last edited by

                                  @TomSlavkovsky

                                  Cool. Thanks!! Works well.

                                  Can we mount plugins yet? I see we can open an airport from path.

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