W.overlays.clouds.setMetric Not Working?



  • Why doesn't this work for me? I cannot get the metric to change. The only one that will change is wind overlay. The sample works great, but it is for wind. All other overlays do not change? Thanks!

    W.overlays.clouds.setMetric('in');


  • Pilot

    @WhackingFatties

    W.overlays.clouds.setMetric('in'); doesn't work for me either....
    give this a try:


    W.overlays.clouds.setMetric('in/h');


    I've found the metrics must be set AFTER the overlay has been set. If you try that snippet of code while the wind overlay is currently displayed it won't work. So put it here.....


    W.setOverlay('clouds');
    W.overlays.clouds.setMetric('in/h');
    W.on('redrawFinished',function(e){});


    ^ that works for me. Let me know

    -a dude that's trudging through the API as well


  • Pilot

    another update if anyone cares:


    The API guide shows the following inputs for how to set the units for each overlay type:

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


    Already mentioned for clouds you should use ['in/h'] (instead of ['in'] as listed above).

    Not sure if it's just me but natively the map shows °C or °F for the units (unicode U+00C2 - capital latin 'A' with circumflex in front of unit name).

    if you want to change default unit for Temperature or SST (sea temp) you should use just plain ['°F'] (instead of ['°F'] as listed above).

    vapor


Log in to reply
 

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