Give access to interpolator



  • 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.

  • Administrator

    @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)



  • 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.



  • @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).


Log in to reply
 

Windyty, S.E. - all rights reserved. Powered by excellent NodeBB
NodeBB & contributors, OSM & contributors, HERE maps