Windy Community

    • Register
    • Login
    • Search
    • Unread
    • Categories
    • Groups
    • Go to windy.com
    1. Home
    2. serbekh
    3. Posts
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 5
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by serbekh

    • Picker API behavior

      I try to run windy picker example:

      
      windyInit(options, windyAPI => {
          const { picker, utils, broadcast } = windyAPI;
      
          picker.on('pickerOpened', latLon => {
              // picker has been opened at latLon coords
              console.log(latLon);
      
              const { lat, lon, values, overlay } = picker.getParams();
              // -> 48.4, 14.3, [ U,V, ], 'wind'
              console.log(lat, lon, values, overlay);
      
              const windObject = utils.wind2obj(values);
              console.log(windObject);
          });
      
          picker.on('pickerMoved', latLon => {
              // picker was dragged by user to latLon coords
              console.log(latLon);
          });
      
          picker.on('pickerClosed', () => {
              console.log('picker was closed!')
          });
      
          // Wait since wather is rendered
          broadcast.once('redrawFinished', () => {
              picker.open({ lat: 48.4, lon: 14.3 });
              // Opening of a picker (async)
          });
      });
      

      It loads great!
      When I wanted to use other methods, something went wrong...
      For example, I tried to open it, close it and open it again:

      ...
          broadcast.once('redrawFinished', () => {
              picker.open({ lat: 48.4, lon: 14.3 });
              picker.close();
              picker.open({ lat: 45.4, lon: 45.3 });
              // Opening of a picker (async)
          });
      ...
      
      1. when I try to execute picker.close(), nothing happens. (It should print 'picker was closed!' to console)
      2. This message ('picker was closed!') appears only on click on cross sign near picker.
      3. After that I tried to run picker.open({ lat: 48.4, lon: 14.3 }) again, bun I've got another error:
      Uncaught TypeError: this.show is not a function
          at Object.open (picker.js:4)
          at NewClass.eval (Map.vue?108f:99)
          at NewClass.fire (leaflet-src.js?e11e:593)
          at NewClass._fireDOMEvent (leaflet-src.js?e11e:4425)
          at NewClass._handleDOMEvent (leaflet-src.js?e11e:4382)
          at HTMLDivElement.handler (leaflet-src.js?e11e:2658)
      

      So, question is how to close and open picker again programmatically.

      posted in Windy API v4
      S
      serbekh
    • RE: show extended forecast table on picker clicked (like at windy.com)

      @serbekh said in show extended forecast table on picker clicked (like at windy.com):

      So, is it possible to get picker with that arrow-down button to open detailed forecast with just windy weather API?

      Unfortunately, there is no information about it at https://api.windy.com/map-forecast/docs.
      And if it is impossible to get such detailed forecast with Map Weather API out of the box, how I may reproduce it? Maybe I should combine Map weatherAPI and Point forecast API? Or such beautiful UI is part only of windy.com and not provided in Windy API?

      Of course, I mean "Windy Map Forecast API".

      posted in Windy API v4
      S
      serbekh
    • RE: show extended forecast table on picker clicked (like at windy.com)

      @Korina By default, when I use windy Map Forecast API I have such base interface (https://api.windy.com/map-forecast/examples/picker)
      As you can see, it's little difference between windy.com interface and Windy Map Forecast API default interface.
      Windy.com picker:
      Screenshot_2020-08-07 Windy as forecasted.png

      Windy Map Forecast API default picker:
      Screenshot_2020-08-07 Windy Map Forecast API - Use the weather picker - tutorial.png
      So, is it possible to get picker with that arrow-down button to open detailed forecast with just windy weather API?
      Screenshot_2020-08-07 Windy as forecasted(1).png
      Unfortunately, there is no information about it at https://api.windy.com/map-forecast/docs.
      And if it is impossible to get such detailed forecast with MapWeather API out of the box, how I may reproduce it? Maybe I should combine Map weatherAPI and Point forecast API? Or such beautiful UI is part only of windy.com and not provided in Windy API?

      posted in Windy API v4
      S
      serbekh
    • show extended forecast table on picker clicked (like at windy.com)

      Hello!
      Is it possible to get (out of the box) detailed forecast table like at windy.com?
      Opera Снимок_2020-08-04_220711_www.windy.jpg

      posted in Windy API v4
      S
      serbekh