map.on(L.Draw.Event.CREATED;` function (e) {
var type = e.layerType,
layer = e.layer;
if (type === 'marker') {
// Do marker specific actions
}
// Do whatever else you need to. (save to db; add to map etc)
map.addLayer(layer);
});
The error is that the parameter L.Draw.Event.CREATED should end with a comma ',' not a semi-colon ';'
How to reproduce
Copy example from https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html under the L.Draw.Event section.
The page shows the sample code:
The error is that the parameter L.Draw.Event.CREATED should end with a comma ',' not a semi-colon ';'
Using jsfiddle or another example site.