How to list the models available at [map center]?
-
I use the following code in my plugin:
const windyStore = W.require("store"); const models = windyStore .get("visibleProducts") .filter((p) => SUPPORTED_MODEL_PREFIXES.some( (prefix) => p.startsWith(prefix) && !p.endsWith("Waves") && !p.endsWith("Analysis") ) );
I have to do some filtering (aka black magic) to remove unwanted values.
There should be a proper way.
I see that the built-in plugin also displays a list of available model.
But it is buggy: the list is only updated when the plugin is opened. So when you open the plugin over the USA and navigate to i.e. Europe, the list is wrong./cc @marekd
-
Seems like the correct way is:
W.require('models').getAllPointProducts({lat: 37, lon: -121});
-
Follow up question for @marekd
Is there an easy way to know if the model has sounding data? (i.e. mbue doesn't)
Thanks
-
It seems like the windy sounding plugin has that hardcoded:
u = ["ecmwf", "gfs", "icon", "iconD2", "iconEu", "bomAccess", "namConus", "namHawaii", "namAlaska", "hrrrAlaska", "hrrrConus", "ukv"]
Windyty, S.E. - all rights reserved. Powered by excellent NodeBB
NodeBB & contributors, OSM & contributors, HERE maps