Two instances of the same map on the page are not currently allowed. That however creates an issue when dealing with front end routing, as the page does not reload. Having two instances of the map on two different pages and going back and forth between the two (without an actual page refresh) re initiates the global windy object (W) and throws console errors which stop the map from being 100% functional. Is there a workaround to this?
Latest posts made by Kostis90
-
Front end routing with no page refresh re initiates windy object and throws console errors (two instances of map)
-
Two instances of the map on a page
I am trying and intend to use the windy map both to appear inside a small widget, as well as appear (increased in size), in a big modal when the expand map button is clicked on the widget.
That would require 2 instances of the map to exist on the page as the application is an SPA and all content is shown on the same page.
I tried implementing the above and although it does seem to be working (both maps are fine), a lot of console errors seem to appear, due to several of the main object's properties W being reinitialized. e.g.
Object W.params already exists
According to the Things to remember in the API Windy API v4 documentation:
There can be only one instance of Windy Map on a page, but you can use multiple instances of Leaflet map on the same page.
Does the above mean that I cannot do what I have in mind? Is this a conditions of use limitation or a technical limitation?
A few questions based on the above:
-
Are the console errors I'm getting normal behavior?
-
Are they the reason why we shouldn't be using 2 instances of the map on the same page (due to the global W object being reinitialized?)
-
Is there a workaround for this and would it be allowed and recommended?
-
-
Font icons not displaying (bug)
More of a bug report rather than a question.
For v4. of the API the font icons seem to not be displaying due to a CORS issue. I only noticed today, it was fine yesterday. The error displayed in the console is:
Access to Font at 'https://www.windy.com/v/12345689/iconfont.woff' from origin ${website-name} has been blocked by CORS policy
. This seems to be a universal issue as I've had a look at other windy maps on external sites that have used the new API (v4) and they seem to be facing the same issue.