Group Details Private

administrators

  • RE: Airports not displaying

    Send screenshot I see them all

    posted in Your feedback
  • API documentation for Windy client v13.00 (HELP NEEDED what should we expose in our API)

    This is doc of upcomming Client v13.00. Please let us know, which part of Windy client we should expose to API and document.

    Windy client v13.00

    Windy client v13.00

    Getting started

    Windy API enables you to create your own Windy App with minimum effort. You do not need any server, and you can have your Windy App up & running in less than 5 minutes.

    Once you are logged in API console at https://api.windy.com, you can create one or more Windy Apps by adding JS, CSS or HTML code to client codes of Windy.

    Your published Windy App will be accessible on https://mywindy.com/username/app-name.

    If you want to run your Windy App on your own domain, set up your own server somewhere, and embed your Windy App inside and iframe.

    Windy API console let you edit Javascript, CSS, Head or HTML of Windy. HTML and Head content is inserted as the last element of document's body, or head section. Your javascript is wrapped inside (function() { ... })() so you donot need to wrap it.

    While Leaflet uses global object L, Windy javascript libraries use global object W.

    Your Javascript code, that you will write inside the editor in API console, will be launched when document is loaded, Leaflet map is initialized, and all is up and running.

    Windy client at windy.com versus your Windy App at mywindy.com

    Javascript code, that powers your mywindy.com app is just simplified code of main Windy client that is running on windy.com, and thus uses same versioning. You have ability to choose, which version of Windy client will power your own myWindy app via drop down menu in Windy Console.

    Since Windy client is highlly optimized native JS code, using a lot of browser features and CSS fixed positioning, we are unable to expose Windy as a library. And also all commercially licenced data (for example ECMWF model) must run on our domain.

    W.Class: Windy classes

    Windy is powered by objects highly inspired by Leaflet's philosophy of L.Class. But we have made it more simple and avoiding keyword new. All the objects are descendants of W.Class that has methods extend and instance. Constructor is method named _init and while extend just extends the class instance calls constructor afterwards.

    extends support multiple classes as parameters making nice mixins in just one line of code.

    Source code:

        W.Class = {
            extend() {
                var dest = Object.create(this),
                i, j, len, src
    
                for (j = 0, len = arguments.length; j < len; j++) {
                    src = arguments[j]
                    for (i in src) {
                        dest[i] = src[i]
                    }
                }
                return dest
            },
            
            instance() {    
                var dest = this.extend.apply(this,arguments)
                // Call the _init if is found
                if( typeof dest._init === 'function' ) dest._init.call(dest)     
                return dest;
            }
        }   
    

    W.map: Instance of Leaflet map

    Instance of Leaflet map is available as W.map. Windy uses Leaflet version 0.7.7 that is well documented here and contains plenty of plugins that you can use

    W.map has also some custom Windy methods and props attached to itself.

    Example of diplaying geoJSON on a map:

        var url = 'https://raw.githubusercontent.com/windyty/API/master/assets/capAlerts.json'
    
        // Centers the map to USA
        W.map.setView([47.443,-95.400])
    
        // Loads GeoJSON and displays it on Windy
        fetch(url)
            .then(response => response.json())
            .then(result => {
                
                L.geoJson( result ).addTo( W.map )
    
            }) 
    

    We do not plan to upgrade Leaflet version for now.

    W.map.myMarkers: Predefined markers

    Windy defines small set of predefined markers (instances of L.divIcon) that you could potentionaly use. Those are:

    W.map.myMarkers.icon
    Pulsating icon for short time

    W.map.myMarkers.pulsatingIcon
    Pulsating icon forever

    W.map.myMarkers.myLocationIcon
    Blue icon of user's location

    W.map.myMarkers.other
    Rounded circle

    Example:

        var marker = L.marker([ 50, 14 ], { icon: W.map.myMarkers.pulsatingIcon })
    
        marker.addTo( W.map );
    

    W.Evented: Emitting and broadcasting messages

    Some of the Windy components are descendants of W.Evented and emit messages.

    Recieving and emmiting messages uses usuall syntax and methods: on, off, once, fire. (You can use handy aliases emit or trigger to emit messages if you are used to). Each emitter has its own color producing nice output in browser's console.

    Just remember, that broadcasts emited by W.map are in fact Leaflet's brodcast, not Winyd's ones.

    W.brodacast: main Windy's broadcaster

    W.broadcast (instance of W.Evented) is major Windy's emitter, firing most of the important events.

    Major broadcasted messages are:

    mapChanged
    After Leaflet map has been panned or zoomed.

    paramsChanged
    When user changes some paramters (overlay, level, date etc...). Do not not use this event to start any intensive action since Windy now must load and render all the data. We recommend to use redrawFinished instead.

    redrawFinished
    Triggered when Windy has succesfully loaded and rendered requested data. Use this for triggering your own tasks.

    metricChanged
    After some of the units (wind, temp, ...) has been changed.

    rqstOpen, rqstClose, closeAll
    Requests to load and open or close lazy loaded plug-ins (see later)

    pluginOpend, pluginClosed
    Lazy loaded plugin was sucessully loaded and opend/closed

    Example:

        W.broadcast.on('redrawFinished', params => {
    
            // Wow Windy has finished rendering.
            console.log( params )
    
        })
    

    W.store: main data store

    All major parametrs and settings are stored inside W.store. It is sophisticated key, value store that checks your input for validity and maintains integrity of all the parameters.

    Use methods get to read value from store, set to change value in the store and on to observe change of the value. Some of the items respond to method getAllowed to return array of allowed values.

    Method set returns true if provided value was valid and was actually changed.

    Example:

        var overlay = W.store.get('overlay')
        // 'wind' ... actually used overlay
    
        var allowedOverlays = W.store.getAllowed('overlay')
        // ['wind', 'rain', ... ] ... list of allowed values
    
        W.store.set('overlay','rain')
        // true ... Metric was changed to rain
    
        W.store.on('overlay', ovr => {
            // Message will be emited only if value wa valid and actually changed
            console.log('Wow, overlay has been chnaged to', ovr)
        })
    

    W.store is event emitter (instance of W.Evented) and supports all the range of methods (on, off, once, fire).

    Main items stored in W.store

    To list all data inside store use W.store.getAll().

    Each stored item have some default value. Default metrics (imperial or metric) and time settings (12h or 24h) is determined by visitors country location, but you can override any of the value.

    Some of the major items you could be interested in are:

    overlay
    Color weather overlay. Use W.store.getAllowed('overlay') to get list of allowed values.

    level
    Level used for actualy displayed overlay or isolines. To get list of available levels for current combination of overlay and data provider type W.store.get('availLevels')

    acTime
    Accumulated time. Use W.store.getAllowed('acTime') to get list of allowed values.

    timestamp
    Timestamp of actual weather moment. Use freely and without hesitation.

    Example:

        var fiveHours = 5 * 60 * 60 * 1000
    
        W.store.set('timestamp', Date.now() + fiveHours )
    

    path
    Read only value! UTC string containing time of actually rendered data that are available for current overlay and weather model.

    isolines
    Isolines displayed over the map. Use W.store.getAllowed('isoline') to get list of allowed values.

    product
    Product is set of weather data, that have same resolution, boundaries, time range and so on. For simplification, you can think of product as a weather model. Use W.store.getAllowed('product') to get list of allowed values.

    particlesAnim
    Animation of wind/waves particles over the map. Set value to on, or off if you wan to hide or show them.

    graticule
    Display graticule over the map. Set it to true or false.

    latlon
    Diplay lat/lon values on weather picker. Set it to true or false.

    englishLabels
    Show english map labels instead of localized labels. Set it to true or false.

    lang
    Desired language for Windy. By default is determined by user's browser setting and set to auto. Use W.store.getAllowed('lang') to get list of avail langs.

    hourFormat
    Time format, Set it to 12h or 24h.

    numDirection: { def: false, allowed: trueFalse, save: true, sync: true },
    Display directions in Weather picker as number or as a string (for example NW). Set it to true or false..

    favOverlays
    List of overlays, that are displayed in overlays menu. Alway crete new array, when you want to modify this list (W.store is primitive and can't compare arrays)

    Example:

        W.store.set('favOverlays',['wind', 'gust', 'rain', 'rainAccu','snowAccu'])
    

    Note: Even though W.store contains all the metrics and units, we advise to access and change metrics only through W.overlays module.

    Permanent storage and cloud synchronisation

    While Windy client is able to store some W.store items permanentlly (using browser's localStorage) and some of them even sync with othere devices via cloud, this feature is not supported in API.

    W.overlays: change and convert metrics

    W.overlays defines main parameters required to render specific weather overlay. Each defined overlay contains all used overlays together with their colors, settings for legend and metrics.

    You will use this module to read and modify these values and customize your app.

    Example:

    
        W.overlays.wind.metric
        // 'kt' .. actually selected metric for wind overlay
        // Read only value! Do not modify.
    
        W.overlays.wind.listMetrics()
        // ['kt', 'bft', 'm/s', 'km/h', 'mph'] .. available metrics
    
        W.overlays.wind.setMetric('bft')
        // Metric for wind was changed to bft
    
        W.broadcast.on('metricChanged', (overlay,newMetric) => {
            // Any changes of metric can be observed here
        })
    

    W.plugins: lazy loaded plugins

    Windy consist of plugins, that are loaded whenever necessary. Plugin can be for example javascript library, or some user feature (like menu sliding from the right side). We recommend to access these plugins just by emitting messages rqstOpen and rqstClose on major W.broadcast. Some of the plugins require parameters for opening.

    Only few plugins can be safely exposed in Windy API like: distance, picker or settings.

    Example:

        W.broadcast.fire('rqstOpen','distance')
        // Open distance measurement plugin
    
        W.broadcast.fire('rqstClose','distance')
        // Closes distance measurement plugin
    

    W.picker: weather picker

    Weather picker can be opend programatically as any other plugin by emiting request message: W.broadcast.fire('rqstOpen','picker',{ lat: 50, lon: 14 }). If the picker is opened outside visible map, it is closed afterwards, and also paning so the picker gets outside map, leads to close of the picker. Picker emits message about its own state and supports all the range of methods (on, off, once, fire).

    Example:

    
        W.map.setView([50,14])
        // Change centre of the map
    
        W.broadcast.fire('rqstOpen','picker',{ lat: 50, lon: 14 })
        // Opens the picker
    
        W.broadcast.fire('rqstClose','picker')
        // Closes the picker
    

    Picker itself is event emitter (instance of W.Evented) firing pickerOpened, pickerClosed and pickerMoved, while picker moved provides raw meteorological values in the picker location.

    Example:

        W.picker.on('pickerOpened', latLon => {
            // picker has been opened at latLon coords
        })
    
        W.picker.on('pickerMoved', (latLon,result) => {
            // picker was dragged by user to latLon coords
    
            console.log( result )
            // { overlay: 'wind', values: [ 0.4, 0.75, 0] }
    
        })
    
        W.picker.on('pickerClosed', () => {
            // picker was closed
        })
    

    TODO:

    Converting raw meteorological values to readable numbers

    • Descrition of major overlays
    • W.utils, W.format, W.overlays

    Changing background map tiles

    Changing color of overlyas

    posted in Windy API
  • RE: Weather not rendering in Safari

    No v13.00 will not adress this

    posted in Windy API
  • RE: Layers with custom controls not working

    @siim Wait for v13.00 of client

    posted in Windy API
  • RE: embed to your page...

    @dafish Use our API

    posted in Your feedback
  • RE: Favourites limit

    there is no limit. Why you have only 9? Try to find a bug a report it

    posted in Your feedback
  • RE: Can I integrate Windy map in my iOS app?

    As long as logo Windy.com will be visible and app will not be competing with ours (I mean your app will offer different functionality then ours) that it is ok.

    Just let us know the name of app for check

    posted in Windy API
  • RE: Weather not rendering in Safari

    I confirm that this is a Safari bug (not ours). We try to find what can we do about it.

    posted in Windy API
  • RE: Swell period values in the Eastern Mediterranean Dec 06 2017

    @meteo-gr Your last picture shows "Mean period of total swell", but as I said, we now display "Mean wave period of first swell partition" in order to display comparable values to Wavewatch.

    posted in Your feedback
  • RE: Swell period values in the Eastern Mediterranean Dec 06 2017

    @meteo-gr The discrepancy between screenshots comes from different timelines in detailed view and mapview. In detail view there is local time of the picked place, but the map view timeline contains timezone defined in your computer. Try to move 3h back in mapview timeline (with closed detail) and you should see also value bigger than 20 s.

    posted in Your feedback

Looks like your connection to Windy Community was lost, please wait while we try to reconnect.