Windy Community

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

    How to set leaflet map interaction options?

    Windy API v4
    3
    3
    728
    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.
    • A
      andreszs last edited by

      I know that map methods can be accessed using the map object, but how can we configure the map options such as doubleClickZoom, dragging and so on?

      This is my current initialization code:

      windyInit( options, windyAPI => {
      	// windyAPI is ready, and contain 'map', 'store', 'picker'
      	const {store,map} = windyAPI;
      	store.set('lang', 'es');
      	// .map is instance of Leaflet map
      	map.setMaxZoom(9); /* this is a method and it works */
      	map.doubleClickZoom = false; /* this is an option and it does not work */
      	// add default marker
      	L.marker([options.lat, options.lon]).addTo(map); 
      })
      
      I rittels 2 Replies Last reply Reply Quote 2
      • I
        icosgrove @andreszs last edited by

        @andreszs If anyone has any answer for this ti would be very helpful i am having the same issue.
        With a standalone leaflet map, you declare these at init, but that isn't how this leaflet map is instantiated with windy so i have no idea how to set these options like dragging, zoomsnap, zoomdelta.

        1 Reply Last reply Reply Quote 0
        • rittels
          rittels Code contributor @andreszs | Premium last edited by

          @andreszs

          try:

          W.map.doubleClickZoom.disable();

          https://leafletjs.com/reference-1.4.0.html#handler

          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