react-leaflet-draw
react-leaflet-draw copied to clipboard
popup with event handling
Hello,
when im adding markers to the map im trying to create a popup for each marker with event handling, but keep running into issues. when i try to generate a popup with a div and bind it I get type error message (appendchild on node) if i convert the whole popup into string then the onclick or onchange event doesnt work.
Is there any way to work around it ?
maybe this can help, it would add the text from the state to the especific object
_onCreated = (e) => {
let type = e.layerType;
let layer = e.layer;
console.log(layer)
if (type === 'marker') {
layer.bindTooltip(this.state.typeforCreateMarker);
}
if (type === 'polyline') {
layer.bindTooltip(this.state.typeforCreatePolyline);
}
}