0

I know I can create buttons with specific functionalities on Leaflet as it says on its documentation. However, I'd like to create personalized buttons on the left side that will execute functions that I've created as the following: (not the LeafLet premade functionalities):

enter image description here

The source code of my sample is here. The basic code around the draw control is the following:

var ctlDraw = new L.Control.Draw({
  draw:{
    marker:false,
    circle:false,
    rectangle:false,
    circlemarker:false,
    polyline:false
  },
  edit:{
    featureGroup:fgpDrawnItems,
    edit:false
  }
});
ctlDraw.addTo(mymap);

I'm not sure if there's the solution that I'm expecting inside the draw control. Is there any way of adding a personalized icon with a personalized functionality on the left bar using the draw control (an icon that only executes alert('test') for example)? If not, can I do this kind of stuff with a different LeafLet plugin? Or my alternative here is modifying the library?

1

Your Answer

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

Browse other questions tagged or ask your own question.