External plugins: reliable initial forecast location on mobile?
-
I’m publishing a humidity forecast plugin and ran into an ambiguity with the initial location on mobile.
When the plugin opens, HOME and SEARCH can leave Windy in different initial states:
- After pressing Home, the map center appears to be the intended location
- After searching, the offset crosshair appears to be the intended location
The plugin can read both the map center and picker.pickerDot.getLatLon(), but I haven’t found a reliable public API signal that tells an external plugin which one Windy currently considers the authoritative forecast location on initial open. To avoid loading a forecast for the wrong place, I've had to make the plugin wait for the user’s first intentional map movement, then uses the crosshair location.
Is there an existing supported API for getting the location Windy currently considers selected/authoritative when an external plugin opens? If not, would exposing that location be something Windy could consider adding?
Plugin/source for context:
https://github.com/markkn/windy-plugin-humidity-forecastThanks for any help!
-
M mwindy 3 referenced this topic