leaflet.path.drag

0.0.6 • Public • Published

Path.Drag.js

Add dragging capability to Leaflet path (Polygon, Polyline, Rectangle, Circle, CircleMarker…).

Example

Installation

This library requires Leaflet version 1.0 or above

Include Path.Drag.js in your javascript files (after including Leaflet itself).

It's available via NPM:

npm install leaflet.path.drag

Usage

A dragging handler will be attached to the paths instance of your map. To enable dragging, just do:

layer.dragging.enable()

To disable:

layer.dragging.disable()

If you want a path to be draggable as soon as it's added to map, add draggable: true to its options:

const layer = L.polygon([…], {draggable: true})

Alternatives:

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.6
    3,099
    • latest

Version History

Package Sidebar

Install

npm i leaflet.path.drag

Weekly Downloads

3,123

Version

0.0.6

License

MIT

Last publish

Collaborators

  • ybon