Leaflet.Editable
Leaflet.Editable copied to clipboard
no events for markers
hi,
i'm trying to rise event for markers but its seems like it is only possible for vertices on polyline/polygon ! Is it right ?
Thx
Not sure what you want to do, but once you created a marker, eg using:
var marker = L.marker(latLng);
You can get click events on this marker by using:
marker.on("click", function(e) { ... })
with a marker created by the L.EditControl.extend ?
De : Olivier [email protected] Envoyé : mardi 10 octobre 2017 22:12 À : Leaflet/Leaflet.Editable Cc : chocho11; Author Objet : Re: [Leaflet/Leaflet.Editable] no events for markers (#148)
Not sure what you want to do, but once you created a marker, eg using: var marker = L.marker(latLng);
You can get click events on this marker by using:
marker.on("click", function(e) { ... })
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Leaflet/Leaflet.Editable/issues/148#issuecomment-335623724, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AdaUGxHQqY-9DRhQ5zvMkd8irt91cRmGks5sq-vMgaJpZM4Pqwoh.
You can get notified when a marker is created with the 'commit' event:
map.#on('editable:drawing:commit', (evt) => {
if (evt.layer instanceof L.Marker) {
console.log('Halelujah, marker was created');
}
}