leaflet-draw-straightlines

2.0.0 • Public • Published

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 install

To compile the sources:

npm run compile

To 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;
    }
});

Readme

Keywords

none

Package Sidebar

Install

npm i leaflet-draw-straightlines

Weekly Downloads

1

Version

2.0.0

License

MIT

Last publish

Collaborators

  • rvdkooy