Windy Community
    • Unread
    • Categories
    • Groups
    • Go to windy.com
    • Register
    • Login

    How to list the models available at [map center]?

    Windy Plugins
    1
    4
    481
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • vicbV
      vicb Paraglider | Premium
      last edited by

      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

      vicbV 1 Reply Last reply Reply Quote 0
      • vicbV
        vicb Paraglider @vicb | Premium
        last edited by

        Seems like the correct way is:

        W.require('models').getAllPointProducts({lat: 37, lon: -121});
        
        vicbV 1 Reply Last reply Reply Quote 0
        • vicbV
          vicb Paraglider @vicb | Premium
          last edited by

          Follow up question for @marekd

          Is there an easy way to know if the model has sounding data? (i.e. mbue doesn't)

          Thanks

          vicbV 1 Reply Last reply Reply Quote 0
          • vicbV
            vicb Paraglider @vicb | Premium
            last edited by

            It seems like the windy sounding plugin has that hardcoded:

            u = ["ecmwf", "gfs", "icon", "iconD2", "iconEu", "bomAccess", "namConus", "namHawaii", "namAlaska", "hrrrAlaska", "hrrrConus", "ukv"]
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Windyty, S.E. - all rights reserved. Powered by excellent NodeBB
            NodeBB & contributors, OSM & contributors, HERE maps
            Terms of Use     Privacy Policy