0

I wanted to add more button along with this Cancel button, When user click on marker from leaflet toolbar. Please suggest me the solution or any plugin which helps to achieve this requirement.

enter image description here

vinita jain
  • 163
  • 2
  • 18

1 Answers1

1

You can use the Plugin Leaflet-Geoman

function onclick(e){
    console.log('CLICK')
}

// add a new custom control
map.pm.Toolbar.createCustomControl({
  name: 'CustomButton',
  block: 'draw',
  className: 'control-icon leaflet-pm-icon-marker',
  actions: [{
    text: 'Cancel', 
    onClick: onclick 
  }]
})

Go to custom button doc and then scroll to Adding New/Custom Controls

Example: https://jsfiddle.net/falkedesign/6x9cknft/

Falke Design
  • 10,635
  • 3
  • 15
  • 30