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

    API beta test

    Windy API v4
    14
    42
    14.3k
    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.
    • marekdM
      marekd Administrator
      last edited by

      @ShahramT @EnergyVue @Thiago-Gabriel @asjustis @saaneuvos Since you had a problem with the previous upgrade attempt, I would like to ask for your help to test the new version. I hope I was able to fix all the reported issues, but based on previous experience, I am afraid to upgrade straight into production.

      Can you please try to load the API from the address
      https://api.windy.com/assets/map-forecast/libBoot.js?beta=36
      and test your applications?

      If all is well, feel free to leave this address in production. It will work even after releasing the new version into production.

      Thank you so much for your help and sorry for all troubles yesterday. Also, if you would like to be notified in the future before upgrade and try the new version before release, PM me your email where we can touch you next time.

      T S 2 Replies Last reply Reply Quote 1
      • marekdM marekd pinned this topic on
      • T
        Thiago Gabriel @marekd
        last edited by

        @marekd said in API beta test:

        https://api.windy.com/assets/map-forecast/libBoot.js?beta=36

        Hei, thanks for the effort in fixing the issues we are facing. I tried the beta version of the API and I still face the same two issues from before.

        • The particles plugin is not init due to some error when trying to extend a Leaflet component (the component is undefined).
        • When returning to the page where the windyMap is init, the init process fails.

        I dont have time to try to prepare a playground that reproduces the error for you right now. I will try to do it when I finish some other tasks.

        1 Reply Last reply Reply Quote 1
        • marekdM
          marekd Administrator
          last edited by

          @EnergyVue I tried to fix the "reinit" problem you mentioned here, it should work now. Could you please try it once again?

          EnergyVueE 1 Reply Last reply Reply Quote 0
          • EnergyVueE
            EnergyVue @marekd
            last edited by

            @marekd I tested the beta=36 version,... it seems to be working now,.. But, I can't select the satellite view, I assume it's temporarily disabled ?

            1 Reply Last reply Reply Quote 0
            • A
              asjustis
              last edited by

              @marekd said in API beta test:

              ?beta=36

              Hi @marekd , thanks for tagging us. Happy to see the release process improving to avoid issues in production!

              With the beta version so far we noticed only the pressure overlay having different colors.

              Before:
              https://drive.google.com/file/d/1v9vivS_GGamAz_ftVlekUth95O5EwXkb/preview

              In beta:
              https://drive.google.com/file/d/1y1I5_Y29pniE5tFZsEMkf4fXTpIs43g8/preview

              P.S. btw, your image uploader is broken at least with Chrome, could not upload the images here directly :)

              Cheers,
              Justinas

              1 Reply Last reply Reply Quote 0
              • marekdM
                marekd Administrator
                last edited by

                @EnergyVue Thank you for your help! Satellite should work, I will look into it.
                @asjustis That is on purpose, we changed our default colors for pressure overlay. You can override it if you want. By the way, I cannot see Windy logo on your screens, this violates the API terms of use ;-) Can you be please more specific what you mean with "image uploader"?

                1 Reply Last reply Reply Quote 0
                • ShahramTS
                  ShahramT | Premium
                  last edited by

                  @marekd said in API beta test:

                  ?beta=36

                  Hi,

                  It works perfectly! Thanks.

                  ShahramTS 1 Reply Last reply Reply Quote 0
                  • ShahramTS
                    ShahramT @ShahramT | Premium
                    last edited by

                    @shahramt
                    I see the warning message "!!! Repeatedly calling "windyInit" of an already initialized API is an unsupported functionality and will be removed in future versions!"
                    Do you have any other solution for how show a new location after user input without reloading the page?

                    marekdM 1 Reply Last reply Reply Quote 0
                    • marekdM
                      marekd Administrator @ShahramT
                      last edited by

                      @shahramt Do not init map again. Init is a procces, where all windy libraries are loaded and initialized. After the map is once set, you should work only with its API. Eg. clean all markers, create new markers, change location, zoom, change layers, ... You should handle this programmatically according to available methods mentioned here: https://api.windy.com/map-forecast/docs.
                      Reinit drops whole HTML and init all already inited modules again. It was a miracle it had worked till now. I had to do really ugly stuffs to make it work somehow in the current beta version.

                      T ShahramTS 2 Replies Last reply Reply Quote 1
                      • T
                        Thiago Gabriel @marekd
                        last edited by

                        @marekd Hi marekd. I face the same issue regarding the reinitialization of the map in my React web app. If i do not explicity reinit the map when I come back to the page that contains the windy div after navigating to another url, the map is not rendered again (I just get a gray screen). Am I missing something? Why the class that I use to define the windy map doesnt seem to target the windy map div after the first initialization of the API?

                        marekdM K 2 Replies Last reply Reply Quote 0
                        • marekdM
                          marekd Administrator @Thiago Gabriel
                          last edited by

                          @thiago-gabriel I am sorry, but I am affraid I cannot help you. I think the problem could be the div is not visible. It is something our library does not count on. But I did not write anything in react for 4 years, so I do not know what exactly and how it works. I think the safe "solution" (workaround to be more precise) would be to have the map in an iframe and unmount the iframe on component unmount. Then load the iframe again on mount. I have not tried that, but I suppose it will work correctly and it will be safe even for next versions.
                          It's a little half-baked on our part we do not count on someone would like to hide the map for a while. The API library comes directly from our client codes and our website has map all the time. Sorry about that, but there are no plans to change that :-(

                          1 Reply Last reply Reply Quote 2
                          • ShahramTS
                            ShahramT @marekd | Premium
                            last edited by

                            @marekd
                            Ok, but would you tell me how do I reach the map object and can redefine the center (and the content) by an example?
                            https://touchngo.se
                            I get the new position from the user but I do not know how to access the map-object later.
                            Many thanks in advance

                            marekdM 1 Reply Last reply Reply Quote 0
                            • marekdM
                              marekd Administrator @ShahramT
                              last edited by

                              @shahramt You should be able to store the map object into your custom variable which is accessible from the part of code you need. Or W.map.map (yes, 2 map) should work as well.

                              1 Reply Last reply Reply Quote 1
                              • marekdM
                                marekd Administrator
                                last edited by

                                Beta has been released to production. Thank you all for your help.

                                C 1 Reply Last reply Reply Quote 0
                                • C
                                  CompassDSNM @marekd
                                  last edited by

                                  @marekd

                                  Hi @marekd, could you please tag us in future? You have taken down our application in production this morning. Issues been reported to support.

                                  C 1 Reply Last reply Reply Quote 0
                                  • C
                                    CompassDSNM @CompassDSNM
                                    last edited by

                                    @mared Could someone please help us? This version has completely broken us.

                                    C 1 Reply Last reply Reply Quote 0
                                    • C
                                      CompassDSNM @CompassDSNM
                                      last edited by

                                      @marekd We have made some progress with the issues using the following:

                                      windyInit(options, windyAPI => {
                                      
                                                      const { map, picker, utils, overlays, store, broadcast, particles } = windyAPI;
                                      
                                                      let baseLayer = W.map.baseLayer;
                                      
                                                      W.map = W.map.map;
                                                      W.map.baseLayer = baseLayer;
                                      }
                                      

                                      The rest of our code uses W.map to address the map, so we have to assisn W.map.map to it. But this then lost w.Map.baseLayer, so we need to reassign it too.

                                      This has brought our application back to life, but one need issue could you look at?

                                      9c3ddb3f-4683-4cc1-9435-9847e5d939af-image.png

                                      We create a form on the map to control turning on / off other layers. Since the new version of Windy we are now getting a "cursor: not allowed;" when hovering over the checkboxes shown in the screenshot.

                                      The CSS is matching on input:read-only but our input checkboxes are not read only.... As you can see in the screenshot nothing is set to read only. But on hover of those inputs you get : 105fc619-84dd-4a9a-9769-4ed4a0aac53f-image.png

                                      C 1 Reply Last reply Reply Quote 0
                                      • C
                                        CompassDSNM @CompassDSNM
                                        last edited by

                                        @marekd

                                        I can override the CSS with

                                            #windy .form-group input:read-only {
                                                cursor: initial; /*This is like a weird bug where it was showing checkboxes as disabled even if the input was not read-only*/
                                            }
                                        

                                        but seems like a bug at your side.

                                        1 Reply Last reply Reply Quote 0
                                        • marekdM
                                          marekd Administrator
                                          last edited by

                                          @compassdsnm Sorry for all problems. I am glad it works for you again. Just please be careful with using of W object. As it stands in the documentation https://api.windy.com/map-forecast/docs

                                          Do not use features not listed here as we cannot guarantee that they will be available in other versions of Map Forecast API.

                                          And accessing W object and its inner properties are definitely risky part. It can happen again. I would suggest you to use only windyAPI object returned after initialization.

                                          C 1 Reply Last reply Reply Quote 0
                                          • C
                                            CompassDSNM @marekd
                                            last edited by

                                            @marekd We will need to discuss this internally. Initial feeling is that we would rather stay as close to a standard leaflet implementation as possible. Windy is a small part of our application.

                                            @marekd can you reproduce the above CSS issue? I could create a simple page and set this up if you would like.

                                            Euan

                                            marekdM 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