4.1.7 • Published 4 years ago

leaflet-craft v4.1.7

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

Leaflet-Craft

DEMO: https://sagarpreet-chadha.github.io/Leaflet-Craft/example/index

npm version


npm : https://www.npmjs.com/package/leaflet-craft

Extends https://github.com/Wildhoney/Leaflet.FreeDraw made by WildHoney and adds following functionalities to it:

  1. Adds Undo-Redo feature to Polygons.
  1. Adds Delete 1 marker feature by right clicking it.

  2. Adds Delete multiple markers by drawing circle around them :)

  1. Adds Control Bar to easily change MODES - Create, Edit, Delete Polygon, Delete 1 Marker, Delete multiple Markers.
  1. Calculates AREA (in metre square) of polygon which changes dynamically on editing the polygon. Stored with key polygonArea in each polygon's leaflet object.

export const polygonArea = Symbol('freedraw/polygonArea') We use TURF Area function to calculate the area.

  1. Add Hooks:

We can subscribe to following Event listeners and can pass a callback function to be executed. Callback function can be asynchronous as well, also the return value should be TRUE to continue the event (create/edit/delete) else if your callback function returns False then that event is forfeited. This is implemented by ES6 promise.

  • Polygon created: Started
  • Polygon created: Ended
  • Polygon edit: Started
  • Polygon edit: Ended
  • Polygon delete: Started
  • Polygon delete: Ended

Work in PROGRESS:

  1. Conversion to Typescript.
  2. Adding functionality to create Polygon via clicking (similar to Leaflet.Draw).
  3. Extending React-Leaflet to support React apps.

ABOUT:

Thank you @wildhoney, @ankeetmaini and other contributors :heart: . This library is actively maintained by @sagarpreet-chadha .

4.1.7

4 years ago

4.1.6

4 years ago

4.1.5

4 years ago

4.0.5

4 years ago

4.0.4

4 years ago

4.0.3

4 years ago

4.0.1

4 years ago

4.0.2

4 years ago

4.0.0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.1.2

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago