var map = L.map('map'); window.drawnItems = new L.FeatureGroup(); map.addLayer(drawnItems); var drawControl = new L.Control.Draw({ draw: { position: 'topleft', polygon: { title: 'Draw a polygon', allowIntersection: false, drawError: { color: 'red', timeout: 1000 }, shapeOptions: { color: '#333333' } }, circle: false, polyline: false, marker: false, rectangle: false }, edit: { featureGroup: drawnItems, edit: { title: 'Edit a polygon' }, remove: { title: 'Delete a polygon' } } }); map.addControl(drawControl); window.markers = new L.KML("markers.kml", {async: true}); markers.on("loaded", function(e) { map.addLayer(markers); });