Change of metric

Each ovelay has its own object instance, residing in W.overlays.overlay_name. To change metric for particular overlay use W.overlays.overlay_name.setMetric( ident ) method, where ident is identifier of new metric.

User can change matric by clicking on a legend on a right side.

Change of metric produces metricChanged message.

Allowed metric values:

    wind: ['kt','bft','m/s','mph','km/h'],
    temp: ['°C','°F'],
    pressure: ['hPa','inHg'],
    clouds: ['mm','in'],
    waves, swell: ['m','ft']

Source code

<!DOCTYPE html>
    <script src=""></script>
    <style type="text/css">
      #windyty {    height: 500px; width: 1000px; 
                    margin-left: auto; margin-right: auto;
                    position: relative;
                    margin-top: 50px; }
    <div id="windyty"></div>

    <script type="text/javascript">
    var windytyInit = { key: 'PsL-At-XpsPTZexBwUkO7Mx5I' }  

    function windytyMain(map) {

      var metrics = ['kt','bft','m/s','mph','km/h'],
      actual = 0;

        if(actual > metrics.length) actual = 0;
        W.overlays.wind.setMetric( metrics[ actual ] );


    <script async defer src=""></script>