https://github.com/Leaflet/Leaflet.draw
Собственно делаю фактическую копи-пасту т.е. ошибок быть не должно.
В итоге вылезает ошибка: `L.Control.Draw is not a constructor` вот мой код:
var map = L.map('map').setView([51.505, -0.09], 13);
// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// Initialise the FeatureGroup to store editable layers
var drawnItems = new L.FeatureGroup();
map.addLayer(drawnItems);
// Initialise the draw control and pass it the FeatureGroup of editable layers
var drawControl = new L.Control.Draw({
edit: {
featureGroup: drawnItems
}
});
map.addControl(drawControl);
html:
<html>
<head>
<style>
#map { height: 90vh; }
</style>
<link rel="stylesheet" href="https://npmcdn.com/leaflet@1.0.0-rc.2/dist/leaflet.css" />
<link rel="stylesheet" href="js/leaflet.draw.css" />
</head>
<body>
<div id="map"></div>
</body>
<script src="js/leaflet.js"></script>
<script src="js/mymap.js"></script>
<script src="js/leaflet.draw.js"></script>
<script src="js/leaflet.draw-src.js"></script>
</html>
Что я делаю не так?