Windy Community

    • Register
    • Login
    • Search
    • Unread
    • Categories
    • Groups
    • Go to windy.com

    Get all Overlay values from Picker location?

    Windy API v4
    4
    5
    1437
    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.
    • G
      garybrucey last edited by

      Hi, I am trying to get information about multiple overlays - wind, waves, visibility - at the picker location but haven't had much luck. the wave2obj and wind2obj API's both return the same data, which is just the overlay I have selected in the UI. My goal is to get this data from an arbitrary lat/long, without the user selecting a picker location. Any helps is appreciated!

      windyInit( options, windyAPI => {
                          // windyAPI is ready, and contain 'map', 'store',
                          // 'picker' and other usefull stuff
      
                          const { picker, utils, broadcast, map, overlays } = windyAPI
                          // .map is instance of Leaflet map
      
                          picker.on('pickerOpened', latLon => {
                              // picker has been opened at latLon coords
      
                              let { lat, lon } = picker.getParams()
      
                              // seems to only work when the map is set to the right context.
                              let windObject = utils.wind2obj(overlays.wind.convertValue())
                              let waveObject = utils.wave2obj(overlays.waves.convertValue())
      
                              console.log("VALUES \n")
                              console.log(picker)
                              console.log(windObject)
                              console.log(waveObject)
          })
      })
      
      1 Reply Last reply Reply Quote 0
      • fastseas
        fastseas Developers Sailor last edited by

        I recon the picker can only report data for the currently selected overlay.

        1 Reply Last reply Reply Quote 0
        • G
          garybrucey last edited by

          That would make sense, but calling store.set('overlay','waves') doesn't change the value the picker reports. Do I need to ask for information a different way?

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

            There is BUG in picker for a long time I think. Picker do not know that overlay changed and you have to moove picker a little I guess.

            1 Reply Last reply Reply Quote 1
            • M
              mvargasevans last edited by

              Hi All,
              Has someone been able to answer this question?

              I am interested in pulling all the weather data from a specific point where the picker was placed, without much success as described by Gary.

              Regards

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