Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flexberry/leaflet.editable.measures
Make geometries measurable in Leaflet.
https://github.com/flexberry/leaflet.editable.measures
gis
Last synced: about 1 month ago
JSON representation
Make geometries measurable in Leaflet.
- Host: GitHub
- URL: https://github.com/flexberry/leaflet.editable.measures
- Owner: Flexberry
- License: mit
- Created: 2016-09-01T11:47:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-09T05:30:29.000Z (over 3 years ago)
- Last Synced: 2024-11-10T09:36:47.663Z (about 1 month ago)
- Topics: gis
- Language: JavaScript
- Homepage: https://flexberry.github.io/Leaflet.Editable.Measures
- Size: 326 KB
- Stars: 5
- Watchers: 14
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Leaflet-Measure-Editable
Classes for measure markers, circles, rectangles, polylines, polygon based on
* [Leaflet#1.0.1](http://leafletjs.com/reference-1.0.1.html)
* [Leaflet.Editable#master](https://github.com/Leaflet/Leaflet.Editable)## API
Leaflet-Editable-Measures is made to be fully extendable. You have three ways to customize
the behaviour: using options, listening to events, or extending.### L.Map
Leaflet-Editable-Measures add events to the `L.Map` object.
When an event occurs the called function takes a parameter that contains the following properties:
* e - original event;
* measurer - measurer , that control measured layer;
* layer - measured layer;
* layerType - type of layer.layerType can contain the following values:
* Marker
* Circle
* Rectangle
* Polyline
* Polygon#### Events
| event name | usage |
|--------------|---------------------------------------------------------------------------------------------------|
| measure:move | Fired on mouse move before creating (choose point for marker, first vertex for Circle, Rectangle, Polyline, Polygon) figure. |
| measure:create | Fired when figure is being created (add first and following vertex, drag Circle or Rectangle vertex). |
| measure:created | Fired when figure created (mouse click for Marker, click on last vertex for Polyline/Polygon, mouseUp after dragging drag Circle or Rectangle vertex). |
| measure:edit | Fired when fire varied (Marker dragging, vertex of Circle/Rectangle/Polyline/Polygon dragged or deleted ). |
| measure:editend | Fired when varied is complete (mouseUp after dragging, vertex deleting). |