Leaflet / Leaflet.draw

Vector drawing and editing plugin for Leaflet
https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html
MIT License
1.96k stars 992 forks source link

Usage example in documentation has syntax error #1029

Open justinjngan opened 2 years ago

justinjngan commented 2 years ago

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:

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

Using jsfiddle or another example site.