Windy API4 - L.control



  • Hi there, how can i use L.control in windity api? I need to add scale to the map, how to do it?



  • have you looked at the documentation samples:
    https://api4.windy.com/examples/hello-world/

    once you have a reference to map, you can use it as documented in leaflet documentation.



  • Do you have any working examples? I'm not getting any errors, but the control is not drawing. Would love to see a use case with Windy for reference as I created a sandbox barebones leaflet map with no problems adding control.



  • @silvestrejose I think I found the issue you're having, if its the same as mine. My code was all correct, my layers were constructed, everything was fine. I went and built a barebones Leaflet map and added layer control with no issue, so I couldn't figure it out. Eventually I cleared all my code and started fresh and when inspecting I noticed my control div greyed out, sure enough it had a display: none; rule in Windy's CSS which isn't documented anywhere. I didn't even think about this and feel kind of silly for it.

    #windy #map_container .leaflet-control-container {
    display: none;
    }

    So you'll just have to override this rule and all will be well in the world. :)


Log in to reply
 

Windyty, S.E. - all rights reserved. Powered by excellent NodeBB
NodeBB & contributors, OSM & contributors, HERE maps

Looks like your connection to Windy Community was lost, please wait while we try to reconnect.