jacobtoye/Leaflet.draw — pull request #54 by krikrou (2013-01-05 12:24:15+00:00)
Title: consistent event for shape creation

Hi,
Thanks a lot for this quality plugin ; )

This request would allow a more consistent scheme for event handling once a shape is created.

For instance, in the example file, instead of having 4 handling functions for each shape created like:
```js
var drawnItems = new L.LayerGroup();
map.on('draw:poly-created', function (e) {
drawnItems.addLayer(e.poly);
});
map.on('draw:rectangle-created', function (e) {
drawnItems.addLayer(e.rect);
});
map.on('draw:circle-created', function (e) {
drawnItems.addLayer(e.circ);
});
map.on('draw:marker-created', function (e) {
e.marker.bindPopup('A popup!');
drawnItems.addLayer(e.marker);
});
```,

you could jus use:
```js
map.on('draw:created', function (e) {
drawnItems.addLayer(e.shape);
});

```
cheers,
C.