leaflet-draw-straightlines
v2.0.0
Published
Leaflet.draw plugin that allows you to draw straight lines
Readme
Leaflet.draw.straightlines
Leaflet.draw plugin that allows you to draw straight lines
When using this plugin you can draw straight lines with Leaflet.draw by just pressing the ctrl or shift key.
install all dependencies
npm installTo compile the sources:
npm run compileTo use the plugin:
var map = L.map('map').setView([51.505, -0.09], 13);
map.initStraightLines();Alternatively specify a function to start the straightlines functionality. For example with the shift key:
var map = L.map('map').setView([51.505, -0.09], 13);
map.initStraightLines({
start: function (e) {
return e.shiftKey;
}
});