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

    Improved paragliding sites plugin

    Windy Plugins
    5
    18
    6.0k
    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.
    • ivoI
      ivo Administrator
      last edited by

      Downloading backend data is not yet develop, but I add example how to Interpolate wind data from a map, so you can get flyability from a lot of point on a map

      1 Reply Last reply Reply Quote 0
      • ivoI
        ivo Administrator
        last edited by

        https://github.com/windycom/windy-plugins/tree/master/examples/09-reading-weather-values

        1 Reply Last reply Reply Quote 0
        • OkocedionO
          Okocedion
          last edited by

          Thanks a lot @ivo, I should now be able to get a first version running, I'll work on it and publish a first version asap :)

          1 Reply Last reply Reply Quote 0
          • T
            TomSlavkovsky API developers | Premium
            last edited by

            @Okocedion How everything goes?

            OkocedionO 1 Reply Last reply Reply Quote 0
            • OkocedionO
              Okocedion @TomSlavkovsky
              last edited by

              @tomslavkovsky I've had other priorities lately, but will start working on it again soon.

              I also had to develop a proxy API for paragliding earth data, because they serve it over http when I can only use it in https in my plugin. Repo for this API is here: https://github.com/xVinCe/pg-api

              So next thing I need to do is get a cheap server to host my API on (with https), and then get back to where I was on the plugin!

              jakubvranaJ 1 Reply Last reply Reply Quote 0
              • OkocedionO
                Okocedion
                last edited by

                Hello,

                A first preview version of my plugin is now published on NPM under the name windy-plugin-pg : https://www.npmjs.com/package/windy-plugin-pg

                Github with an up-to-date readme: https://github.com/xVinCe/windy-plugin-pg

                It only works at zoom levels > 8 to avoid having too many icons on the screen.
                It updates in real-time when you press the play button :)

                I am not very happy with how the icons look, I could use some help from a designer I guess ;)

                @ivo My biggest limitation for the future is that I am limited to the wind layer, and can't access other infos.
                Is there any chance that I may access other layers without displaying them in the future?
                I would need at least wind gusts, rain and clouds (at ground level).

                1 Reply Last reply Reply Quote 1
                • ivoI
                  ivo Administrator
                  last edited by

                  Big congrats. I will start working on dataLoader so plugin authors could acces our forecast data

                  1 Reply Last reply Reply Quote 1
                  • 雄
                    雄泰 @Okocedion
                    last edited by

                    @Okocedion
                    good!

                    1 Reply Last reply Reply Quote 0
                    • jakubvranaJ
                      jakubvrana @Okocedion | Premium
                      last edited by

                      @Okocedion Thanks for this plugin. However, it currently doesn't work due to this error:

                      Access to fetch at 'https://pg-api.ovh/sites/lng/12.390466781303324/15.862146468803326/lat/49.44939061604292/50.29198304347857/' from origin 'https://www.windy.com' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

                      The server returns the header twice:

                      HTTP/1.1 200 OK
                      Server: nginx/1.14.0 (Ubuntu)
                      Date: Wed, 30 Oct 2019 20:10:15 GMT
                      Content-Type: application/json; charset=utf-8
                      Content-Length: 678
                      Connection: keep-alive
                      X-Powered-By: Express
                      Access-Control-Allow-Origin: *
                      ETag: W/"2a6-sPNj407SokPzs0acOOaRqsoVSiM"
                      Access-Control-Allow-Origin: *
                      

                      Moreover, https://github.com/xVinCe/pg-api doesn't exist anymore so I couldn't try to fix this myself.

                      jakubvranaJ 1 Reply Last reply Reply Quote 0
                      • jakubvranaJ
                        jakubvrana @jakubvrana | Premium
                        last edited by

                        @jakubvrana I was able to solve it by this hack:

                        1. Install Header Editor.
                        2. Add rule Modify response header with header name Access-Control-Allow-Origin and value https://www.windy.com.
                        3. Add a second rule Modify response header with this custom function:
                        let access = false;
                        for (let i = 0; i < val.length; i++) {
                          if (val[i].name == 'Access-Control-Allow-Origin') {
                            if (access) {
                              val.splice(i, 1);
                            }
                            access = true;
                          }
                        }
                        

                        I don't know why both these rules are needed, the first one shouldn't be needed. However if I don't add it then the headers are not modified.

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