{"_id":"@contagt/leaflet-geoman-free","name":"@contagt/leaflet-geoman-free","dist-tags":{"latest":"2.14.2"},"versions":{"2.14.2":{"name":"@contagt/leaflet-geoman-free","version":"2.14.2","description":"A Leaflet Plugin For Editing Geometry Layers in Leaflet 1.*","keywords":["leaflet","geoman","polygon management","geometry editing","map data","map overlay","polygon","geojson","leaflet-draw","data-field-geojson","ui-leaflet-draw"],"main":"dist/leaflet-geoman.min.js","types":"dist/leaflet-geoman.d.ts","dependencies":{"@turf/boolean-contains":"6.3.0","@turf/kinks":"6.3.0","@turf/line-intersect":"6.3.0","@turf/line-split":"6.3.0","lodash":"4.17.21","polygon-clipping":"0.15.3"},"devDependencies":{"@babel/core":"7.14.0","@babel/preset-env":"7.14.1","@types/leaflet":"^1.7.0","babel-loader":"8.2.2","copy-webpack-plugin":"8.1.1","css-loader":"5.2.4","cypress":"6.9.1","cypress-wait-until":"1.7.1","eslint":"7.26.0","eslint-config-airbnb-base":"14.2.1","eslint-config-prettier":"8.3.0","eslint-plugin-cypress":"2.11.3","eslint-plugin-import":"2.22.1","file-loader":"6.2.0","leaflet":"1.7.1","mini-css-extract-plugin":"1.6.0","prettier":"2.2.1","prosthetic-hand":"1.3.1","terser-webpack-plugin":"^5.1.2","url-loader":"4.1.1","webpack":"5.36.2","webpack-cli":"4.7.0"},"peerDependencies":{"leaflet":"^1.2.0"},"repository":{"type":"git","url":"git://github.com/geoman-io/leaflet-geoman.git"},"author":{"name":"Sumit Kumar","email":"sumit@geoman.io","url":"http://geoman.io/leaflet-geoman"},"license":"MIT","bugs":{"url":"https://github.com/geoman-io/leaflet-geoman/issues"},"homepage":"https://geoman.io/leaflet-geoman","prettier":{"trailingComma":"es5","tabWidth":2,"semi":true,"singleQuote":true},"gitHead":"91cfd2a8b4054ce4adcbd1c172a2ef0db54e9c8d","_id":"@contagt/leaflet-geoman-free@2.14.2","_nodeVersion":"14.19.1","_npmVersion":"8.0.0","dist":{"integrity":"sha512-fHR0NA2dnbClMZrxIPCuVekcDuISl5XGnpljFOeMGj3XytluTJbvytThTmsBnXYBpZG9slKl7tQB4n32TF1S2w==","shasum":"cd2d4bf0a5e7fab3047355d50dc746aeba155bc8","tarball":"https://registry.npmjs.org/@contagt/leaflet-geoman-free/-/leaflet-geoman-free-2.14.2.tgz","fileCount":6,"unpackedSize":412243,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDhsh1Hk5kXm9fRHxvYX1N9A+KLd2WSGRExKBA3eg/BwIhAJlxnaykf7tAT/65Kgrd/K/hsvdwsz8xE2rFCPjXwdip"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMsv0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoOWw/+NtGelW8xFLSHYM98L89uj2DfuxdD1E3z7raH3NI2SLXGVdYv\r\nAsEsLmCU/SMIgs++vV5Vf6ZKHKNUBH7A1WZ9vr/Vm8J/LsumhASVTeN1xidi\r\nA2YogOGFHad2FsydIwN2KD2gcq4iBRJ8WKuYTSQGNrG57b4iJFkk5nCJagqy\r\nIY+XgyixJxdvd8djOBQFLUP6igS7ve7W1gfE/E4nC6t+0NJz/xxL/CJrILMH\r\nCWCqO5KE+7i32vENwLneN3oFi3xcmEGaaPElUYQBdKj7YeuSES4dh2iwyvat\r\nPvhUdvgyDABV9dRlPvokPQ+Rb2jpr8ptq262WzdbwO6c5kbJDjgloZK+vCNS\r\nJAUkm/C+OWc+8naUCVvbqkn5G9Qe0A2yLcIxsIpQpBx+42h35kPe8Wuctm+1\r\nybHvWRbDBuF4NDEBG4HcTFvkLEkG+9Jo9jz6z8fU1T67aBQ3TYLy/CcTQ4ov\r\nP13TW7QGHxWAr55Vst0oUdsSlUc0i+LYsRvEa1OqhMb2go4p6VzKN3kXQfDL\r\n2VlxdF7mR4SfuYdVMyJZ4FIHQUzr/Kli9qgh7IxBUM5Zv3kCcUR4E3w2yctW\r\nOXuC15zfUyGUdMnJaYIQc8nlc+quB+LF7ZwG0uT8Pda8bUy/b1mKp88+IMJQ\r\nel+R7h0kdgktDBLJpNPI0ijB2pqoG/6PiTk=\r\n=+Cw0\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"sbrandt","email":"stephan@contagt.com"},"directories":{},"maintainers":[{"name":"sbrandt","email":"stephan@contagt.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/leaflet-geoman-free_2.14.2_1664273396051_0.02207826392862411"},"_hasShrinkwrap":false}},"time":{"created":"2022-09-27T10:09:55.976Z","2.14.2":"2022-09-27T10:09:56.260Z","modified":"2022-09-27T10:09:56.422Z"},"maintainers":[{"name":"sbrandt","email":"stephan@contagt.com"}],"description":"A Leaflet Plugin For Editing Geometry Layers in Leaflet 1.*","homepage":"https://geoman.io/leaflet-geoman","keywords":["leaflet","geoman","polygon management","geometry editing","map data","map overlay","polygon","geojson","leaflet-draw","data-field-geojson","ui-leaflet-draw"],"repository":{"type":"git","url":"git://github.com/geoman-io/leaflet-geoman.git"},"author":{"name":"Sumit Kumar","email":"sumit@geoman.io","url":"http://geoman.io/leaflet-geoman"},"bugs":{"url":"https://github.com/geoman-io/leaflet-geoman/issues"},"license":"MIT","readme":"<p align=\"center\">  \n  <a href=\"https://geoman.io/leaflet-geoman\">  \n    <img width=\"130\" alt=\"Geoman Logo\" src=\"https://file-jxzyjgqwut.now.sh/\" />  \n  </a>  \n</p>  \n<h1 align=\"center\">  \n  Leaflet-Geoman  \n</h1>  \n<p align=\"center\">  \n  <strong>Leaflet Plugin For Creating And Editing Geometry Layers</strong><br>  \n  Draw, Edit, Drag, Cut, Rotate, Split⭐, Scale⭐, Measure⭐, Snap and Pin⭐ Layers<br>  \n  Supports Markers, CircleMarkers, Polylines, Polygons, Circles, Rectangles, ImageOverlays, LayerGroups, GeoJSON, MultiLineStrings and MultiPolygons  \n</p>  \n<p align=\"center\">  \n  <a href=\"https://badge.fury.io/js/%40geoman-io%2Fleaflet-geoman-free\">  \n    <img src=\"https://badge.fury.io/js/%40geoman-io%2Fleaflet-geoman-free.svg\" alt=\"npm version\" height=\"18\">  \n  </a>  \n  <a href=\"#\">  \n    <img src=\"https://github.com/geoman-io/leaflet-geoman/workflows/Tests/badge.svg\" alt=\"\" />  \n  </a>  \n  <a href=\"https://github.com/geoman-io/leaflet-geoman\">  \n    <img src=\"http://githubbadges.com/star.svg?user=geoman-io&repo=leaflet-geoman&style=default\" alt=\"star this repo\" />  \n  </a>  \n  <a href=\"https://www.npmjs.com/package/leaflet.pm\">  \n    <img src=\"https://img.shields.io/npm/dt/leaflet.pm.svg\" alt=\"NPM Downloads\" />  \n  </a>  \n  <a href=\"https://www.npmjs.com/package/@geoman-io/leaflet-geoman-free\">  \n    <img src=\"https://img.shields.io/npm/dt/@geoman-io/leaflet-geoman-free.svg\" alt=\"NPM Downloads\" />  \n  </a>  \n</p>  \n  \n## [👉 Live Demo 👈](https://geoman.io/leaflet-geoman)  \n  \n![Demo](https://file-gmeileqfmg.now.sh/)  \n  \n### Using Leaflet-Geoman in production?  \n[Please consider sponsoring its development](https://github.com/sponsors/codeofsumit)  \n  \n#### Leaflet-Geoman Pro ⭐  \nFeatures marked with ⭐ in this documentation are available in Leaflet-Geoman Pro. [Purchase Pro](https://geoman.io/leaflet-geoman#pro) or [get in touch](mailto:sumit@geoman.io)  \n  \n## Documentation  \n  \n- [Installation](#installation)  \n- [Getting Started](#getting-started)  \n- [Draw Mode](#draw-mode)  \n- [Edit Mode](#edit-mode)  \n- [Drag Mode](#drag-mode)  \n- [Removal Mode](#removal-mode)  \n- [Cut Mode](#cut-mode)  \n- [Rotation Mode](#rotation-mode)  \n- [Split Mode ⭐](#split-mode-)\n- [Scale Mode ⭐](#scale-mode-)\n- [Options](#options)  \n  - [Snapping](#snapping)\n  - [Pinning ⭐](#pinning-)\n  - [Measurement ⭐](#measurement-)\n- [LayerGroup](#layergroup)\n- [Customization](#customize)  \n- [Toolbar](#toolbar)  \n- [Utils](#utils)  \n- [Need a feature? | Existing Feature Requests](https://github.com/geoman-io/Leaflet-Geoman/issues?q=is%3Aissue+is%3Aclosed+label%3A%22feature+request%22+sort%3Areactions-%2B1-desc)  \n  \n  \n### Installation  \n  \n#### Migrate from Leaflet.PM  \n  \n```  \nnpm uninstall leaflet.pm  \nnpm i @geoman-io/leaflet-geoman-free  \n```  \nThat's it.  \n  \n#### Install via npm  \n  \n```  \nnpm i @geoman-io/leaflet-geoman-free  \n```  \n  \n#### Install Manually  \n  \nDownload  \n[`leaflet-geoman.css`](https://unpkg.com/@geoman-io/leaflet-geoman-free@latest/dist/leaflet-geoman.css) and  \n[`leaflet-geoman.min.js`](https://unpkg.com/@geoman-io/leaflet-geoman-free@latest/dist/leaflet-geoman.min.js)  \nand include them in your project.  \n  \n#### Include via CDN  \n  \nCSS  \n  \n<!-- prettier-ignore -->  \n```html  \n  \n<link rel=\"stylesheet\" href=\"https://unpkg.com/@geoman-io/leaflet-geoman-free@latest/dist/leaflet-geoman.css\" />  \n```  \n  \nJS  \n  \n```html  \n<script src=\"https://unpkg.com/@geoman-io/leaflet-geoman-free@latest/dist/leaflet-geoman.min.js\"></script>  \n```  \n  \n#### Include as ES6 Module  \n  \n```js  \nimport '@geoman-io/leaflet-geoman-free';  \nimport '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css';  \n```  \n  \n### Getting Started  \n  \n#### Init Leaflet-Geoman  \n  \nJust include `leaflet-geoman.min.js` right after Leaflet. It initializes itself. If  \nyou want certain layers to be ignored by Leaflet-Geoman, pass `pmIgnore: true` to  \ntheir options when creating them. Example:  \n  \n```js  \nL.marker([51.50915, -0.096112], { pmIgnore: true }).addTo(map);  \n```  \n  \nEnable Leaflet-Geoman on an ignored layer:  \n```js  \nlayer.setStyle({pmIgnore: false});\n// layer.options.pmIgnore = false; // If the layer is a LayerGroup / FeatureGroup / GeoJSON this line is needed too\nL.PM.reInitLayer(layer);  \n```  \nIf `Opt-In` (look below) is `true`, a layers `pmIgnore` property has to be set to `false` to get initiated.\n\n#### Opt-In\n\nIf you want to use Leaflet-Geoman as opt-in, call the following function right after importing:\n\n```js\nL.PM.setOptIn(true);\n```\n\nAnd to disable it:\n\n```js\nL.PM.setOptIn(false);\n```\n\nIf you have enabled opt-in before you init the map, you need to specify `pmIgnore: false` in the map options:\n\n```js\nconst map = L.map('map', { pmIgnore: false });\n```\n\nAll layers will be ignored by Leaflet-Geoman, unless you specify `pmIgnore: false` on a layer:\n\n```js\nL.marker([51.50915, -0.096112], { pmIgnore: false }).addTo(map);\n```\n\nNewly drawn layers will be ignored as well.\n\nTo prevent this you can add the following event handler:\n\n```js\nmap.on('pm:create', (e) => {\n  e.layer.setStyle({ pmIgnore: false });\n  L.PM.reInitLayer(e.layer);\n});\n```\n\n#### Leaflet-Geoman Toolbar\n\n<img align=\"left\" height=\"200\" src=\"https://file-ffrjxxowri.now.sh/\" alt=\"Leaflet-Geoman Toolbar\">  \n  \nYou can add a toolbar to the map to use Leaflet-Geoman features via a user interface.  \n  \n```js  \n// add Leaflet-Geoman controls with some options to the map  \nmap.pm.addControls({  \n  position: 'topleft',  \n  drawCircle: false,  \n});  \n```  \nThe following methods are available on `map.pm`:  \n  \n| Method                        | Returns   | Description                                                                                     |  \n| :---------------------------- | :-------- | :---------------------------------------------------------------------------------------------- |  \n| addControls(`options`)        | -         | Adds the Toolbar to the map. The `options` are optional.                                        |  \n| removeControls()              | -         | Removes the Toolbar from the map.                                                               |  \n| toggleControls()              | -         | Toggle the visiblity of the Toolbar.                                                            |  \n| controlsVisible()             | `Boolean` | Returns `true` if the Toolbar is visible on the map.                                            |\n  \n  \nSee the available options in the table below.  \n  \n| Option             | Default     | Description                                                                                      |  \n| :----------------- | :---------- | :----------------------------------------------------------------------------------------------- |  \n| position           | `'topleft'` | Toolbar position, possible values are `'topleft'`, `'topright'`, `'bottomleft'`, `'bottomright'` |  \n| positions           | `Object`   | The position of each block (`draw`, `edit`, `custom`, `options`⭐)  can be customized. If not set, the value from `position` is taken. Default: `{draw: '', edit: '', options: '', custom: ''}` [Block Position](#toolbar-block-position) | \n| drawMarker         | `true`      | Adds button to draw Markers.                                                                     |  \n| drawCircleMarker   | `true`      | Adds button to draw CircleMarkers.                                                               |  \n| drawPolyline       | `true`      | Adds button to draw Line.                                                                        |  \n| drawRectangle      | `true`      | Adds button to draw Rectangle.                                                                   |  \n| drawPolygon        | `true`      | Adds button to draw Polygon.                                                                     |  \n| drawCircle         | `true`      | Adds button to draw Circle.                                                                      |  \n| editMode           | `true`      | Adds button to toggle Edit Mode for all layers.                                                  |  \n| dragMode           | `true`      | Adds button to toggle Drag Mode for all layers.                                                  |  \n| cutPolygon         | `true`      | Adds button to cut a hole in a Polygon or Line.                                                  |  \n| removalMode        | `true`      | Adds a button to remove layers.                                                                  | \n| rotateMode         | `true`      | Adds a button to rotate layers.                                                                  | \n| oneBlock           | `false`     | All buttons will be displayed as one block [Customize Controls](#customize-controls).            |\n| drawControls       | `true`      | Shows all draw buttons / buttons in the `draw` block.                                            |\n| editControls       | `true`      | Shows all edit buttons / buttons in the `edit` block.                                            |\n| customControls     | `true`      | Shows all buttons in the `custom` block.                                                         |\n| optionsControls    | `true`      | Shows all options buttons / buttons in the `option` block ⭐.                                     |\n| pinningOption      | `true`      | Adds a button to toggle the Pinning Option ⭐.                                                    |  \n| snappingOption     | `true`      | Adds a button to toggle the Snapping Option ⭐.                                                   |  \n| splitMode          | `true`      | Adds a button to toggle the Split Mode for all layers ⭐.                                         |  \n| scaleMode          | `true`      | Adds a button to toggle the Scale Mode for all layers ⭐.                                         |  \n  \nTo pass options to the buttons you have two ways:\n```js\n// make polygon not snappable during draw  \nmap.pm.enableDraw('Polygon',{ snappable: false }); \nmap.pm.disableDraw();\n```\n```js\n// make all layers not snappable during draw  \nmap.pm.setGlobalOptions({ snappable: false }); \n```\nThe options will persist, even when the mode is enabled/disabled via the toolbar.  \n  \nAll available options for drawing and editing are specified in the sections below.\n\n### Draw Mode\n\nUse Draw Mode on a map like this:\n\n```js\n// enable polygon Draw Mode\nmap.pm.enableDraw('Polygon', {\n  snappable: true,\n  snapDistance: 20,\n});\n\n// disable Draw Mode\nmap.pm.disableDraw();\n```\n\nCurrently available shapes are `Marker`, `CircleMarker`, `Circle`, `Line`, `Rectangle`, `Polygon` and `Cut`.\n\nThe following methods are available on `map.pm`:\n\n| Method                                       | Returns   | Description                                                                                                                                                                                                              |\n| :------------------------------------------- | :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| enableDraw(`shape`,`options`)                | -         | Enable Draw Mode with the passed shape. The `options` are optional.                                                                                                                                                      |\n| disableDraw()                                | -         | Disable Draw Mode.                                                                                                                                                                                                       |\n| Draw.getShapes()                             | `Array`   | Array of available shapes.                                                                                                                                                                                               |\n| Draw.getActiveShape()                        | `String`  | Returns the active shape.                                                                                                                                                                                                |\n| globalDrawModeEnabled()                      | `Boolean` | Returns `true` if global Draw Mode is enabled. `false` when disabled.                                                                                                                                                    |\n| setPathOptions(`options`, `optionsModifier`) | -         | Customize the style of the drawn layer. Only for L.Path layers. Shapes can be excluded with a `ignoreShapes` array or merged with the current style with `merge: true` in `optionsModifier` [Details](#customize-style). |\n| setGlobalOptions(`options`)                  | -         | Set `globalOptions` and apply them.                                                                                                                                                                                      |\n| applyGlobalOptions()                         | -         | Apply the current `globalOptions` to all existing layers.                                                                                                                                                                |\n| getGlobalOptions()                           | `Object`  | Returns the `globalOptions`.                                                                                                                                                                                             |\n| getGeomanLayers(`Boolean`)                   | `Array`   | Returns all Leaflet-Geoman layers on the map as array. Pass `true` to get a L.FeatureGroup.                                                                                                                              |\n| getGeomanDrawLayers(`Boolean`)               | `Array`   | Returns all drawn Leaflet-Geoman layers on the map as array. Pass `true` to get a L.FeatureGroup.                                                                                                                        |\n\nSee the available options in the table below.\n\n| Option                | Default                               | Description                                                                                                                                                                                                     |\n| :-------------------- | :------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| snappable             | `true`                                | Enable snapping to other layers vertices for precision drawing. Can be disabled by holding the `ALT` key.                                                                                                       |\n| snapDistance          | `20`                                  | The distance to another vertex when a snap should happen.                                                                                                                                                       |\n| snapMiddle            | `false`                               | Allow snapping in the middle of two vertices (middleMarker).                                                                                                                                                    |\n| snapSegment           | `true`                                | Allow snapping between two vertices.                                                                                                                                                                            |\n| requireSnapToFinish   | `false`                               | Require the last point of a shape to be snapped.                                                                                                                                                                |\n| tooltips              | `true`                                | Show helpful tooltips for your user.                                                                                                                                                                            |\n| allowSelfIntersection | `true`                                | Allow self intersections.                                                                                                                                                                                       |\n| templineStyle         | `{ color: 'red' },`                   | [Leaflet path options](https://leafletjs.com/reference-1.7.1.html#path) for the lines between drawn vertices/markers.                                                                                           |\n| hintlineStyle         | `{ color: 'red', dashArray: [5, 5] }` | [Leaflet path options](https://leafletjs.com/reference-1.7.1.html#path) for the helper line between last drawn vertex and the cursor.                                                                           |\n| pathOptions           | `null`                                | [Leaflet path options](https://leafletjs.com/reference-1.7.1.html#path) for the drawn layer (Only for L.Path layers).                                                                                           |\n| markerStyle           | `{ draggable: true }`                 | [Leaflet marker options](https://leafletjs.com/reference-1.7.1.html#marker-icon) (only for drawing markers).                                                                                                    |\n| cursorMarker          | `true`                                | Show a marker at the cursor.                                                                                                                                                                                    |\n| finishOn              | `null`                                | Leaflet layer event to finish the drawn shape, like `'dblclick'`. [Here's a list](http://leafletjs.com/reference-1.7.1.html#interactive-layer-click). `snap` is also an option for Line, Polygon and Rectangle. |\n| hideMiddleMarkers     | `false`                               | Hide the middle Markers in Edit Mode from Polyline and Polygon.                                                                                                                                                 |\n| minRadiusCircle       | `null`                                | Set the min radius of a `Circle`.                                                                                                                                                                               |\n| maxRadiusCircle       | `null`                                | Set the max radius of a `Circle`.                                                                                                                                                                               |\n| minRadiusCircleMarker | `null`                                | Set the min radius of a `CircleMarker` when editable is active.                                                                                                                                                 |\n| maxRadiusCircleMarker | `null`                                | Set the max radius of a `CircleMarker` when editable is active.                                                                                                                                                 |\n| editable              | `false`                               | Makes a `CircleMarker` editable like a `Circle`.                                                                                                                                                                |\n| markerEditable        | `true`                                | Markers and CircleMarkers are editable during the draw-session (you can drag them around immediately after drawing them).                                                                                       |\n| continueDrawing       | `false` / `true`                      | Draw Mode stays enabled after finishing a layer to immediately draw the next layer. Defaults to `true` for Markers and CircleMarkers and `false` for all other layers.                                          |\n| rectangleAngle        | `0`                                   | Rectangle can drawn with a rotation angle 0-360 degrees                                                                                                                                                         |\n| layersToCut           | `[]`                                  | Cut-Mode: Only the passed layers can be cut. Cutted layers are removed from the Array until no layers are left anymore and cutting is working on all layers again.                                              |\n\nThis options can only set over `map.pm.setGlobalOptions({})`:\n\n| Option     | Default | Description                                                |\n| :--------- | :------ | :--------------------------------------------------------- |\n| layerGroup | `map`   | Add the created layers to a layergroup instead to the map. |\n\nYou can listen to map events to hook into the drawing procedure like this:\n\n```js\nmap.on('pm:drawstart', (e) => {\n  console.log(e);\n});\n```\n\nHere's a list of map events you can listen to:\n\n| Event                    | Params | Description                                                                             | Output                    |\n| :----------------------- | :----- | :-------------------------------------------------------------------------------------- | :------------------------ |\n| pm:globaldrawmodetoggled | `e`    | Fired when Drawing Mode is toggled.                                                     | `enabled`, `shape`, `map` |\n| pm:drawstart             | `e`    | Called when Draw Mode is enabled. Payload includes the shape type and working layer.    | `shape`, `workingLayer`   |\n| pm:drawend               | `e`    | Called when Draw Mode is disabled. Payload includes the shape type.                     | `shape`                   |\n| pm:create                | `e`    | Called when a shape is drawn/finished. Payload includes shape type and the drawn layer. | `shape`, `layer`          |\n\nThere are also several events for layers during draw. Register an event like this:\n\n```js\n// listen to vertexes being added to currently drawn layer (called workingLayer)\nmap.on('pm:drawstart', ({ workingLayer }) => {\n  workingLayer.on('pm:vertexadded', (e) => {\n    console.log(e);\n  });\n});\n```\n\nHere's a list of layer events you can listen to:\n\n| Event           | Params | Description                                                                                                           | Output                                                                                                  |\n| :-------------- | :----- | :-------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------ |\n| pm:vertexadded  | `e`    | Called when a new vertex is added. Payload includes the new vertex, it's marker, index, working layer and shape type. | `shape`, `workingLayer`, `marker`, `latlng`                                                             |\n| pm:snapdrag     | `e`    | Fired during a marker move/drag. Payload includes info about involved layers and snapping calculation.                | `shape`, `distance`, `layer` = `workingLayer`, `marker`, `layerInteractedWith`, `segment`, `snapLatLng` |\n| pm:snap         | `e`    | Fired when a vertex is snapped. Payload is the same as in `snapdrag`.                                                 | `shape`, `distance`, `layer` = `workingLayer`, `marker`, `layerInteractedWith`, `segment`, `snapLatLng` |\n| pm:unsnap       | `e`    | Fired when a vertex is unsnapped. Payload is the same as in `snapdrag`.                                               | `shape`, `distance`, `layer` = `workingLayer`, `marker`, `layerInteractedWith`, `segment`, `snapLatLng` |\n| pm:centerplaced | `e`    | Called when the center of a circle is placed/moved.                                                                   | `shape`, `workingLayer`, `latlng`                                                                       |\n\nFor making the snapping to other layers selective, you can add the \"snapIgnore\" option to your layers to disable the snapping to them during drawing.\n\n```js\n//This layer will be ignored by the snapping engine during drawing\nL.geoJSON(data, {\n  snapIgnore: true,\n});\n```\n\n### Edit Mode\n\nYou can enable Edit Mode for all layers on a map like this:\n\n```js\n// enable global Edit Mode\nmap.pm.enableGlobalEditMode(options);\n```\n\nThe following methods are available on `map.pm`:\n\n| Method                          | Returns   | Description                                                           |\n| :------------------------------ | :-------- | :-------------------------------------------------------------------- |\n| enableGlobalEditMode(`options`) | -         | Enables global Edit Mode.                                             |\n| disableGlobalEditMode()         | -         | Disables global Edit Mode.                                            |\n| toggleGlobalEditMode(`options`) | -         | Toggles global Edit Mode.                                             |\n| globalEditModeEnabled()         | `Boolean` | Returns `true` if global Edit Mode is enabled. `false` when disabled. |\n\nEnable Edit Mode only for one layer:\n\n```js\n// enable Edit Mode\nlayer.pm.enable({\n  allowSelfIntersection: false,\n});\n```\n\nThe following methods are available for layers under `layer.pm`:\n\n| Method                | Returns   | Description                                                                                                                |\n| :-------------------- | :-------- | :------------------------------------------------------------------------------------------------------------------------- |\n| enable(`options`)     | -         | Enables Edit Mode. The passed options are preserved, even when the mode is enabled via the Toolbar. `options` is optional. |\n| disable()             | -         | Disables Edit Mode.                                                                                                        |\n| toggleEdit(`options`) | -         | Toggles Edit Mode. Passed options are preserved. `options` is optional.                                                    |\n| enabled()             | `Boolean` | Returns `true` if Edit Mode is enabled. `false` when disabled.                                                             |\n| hasSelfIntersection() | `Boolean` | Returns `true` if `Line` or `Polygon` has a self intersection.                                                             |\n| remove()              | -         | Removes the layer with the same checks as GlobalRemovalMode.                                                               |\n| getShape()            | `String`  | Returns the shape of the layer.                                                                                            |\n| setOptions(`options`) | -         | Set the options on the layer.                                                                                              |\n| getOptions()          | `Object`  | Returns the options of the layer.                                                                                          |\n\nSee the available options in the table below.\n\n| Option                         | Default       | Description                                                                                                                                                                                                                   |\n| :----------------------------- | :------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| snappable                      | `true`        | Enable snapping to other layers vertices for precision drawing. Can be disabled by holding the `ALT` key.                                                                                                                     |\n| snapDistance                   | `20`          | The distance to another vertex when a snap should happen.                                                                                                                                                                     |\n| allowSelfIntersection          | `true`        | Allow/Disallow self-intersections on Polygons and Polylines.                                                                                                                                                                  |\n| allowSelfIntersectionEdit      | `false`       | Allow/Disallow to change vertices they are connected to a intersecting line. Only working if allowSelfIntersection is `true` and the layer is already self-intersecting while enabling Edit Mode.                             |\n| preventMarkerRemoval           | `false`       | Disable the removal of markers/vertexes via right click.                                                                                                                                                                      |\n| removeLayerBelowMinVertexCount | `true`        | If `true`, vertex removal that cause a layer to fall below their minimum required vertices will remove the entire layer. If `false`, these vertices can't be removed. Minimum vertices are 2 for Lines and 3 for Polygons.    |\n| syncLayersOnDrag               | `false`       | Defines which layers should dragged with this layer together. `true` syncs all layers in the same LayerGroup(s) or you pass an `Array` of layers to sync.                                                                     |\n| allowEditing                   | `true`        | Edit-Mode for the layer can disabled (`pm.enable()`).                                                                                                                                                                         |\n| allowRemoval                   | `true`        | Removing can be disabled for the layer.                                                                                                                                                                                       |\n| allowCutting                   | `true`        | Layer can be prevented from cutting.                                                                                                                                                                                          |\n| allowRotation                  | `true`        | Layer can be prevented from rotation.                                                                                                                                                                                         |\n| draggable                      | `true`        | Dragging can be disabled for the layer.                                                                                                                                                                                       |\n| addVertexOn                    | `click`       | Leaflet layer event to add a vertex to a Line or Polygon, like `'dblclick'`. [Here's a list](http://leafletjs.com/reference-1.7.1.html#interactive-layer-click).                                                              |\n| addVertexValidation            | `undefined`   | A function for validation if a vertex (of a Line / Polygon) is allowed to add. It passes a object with `[layer, marker, event}`. For example to check if the layer has a certain property or if the `Ctrl` key is pressed.    |\n| removeVertexOn                 | `contextmenu` | Leaflet layer event to remove a vertex from a Line or Polygon, like `'dblclick'`. [Here's a list](http://leafletjs.com/reference-1.7.1.html#interactive-layer-click).                                                         |\n| removeVertexValidation         | `undefined`   | A function for validation if a vertex (of a Line / Polygon) is allowed to remove. It passes a object with `[layer, marker, event}`. For example to check if the layer has a certain property or if the `Ctrl` key is pressed. |\n| moveVertexValidation           | `undefined`   | A function for validation if a vertex / helper-marker is allowed to move / drag. It passes a object with `[layer, marker, event}`. For example to check if the layer has a certain property or if the `Ctrl` key is pressed.  |\n| limitMarkersToCount            | `-1`          | Shows only `n` markers closest to the cursor. Use `-1` for no limit.                                                                                                                                                          |\n| limitMarkersToZoom             | `-1`          | Shows markers when under the given zoom level. ⭐                                                                                                                                                                             |\n| limitMarkersToViewport         | `false`       | Shows only markers in the viewport. ⭐                                                                                                                                                                                        |\n| limitMarkersToClick            | `false`       | Shows markers only after the layer was clicked. ⭐                                                                                                                                                                            |\n| pinning                        | `false`       | Pin shared vertices/markers together during edit [Details](#pinning-⭐). ⭐                                                                                                                                                   |\n| centerScaling                  | `true`        | Scale origin is the center, else it is the opposite corner. If `false` Alt-Key can be used. [Scale Mode](#scale-mode-). ⭐                                                                                                    |\n| uniformScaling                 | `true`        | Width and height are scaled with the same ratio. If `false` Shift-Key can be used. [Scale Mode](#scale-mode-). ⭐                                                                                                             |\n\nYou can listen to events related to editing on events like this:\n\n```js\n// listen to when a layer is changed in Edit Mode\nlayer.on('pm:edit', (e) => {\n  console.log(e);\n});\n```\n\nThe following events are available on a layer instance:\n\n| Event              | Params | Description                                                                                            | Output                                                                                                  |\n| :----------------- | :----- | :----------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------ |\n| pm:edit            | `e`    | Fired when a layer is edited.                                                                          | `layer`, `shape`                                                                                        |\n| pm:update          | `e`    | Fired when Edit Mode is disabled and a layer is edited and its coordinates have changed.               | `layer`, `shape`                                                                                        |\n| pm:enable          | `e`    | Fired when Edit Mode on a layer is enabled.                                                            | `layer`, `shape`                                                                                        |\n| pm:disable         | `e`    | Fired when Edit Mode on a layer is disabled.                                                           | `layer`, `shape`                                                                                        |\n| pm:vertexadded     | `e`    | Fired when a vertex is added.                                                                          | `layer`, `indexPath`, `latlng`, `marker`, `shape`                                                       |\n| pm:vertexremoved   | `e`    | Fired when a vertex is removed.                                                                        | `layer`, `indexPath`, `marker`, `shape`                                                                 |\n| pm:vertexclick     | `e`    | Fired when a vertex is clicked.                                                                        | `layer`, `indexPath`, `markerEvent`, `shape`                                                            |\n| pm:markerdragstart | `e`    | Fired when dragging of a marker which corresponds to a vertex starts.                                  | `layer`, `indexPath`, `markerEvent`, `shape`                                                            |\n| pm:markerdrag      | `e`    | Fired when dragging a vertex-marker.                                                                   | `layer`, `indexPath`, `markerEvent`, `shape`                                                            |\n| pm:markerdragend   | `e`    | Fired when dragging of a vertex-marker ends.                                                           | `layer`, `indexPath`, `markerEvent`, `shape`, `intersectionReset`                                       |\n| pm:layerreset      | `e`    | Fired when coords of a layer are reset. E.g. by self-intersection.                                     | `layer`, `indexPath`, `markerEvent`, `shape`                                                            |\n| pm:snapdrag        | `e`    | Fired during a marker move/drag. Payload includes info about involved layers and snapping calculation. | `shape`, `distance`, `layer` = `workingLayer`, `marker`, `layerInteractedWith`, `segment`, `snapLatLng` |\n| pm:snap            | `e`    | Fired when a vertex-marker is snapped to another vertex. Also fired on the marker itself.              | `shape`, `distance`, `layer` = `workingLayer`, `marker`, `layerInteractedWith`, `segment`, `snapLatLng` |\n| pm:unsnap          | `e`    | Fired when a vertex-marker is unsnapped from a vertex. Also fired on the marker itself.                | `shape`, `distance`, `layer` = `workingLayer`, `marker`, `layerInteractedWith`, `segment`, `snapLatLng` |\n| pm:intersect       | `e`    | When `allowSelfIntersection: false`, this event is fired as soon as a self-intersection is detected.   | `layer`, `intersection`, `shape`                                                                        |\n| pm:centerplaced    | `e`    | Fired when the center of a circle is moved.                                                            | `layer`, `latlng`, `shape`                                                                              |\n\nThe following events are available on a map instance:\n\n| Event                    | Params | Description                      | Output           |\n| :----------------------- | :----- | :------------------------------- | :--------------- |\n| pm:globaleditmodetoggled | `e`    | Fired when Edit Mode is toggled. | `enabled`, `map` |\n\nYou can also listen to specific Edit Mode events on the map instance like this:\n\n```js\nmap.on('pm:globaleditmodetoggled', (e) => {\n  console.log(e);\n});\n```\n\n### Drag Mode\n\nYou can enable Drag Mode for all layers on a map like this:\n\n```js\n// enable Drag Mode like this:\nmap.pm.enableGlobalDragMode();\n```\n\nOr you enable dragging for a specific layer:\n\n```js\nlayer.pm.enableLayerDrag();\n```\n\nThe following methods are available on `layer.pm`:\n\n| Method             | Returns   | Description                                    |\n| :----------------- | :-------- | :--------------------------------------------- |\n| enableLayerDrag()  | -         | Enables dragging for the layer.                |\n| disableLayerDrag() | -         | Disables dragging for the layer.               |\n| layerDragEnabled() | `Boolean` | Returns if Drag Mode is enabled for the layer. |\n| dragging()         | `Boolean` | Returns if the layer is currently dragging.    |\n\nThe following methods are available on `map.pm`:\n\n| Method                  | Returns   | Description                                                           |\n| :---------------------- | :-------- | :-------------------------------------------------------------------- |\n| enableGlobalDragMode()  | -         | Enables global Drag Mode.                                             |\n| disableGlobalDragMode() | -         | Disables global Drag Mode.                                            |\n| toggleGlobalDragMode()  | -         | Toggles global Drag Mode.                                             |\n| globalDragModeEnabled() | `Boolean` | Returns `true` if global Drag Mode is enabled. `false` when disabled. |\n\nThe following events are available on a layer instance:\n\n| Event        | Params | Description                              | Output                                                                    |\n| :----------- | :----- | :--------------------------------------- | :------------------------------------------------------------------------ |\n| pm:dragstart | `e`    | Fired when a layer starts being dragged. | `layer`, `shape`                                                          |\n| pm:drag      | `e`    | Fired when a layer is dragged.           | `layer`, `containerPoint`,`latlng`, `layerPoint`,`originalEvent`, `shape` |\n| pm:dragend   | `e`    | Fired when a layer stops being dragged.  | `layer`, `shape`                                                          |\n\nThe following events are available on a map instance:\n\n| Event                    | Params | Description                      | Output           |\n| :----------------------- | :----- | :------------------------------- | :--------------- |\n| pm:globaldragmodetoggled | `e`    | Fired when Drag Mode is toggled. | `enabled`, `map` |\n\nYou can also listen to specific Drag Mode events on the map instance like this:\n\n```js\nmap.on('pm:globaldragmodetoggled', (e) => {\n  console.log(e);\n});\n```\n\n### Removal Mode\n\nYou can enable Removal Mode for all layers on a map like this:\n\n```js\n// enable removal mode like this:\nmap.pm.enableGlobalRemovalMode();\n```\n\nThe following methods are available on `map.pm`:\n\n| Method                     | Returns   | Description                                                              |\n| :------------------------- | :-------- | :----------------------------------------------------------------------- |\n| enableGlobalRemovalMode()  | -         | Enables global removal mode.                                             |\n| disableGlobalRemovalMode() | -         | Disables global removal mode.                                            |\n| toggleGlobalRemovalMode()  | -         | Toggles global removal mode.                                             |\n| globalRemovalModeEnabled() | `Boolean` | Returns `true` if global removal mode is enabled. `false` when disabled. |\n\nThe following events are available on a layer instance:\n\n| Event     | Params | Description                                    | Output           |\n| :-------- | :----- | :--------------------------------------------- | :--------------- |\n| pm:remove | `e`    | Fired when a layer is removed via Removal Mode | `layer`, `shape` |\n\nThe following events are available on a map instance:\n\n| Event                       | Params | Description                                              | Output           |\n| :-------------------------- | :----- | :------------------------------------------------------- | :--------------- |\n| pm:globalremovalmodetoggled | `e`    | Fired when Removal Mode is toggled                       | `enabled`, `map` |\n| pm:remove                   | `e`    | Fired when a layer is removed via Removal Mode           | `layer`, `shape` |\n| layerremove                 | `e`    | Standard Leaflet event. Fired when any layer is removed. | `layer`          |\n\nYou can also listen to specific removal mode events on the map instance like this:\n\n```js\nmap.on('pm:globalremovalmodetoggled', (e) => {\n  console.log(e);\n});\n```\n\n### Cut Mode\n\n![cut polygon](https://file-xdeoyklwhw.now.sh/)\n\nEnables drawing for the shape \"Cut\" to draw a polygon that gets subtracted from all underlying polygons. This way you can create holes, cut polygons or polylines in half or remove parts of it.\n\nImportant: the cutted layer will be replaced, not updated. Listen to the `pm:cut` event to update your layer references in your code. The `pm:cut` event will provide you with the original layer and returns the resulting layer(s) that is/are added to the map as a Polygon / MultiPolygon or Polyline / MultiPolyline.\n\n```js\n// enable cutting mode\nmap.pm.enableGlobalCutMode({\n  allowSelfIntersection: false,\n});\n```\n\nAvailable options are the same as in [Draw Mode](#draw-mode).\nIf the option `layersToCut: [layer1, layer2]` is passed, only this certain layers will be cutted.\n\nThe following methods are available on `map.pm`:\n\n| Method                         | Returns   | Description                                                          |\n| :----------------------------- | :-------- | :------------------------------------------------------------------- |\n| enableGlobalCutMode(`options`) | -         | Enable Cut Mode.                                                     |\n| disableGlobalCutMode()         | -         | Disable Cut Mode.                                                    |\n| toggleGlobalCutMode(`options`) | -         | Toggle Cut Mode.                                                     |\n| globalCutModeEnabled()         | `Boolean` | Returns `true` if global cut mode is enabled. `false` when disabled. |\n\nThe following events are available on a layer instance:\n\n| Event   | Params | Description                         | Output                            |\n| :------ | :----- | :---------------------------------- | :-------------------------------- |\n| pm:cut  | `e`    | Fired when the layer being cut.     | `shape`, `layer`, `originalLayer` |\n| pm:edit | `e`    | Fired when a layer is edited / cut. | `layer`, `shape`                  |\n\nThe following events are available on a map instance:\n\n| Event                   | Params | Description                        | Output                            |\n| :---------------------- | :----- | :--------------------------------- | :-------------------------------- |\n| pm:globalcutmodetoggled | `e`    | Fired when Cut Mode is toggled.    | `enabled`, `map`                  |\n| pm:cut                  | `e`    | Fired when any layer is being cut. | `shape`, `layer`, `originalLayer` |\n\n### Rotation Mode\n\n![Rotation Feature](https://user-images.githubusercontent.com/2399810/118522132-06817400-b73c-11eb-8d59-1f340bca86a6.gif)\n\nThe rotation is clockwise. It starts in the North with 0° and goes over East (90°) and South (180°) to West (270°).\nThe rotation center is the center (`layer.getCenter()`) of a Polygon with the LatLngs of the layer.\n\nYou can enable Rotate Mode for all layers on a map like this:\n\n```js\nmap.pm.enableGlobalRotateMode();\n```\n\nThe following methods are available on `map.pm`:\n\n| Method                    | Returns   | Description                                                             |\n| :------------------------ | :-------- | :---------------------------------------------------------------------- |\n| enableGlobalRotateMode()  | -         | Enables global Rotate Mode.                                             |\n| disableGlobalRotateMode() | -         | Disables global Rotate Mode.                                            |\n| toggleGlobalRotateMode()  | -         | Toggles global Rotate Mode.                                             |\n| globalRotateModeEnabled() | `Boolean` | Returns `true` if global Rotate Mode is enabled. `false` when disabled. |\n\nThe following methods are available for layers under `layer.pm`:\n\n| Method                        | Returns   | Description                                      |\n| :---------------------------- | :-------- | :----------------------------------------------- |\n| enableRotate()                | -         | Enables Rotate Mode on the layer.                |\n| disableRotate()               | -         | Disables Rotate Mode on the layer.               |\n| rotateEnabled()               | `Boolean` | Returns if Rotate Mode is enabled for the layer. |\n| rotateLayer(`degrees`)        | -         | Rotates the layer by `x` degrees.                |\n| rotateLayerToAngle(`degrees`) | -         | Rotates the layer to `x` degrees.                |\n| getAngle()                    | `Degrees` | Returns the angle of the layer in degrees.       |\n\nThe following events are available on a layer instance:\n\n| Event            | Params | Description                                  | Output                                                                               |\n| :--------------- | :----- | :------------------------------------------- | :----------------------------------------------------------------------------------- |\n| pm:rotateenable  | `e`    | Fired when rotation is enabled for a layer.  | `layer`, `helpLayer`                                                                 |\n| pm:rotatedisable | `e`    | Fired when rotation is disabled for a layer. | `layer`                                                                              |\n| pm:rotatestart   | `e`    | Fired when rotation starts on a layer.       | `layer`, `helpLayer`, `startAngle`, `originLatLngs`                                  |\n| pm:rotate        | `e`    | Fired when a layer is rotated.               | `layer`, `helpLayer`, `startAngle`, `angle`, `angleDiff`, `oldLatLngs`, `newLatLngs` |\n| pm:rotateend     | `e`    | Fired when rotation ends on a layer.         | `layer`, `helpLayer`, `startAngle`, `angle`, `originLatLngs`, `newLatLngs`           |\n\nThe following events are available on a map instance:\n\n| Event                      | Params | Description                                  | Output                                                                               |\n| :------------------------- | :----- | :------------------------------------------- | :----------------------------------------------------------------------------------- |\n| pm:globalrotatemodetoggled | `e`    | Fired when Rotate Mode is toggled.           | `enabled`, `map`                                                                     |\n| pm:rotateenable            | `e`    | Fired when rotation is enabled for a layer.  | `layer`, `helpLayer`                                                                 |\n| pm:rotatedisable           | `e`    | Fired when rotation is disabled for a layer. | `layer`                                                                              |\n| pm:rotatestart             | `e`    | Fired when rotation starts on a layer.       | `layer`, `helpLayer`, `startAngle`, `originLatLngs`                                  |\n| pm:rotate                  | `e`    | Fired when a layer is rotated.               | `layer`, `helpLayer`, `startAngle`, `angle`, `angleDiff`, `oldLatLngs`, `newLatLngs` |\n| pm:rotateend               | `e`    | Fired when rotation ends on a layer.         | `layer`, `helpLayer`, `startAngle`, `angle`, `originLatLngs`, `newLatLngs`           |\n\n### Split Mode ⭐\n\n![Split Mode Demo](https://user-images.githubusercontent.com/2399810/118527306-721a1000-b741-11eb-86ce-da6caeba8214.gif)\n\nEnable drawing for the shape \"Split\" to draw a line that splits all underlying Polygons and Polylines.\n\nImportant: the splitted layer will be replaced, not updated. Listen to the `pm:split` event to update your layer references in your code. The `pm:split` event will provide you with the original layer and returns the resulting layer(s) that is/are added to the map as a Polygon / MultiPolygon or Polyline / MultiPolyline.\n\n```js\n// enable cutting mode\nmap.pm.enableGlobalSplitMode({\n  allowSelfIntersection: false,\n});\n```\n\nAvailable options are the same as in [Draw Mode](#draw-mode) and in table below:\n\n| Option                | Default | Description                                                                                                                                                                    |\n| :-------------------- | :------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| splitOnlyMarkedLayers | `false` | If it is set to `false` layers can be excluded with the option `splitMark: false`. Set it to `true` to enable splitting only for the layers with the option `splitMark: true`. |\n\nThe following methods are available on `map.pm`:\n\n| Method                           | Returns   | Description                                                            |\n| :------------------------------- | :-------- | :--------------------------------------------------------------------- |\n| enableGlobalSplitMode(`options`) | -         | Enable Split Mode.                                                     |\n| disableGlobalSplitMode()         | -         | Disable Split Mode.                                                    |\n| toggleGlobalSplitMode(`options`) | -         | Toggle Split Mode.                                                     |\n| globalSplitModeEnabled()         | `Boolean` | Returns `true` if global Split Mode is enabled. `false` when disabled. |\n\nThe following events are available on a layer instance:\n\n| Event    | Params | Description                                                                                         | Output                                           |\n| :------- | :----- | :-------------------------------------------------------------------------------------------------- | :----------------------------------------------- |\n| pm:split | `e`    | Fired when the layer being split. Returns a LayerGroup containing all resulting layers in `layers`. | `shape`, `splitLayer`, `layers`, `originalLayer` |\n\nThe following events are available on a map instance:\n\n| Event                     | Params | Description                          | Output                                           |\n| :------------------------ | :----- | :----------------------------------- | :----------------------------------------------- |\n| pm:globalsplitmodetoggled | `e`    | Fired when Split Mode is toggled.    | `enabled`, `map`                                 |\n| pm:split                  | `e`    | Fired when any layer is being split. | `shape`, `splitLayer`, `layers`, `originalLayer` |\n\n### Scale Mode ⭐\n\nYou can enable Scale Mode for all layers on a map like this:\n\n```js\nmap.pm.enableGlobalScaleMode();\n```\n\nWith the option `centerScaling` the scale origin cen be the center of the layer or the opposite corner of the dragged marker. If `false` Alt-Key can be used.\nThe option `uniformScaling` the scales the width and the height with the same ratio. If `false` Shift-Key can be used.\n\nThe following methods are available on `map.pm`:\n\n| Method                   | Returns   | Description                                                            |\n| :----------------------- | :-------- | :--------------------------------------------------------------------- |\n| enableGlobalScaleMode()  | -         | Enables global Scale Mode.                                             |\n| disableGlobalScaleMode() | -         | Disables global Scale Mode.                                            |\n| toggleGlobalScaleMode()  | -         | Toggles global Scale Mode.                                             |\n| globalScaleModeEnabled() | `Boolean` | Returns `true` if global Scale Mode is enabled. `false` when disabled. |\n\nThe following methods are available for layers under `layer.pm`:\n\n| Method                | Returns   | Description                                                                                                                   |\n| :-------------------- | :-------- | :---------------------------------------------------------------------------------------------------------------------------- |\n| enableScale()         | -         | Enables Scale Mode on the layer.                                                                                              |\n| disableScale()        | -         | Disables Scale Mode on the layer.                                                                                             |\n| scaleEnabled()        | `Boolean` | Returns if Scale Mode is enabled for the layer.                                                                               |\n| scaleLayer(`percent`) | -         | Scale the layer by `x` percent. Also an Object with `{w: width, h: height}` can be passed. Scale up `> 0` , scale down `< 0`. |\n\nThe following events are available on a layer instance:\n\n| Event           | Params | Description                               | Output                                                 |\n| :-------------- | :----- | :---------------------------------------- | :----------------------------------------------------- |\n| pm:scaleenable  | `e`    | Fired when scale is enabled for a layer.  | `layer`, `helpLayer`                                   |\n| pm:scaledisable | `e`    | Fired when scale is disabled for a layer. | `layer`                                                |\n| pm:scalestart   | `e`    | Fired when scale starts on a layer.       | `layer`, `helpLayer`, `originLatLngs`, `originLatLngs` |\n| pm:scale        | `e`    | Fired when a layer is scaled.             | `layer`, `helpLayer`, `oldLatLngs`, `newLatLngs`       |\n| pm:scaleend     | `e`    | Fired when scale ends on a layer.         | `layer`, `helpLayer`, `originLatLngs`, `newLatLngs`    |\n\nThe following events are available on a map instance:\n\n| Event                     | Params | Description                               | Output                                                 |\n| :------------------------ | :----- | :---------------------------------------- | :----------------------------------------------------- |\n| pm:globalscalemodetoggled | `e`    | Fired when Scale Mode is toggled.         | `enabled`, `map`                                       |\n| pm:scaleenable            | `e`    | Fired when scale is enabled for a layer.  | `layer`, `helpLayer`                                   |\n| pm:scaledisable           | `e`    | Fired when scale is disabled for a layer. | `layer`                                                |\n| pm:scalestart             | `e`    | Fired when scale starts on a layer.       | `layer`, `helpLayer`, `originLatLngs`, `originLatLngs` |\n| pm:scale                  | `e`    | Fired when a layer is scaled.             | `layer`, `helpLayer`, `oldLatLngs`, `newLatLngs`       |\n| pm:scaleend               | `e`    | Fired when scale ends on a layer.         | `layer`, `helpLayer`, `originLatLngs`, `newLatLngs`    |\n\n### Options\n\nYou have many options available when drawing and editing your layers (described above).  \nYou can set the options per layer as described above, or you can set them globally for all layers. This is especially useful when you use the toolbar and can't change the options programmatically.\n\nExamples:\n\n```js\nlayer.pm.enable({ pinning: true, snappable: false });\n```\n\n```js\nmap.pm.setGlobalOptions({ pinning: true, snappable: false });\n```\n\nThe following options are additionally to the [Draw](#draw-mode) and [Edit Mode](#edit-mode) options.\n\n| Option        | Default  | Description                                                                                                                                                                                                            |\n| :------------ | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| snappingOrder | `Array`  | Prioritize the order of snapping. Default: `['Marker','CircleMarker','Circle','Line','Polygon','Rectangle']`.                                                                                                          |\n| layerGroup    | `map`    | add the created layers to a layergroup instead to the map.                                                                                                                                                             |\n| panes         | `Object` | Defines in which [panes](https://leafletjs.com/reference-1.7.1.html#map-pane) the layers and helper vertices are created. Default: `{ vertexPane: 'markerPane', layerPane: 'overlayPane', markerPane: 'markerPane' }`. |\n\nSome details about a few more powerful options:\n\n##### Snapping\n\nSnap the dragged marker/vertex to other layers for precision drawing.  \nSnapping can be disabled for layers with the layer option `snapIgnore: true`. With `snapIgnore: false` it will be always snappable, also if `pmIgnore` is set.\nCan also be disabled by holding the `ALT` key.\n\n![Snapping Options](https://files-r7ezk18qq.now.sh/snapping.gif)\n\n##### Pinning ⭐\n\nWhen dragging a vertex/marker, you can pin all other Markers/Vertices that have the same latlng to the dragged marker. Exclusive for Leaflet-Geoman Pro ⭐\n\n![Pinning Option](https://user-images.githubusercontent.com/2399810/65375984-288ece80-dc9b-11e9-930e-bca03ad7cb56.gif)\n\n##### Measurement ⭐\n\n![Measurement Demo](https://user-images.githubusercontent.com/2399810/118528582-ce316400-b742-11eb-8c1a-8c656a5138d1.gif)\n\nCalculates the measurement of a layer while drawing and editing. Exclusive for Leaflet-Geoman Pro ⭐\n\n```js\nmap.pm.setGlobalOptions({ measurements: { measurement: true, displayFormat: 'metric', ... } })\n```\n\nSee the available options in the table below.\n\n| Option             | Default  | Description                                                                                                           |\n| :----------------- | :------- | :-------------------------------------------------------------------------------------------------------------------- |\n| measurement        | `true`   | Enable measurement calculation.                                                                                       |\n| showTooltip        | `true`   | Shows the tooltip during draw and edit.                                                                               |\n| showTooltipOnHover | `true`   | Shows the tooltip when hovering a finished layer.                                                                     |\n| displayFormat      | `metric` | Displayed format in the tooltip `metric` or `imperial`.                                                               |\n| totalLength        | `true`   | Shows the total length in the tooltip `Line`.                                                                         |\n| segmentLength      | `true`   | Shows the segment length in the tooltip `Line`, `Polygon`.                                                            |\n| area               | `true`   | Shows the area in the tooltip `Polygon`, `Rectangle`, `Circle`, `CircleMarker`.                                       |\n| radius             | `true`   | Shows the radius in the tooltip `Circle`, `CircleMarker`.                                                             |\n| perimeter          | `true`   | Shows the perimeter in the tooltip `Polygon`, `Rectangle`, `Circle`, `CircleMarker`.                                  |\n| height             | `true`   | Shows the height in the tooltip `Rectangle`.                                                                          |\n| width              | `true`   | Shows the width in the tooltip `Rectangle`.                                                                           |\n| coordinates        | `true`   | Shows the coordinates in the tooltip `Marker`, `CircleMarker` and the current dragged marker while drawing / editing. |\n\n### LayerGroup\n\nLeaflet-Geoman can only work correct with `L.FeatureGroup` and `L.GeoJSON` (the extended versions of L.LayerGroup) we need the events `layeradd` and `layerremove`.\n\nThe following methods are available for LayerGroups on `layergroup.pm`:\n\n| Method                                                              | Returns   | Description               ","readmeFilename":"README.md"}