0

how i can enable Snapping on L.Draw Control Polygon in latest versions of Leaflet 1.8, without using geoman

I am using L.Draw.Polygon to enable drawing on the map, here is code for that

polygonSiteDrawer = new L.Draw.Polygon(this.map,{
      showArea: false,
      allowIntersection: false,
      repeatMode: false,
      shapeOptions: {
        color: '#D57100',
        clickable: true
        
      },
      icon: new L.DivIcon({
        className: 'icon-div-draw',
        html: `<i style="color:white; font-size: 10px" class="fa fa-square" ></i>`,
      })
    });

I can successfully create polygons on the map by just enabling and disabling whenever i need, but now i want to enable snapping of the polygon created with this method to a feature Group where all the save polygons are. How can i enable snapping ? I have tried L.Snap but that did not work, also i am using angular/typescript.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy