Awesome draw plugin https://github.com/Leaflet/Leaflet.draw
A Pen by Matthew Gotth-Olsen on CodePen.
| <div id="map_id" class="maps"></div> | 
Awesome draw plugin https://github.com/Leaflet/Leaflet.draw
A Pen by Matthew Gotth-Olsen on CodePen.
| var map = L.map('map_id').setView([38.2527, -85.764771], 14); | |
| L.tileLayer('http://tile.stamen.com/toner-lite/{z}/{x}/{y}.png').addTo(map); | |
| var edLayer = L.featureGroup().addTo(map); | |
| var drawCtrl = new L.Control.Draw({ | |
| draw: { | |
| polygon: false, | |
| marker: false | |
| }, | |
| edit: { | |
| featureGroup: edLayer | |
| } | |
| }); | |
| map.addControl(drawCtrl); | |
| map.on('draw:created', function (e) { | |
| edLayer.addLayer(e.layer); | |
| }); | 
| <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> | |
| <script src="https://xguaita.github.io/mtig-js/libs/draw/leaflet.draw.js"></script> | 
| body { | |
| margin:0; | |
| padding:0; | |
| } | |
| .maps { | |
| width: 1080px; | |
| height: 768px; | |
| } | 
| <link href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" rel="stylesheet" /> | |
| <link href="https://xguaita.github.io/mtig-js/libs/draw/leaflet.draw.css" rel="stylesheet" /> |