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?
G
Latest posts made by garybrucey
-
RE: Get all Overlay values from Picker location?
-
RE: Windy API v4 is here. Help us to test it
This works great for showing a map at a specific lat/long and letting the user move around the map and change options. Works on mobile too!
-
Get all Overlay values from Picker location?
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) }) })