Leaflet.Editable icon indicating copy to clipboard operation
Leaflet.Editable copied to clipboard

no events for markers

Open chocho11 opened this issue 7 years ago • 3 comments

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

chocho11 avatar Oct 02 '17 14:10 chocho11

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) { ... })

opoto avatar Oct 10 '17 22:10 opoto

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.

chocho11 avatar Oct 11 '17 12:10 chocho11

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');
   }
}

karlitos avatar Nov 07 '17 14:11 karlitos