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

    Give access to interpolator

    Scheduled Pinned Locked Moved Windy API v4
    4 Posts 2 Posters 1.6k 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.
    • jakubvranaJ Offline
      jakubvrana | Premium
      last edited by

      I am trying to read wind information from various places on the map and display it (https://pg.vrana.cz/mapa/). The only way how to currently do it is by using Picker - open picker, call getParams() and close it. This is both cumbersome and it also has a lag. The lag is caused by this condition in picker.update():

      var t = Date.now();
      if (!this.popup || t - this.lastRender < 300)
        return;
      

      this.latestValues is set only after this condition in createHTML(). The outcome is that calling getParams() in quick succession gives values for random places which were read first in 300 ms blocks. I propose this:

      1. Set this.latestValues always, not just every 300 ms. If this would be too slow then set it to null and in getParams(), check if it's null. If it's null then set it there.
      2. Make the interpolate() method public.
      1 Reply Last reply Reply Quote 0
      • marekdM Offline
        marekd Windy Staff
        last edited by

        @jakubvrana I would recommend you to create an Windy plugin instead. Then you can use point forecast to get data immediatelly without any delay.
        https://github.com/windycom/windy-plugins/tree/master/examples/10-obtaining-meteorological-data

        (the documentation is not as good as for the API, but it should be enough)

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

          I've temporarily solved it by using an internal API:

          W.tileInterpolator.createFun(interpolate => {
            var data = interpolate({lat, lon});
          });
          

          @marekd The plugins aren't available on mobile which is a deal breaker for me. But I'll probably create both the plugin and the app using API.

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

            @marekd The plugins aren't available on mobile which is a deal breaker for me. But I'll probably create both the plugin and the app using API.

            The plugins are actually available on mobile, there's just no menu item for them. If you open https://www.windy.com/plugins then you can use them. If you open this link from other app (not a browser) then you can use them even in the Windy app (which hijacks the opened URL and opens itself, at least on iOS).

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