Windy Community

    • Register
    • Login
    • Search
    • Unread
    • Categories
    • Groups
    • Go to windy.com

    Windy API4 - L.control

    Windy API v4
    3
    4
    1007
    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.
    • S
      silvestrejose last edited by

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

      C 1 Reply Last reply Reply Quote 0
      • fastseas
        fastseas Developers Sailor last edited by

        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.

        1 Reply Last reply Reply Quote 1
        • C
          CodeSpent last edited by

          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.

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

            @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. :)

            1 Reply Last reply Reply Quote 2
            • 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