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flet.Editable.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/leaflet-editable@1.1.0/src/Leaflet.Editable.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n(function (factory, window) {\n    /*globals define, module, require*/\n\n    // define an AMD module that relies on 'leaflet'\n    if (typeof define === 'function' && define.amd) {\n        define(['leaflet'], factory);\n\n\n    // define a Common JS module that relies on 'leaflet'\n    } else if (typeof exports === 'object') {\n        module.exports = factory(require('leaflet'));\n    }\n\n    // attach your plugin to the global 'L' variable\n    if(typeof window !== 'undefined' && window.L){\n        factory(window.L);\n    }\n\n}(function (L) {\n    // 🍂miniclass CancelableEvent (Event objects)\n    // 🍂method cancel()\n    // Cancel any subsequent action.\n\n    // 🍂miniclass VertexEvent (Event objects)\n    // 🍂property vertex: VertexMarker\n    // The vertex that fires the event.\n\n    // 🍂miniclass ShapeEvent (Event objects)\n    // 🍂property shape: Array\n    // The shape (LatLngs array) subject of the action.\n\n    // 🍂miniclass CancelableVertexEvent (Event objects)\n    // 🍂inherits VertexEvent\n    // 🍂inherits CancelableEvent\n\n    // 🍂miniclass CancelableShapeEvent (Event objects)\n    // 🍂inherits ShapeEvent\n    // 🍂inherits CancelableEvent\n\n    // 🍂miniclass LayerEvent (Event objects)\n    // 🍂property layer: object\n    // The Layer (Marker, Polyline…) subject of the action.\n\n    // 🍂namespace Editable; 🍂class Editable; 🍂aka L.Editable\n    // Main edition handler. By default, it is attached to the map\n    // as `map.editTools` property.\n    // Leaflet.Editable is made to be fully extendable. You have three ways to customize\n    // the behaviour: using options, listening to events, or extending.\n    L.Editable = L.Evented.extend({\n\n        statics: {\n            FORWARD: 1,\n            BACKWARD: -1\n        },\n\n        options: {\n\n            // You can pass them when creating a map using the `editOptions` key.\n            // 🍂option zIndex: int = 1000\n            // The default zIndex of the editing tools.\n            zIndex: 1000,\n\n            // 🍂option polygonClass: class = L.Polygon\n            // Class to be used when creating a new Polygon.\n            polygonClass: L.Polygon,\n\n            // 🍂option polylineClass: class = L.Polyline\n            // Class to be used when creating a new Polyline.\n            polylineClass: L.Polyline,\n\n            // 🍂option markerClass: class = L.Marker\n            // Class to be used when creating a new Marker.\n            markerClass: L.Marker,\n\n            // 🍂option rectangleClass: class = L.Rectangle\n            // Class to be used when creating a new Rectangle.\n            rectangleClass: L.Rectangle,\n\n            // 🍂option circleClass: class = L.Circle\n            // Class to be used when creating a new Circle.\n            circleClass: L.Circle,\n\n            // 🍂option drawingCSSClass: string = 'leaflet-editable-drawing'\n            // CSS class to be added to the map container while drawing.\n            drawingCSSClass: 'leaflet-editable-drawing',\n\n            // 🍂option drawingCursor: const = 'crosshair'\n            // Cursor mode set to the map while drawing.\n            drawingCursor: 'crosshair',\n\n            // 🍂option editLayer: Layer = new L.LayerGroup()\n            // Layer used to store edit tools (vertex, line guide…).\n            editLayer: undefined,\n\n            // 🍂option featuresLayer: Layer = new L.LayerGroup()\n            // Default layer used to store drawn features (Marker, Polyline…).\n            featuresLayer: undefined,\n\n            // 🍂option polylineEditorClass: class = PolylineEditor\n            // Class to be used as Polyline editor.\n            polylineEditorClass: undefined,\n\n            // 🍂option polygonEditorClass: class = PolygonEditor\n            // Class to be used as Polygon editor.\n            polygonEditorClass: undefined,\n\n            // 🍂option markerEditorClass: class = MarkerEditor\n            // Class to be used as Marker editor.\n            markerEditorClass: undefined,\n\n            // 🍂option rectangleEditorClass: class = RectangleEditor\n            // Class to be used as Rectangle editor.\n            rectangleEditorClass: undefined,\n\n            // 🍂option circleEditorClass: class = CircleEditor\n            // Class to be used as Circle editor.\n            circleEditorClass: undefined,\n\n            // 🍂option lineGuideOptions: hash = {}\n            // Options to be passed to the line guides.\n            lineGuideOptions: {},\n\n            // 🍂option skipMiddleMarkers: boolean = false\n            // Set this to true if you don't want middle markers.\n            skipMiddleMarkers: false\n\n        },\n\n        initialize: function (map, options) {\n            L.setOptions(this, options);\n            this._lastZIndex = this.options.zIndex;\n            this.map = map;\n            this.editLayer = this.createEditLayer();\n            this.featuresLayer = this.createFeaturesLayer();\n            this.forwardLineGuide = this.createLineGuide();\n            this.backwardLineGuide = this.createLineGuide();\n        },\n\n        fireAndForward: function (type, e) {\n            e = e || {};\n            e.editTools = this;\n            this.fire(type, e);\n            this.map.fire(type, e);\n        },\n\n        createLineGuide: function () {\n            var options = L.extend({dashArray: '5,10', weight: 1, interactive: false}, this.options.lineGuideOptions);\n            return L.polyline([], options);\n        },\n\n        createVertexIcon: function (options) {\n            return L.Browser.touch ? new L.Editable.TouchVertexIcon(options) : new L.Editable.VertexIcon(options);\n        },\n\n        createEditLayer: function () {\n            return this.options.editLayer || new L.LayerGroup().addTo(this.map);\n        },\n\n        createFeaturesLayer: function () {\n            return this.options.featuresLayer || new L.LayerGroup().addTo(this.map);\n        },\n\n        moveForwardLineGuide: function (latlng) {\n            if (this.forwardLineGuide._latlngs.length) {\n                this.forwardLineGuide._latlngs[1] = latlng;\n                this.forwardLineGuide._bounds.extend(latlng);\n                this.forwardLineGuide.redraw();\n            }\n        },\n\n        moveBackwardLineGuide: function (latlng) {\n            if (this.backwardLineGuide._latlngs.length) {\n                this.backwardLineGuide._latlngs[1] = latlng;\n                this.backwardLineGuide._bounds.extend(latlng);\n                this.backwardLineGuide.redraw();\n            }\n        },\n\n        anchorForwardLineGuide: function (latlng) {\n            this.forwardLineGuide._latlngs[0] = latlng;\n            this.forwardLineGuide._bounds.extend(latlng);\n            this.forwardLineGuide.redraw();\n        },\n\n        anchorBackwardLineGuide: function (latlng) {\n            this.backwardLineGuide._latlngs[0] = latlng;\n            this.backwardLineGuide._bounds.extend(latlng);\n            this.backwardLineGuide.redraw();\n        },\n\n        attachForwardLineGuide: function () {\n            this.editLayer.addLayer(this.forwardLineGuide);\n        },\n\n        attachBackwardLineGuide: function () {\n            this.editLayer.addLayer(this.backwardLineGuide);\n        },\n\n        detachForwardLineGuide: function () {\n            this.forwardLineGuide.setLatLngs([]);\n            this.editLayer.removeLayer(this.forwardLineGuide);\n        },\n\n        detachBackwardLineGuide: function () {\n            this.backwardLineGuide.setLatLngs([]);\n            this.editLayer.removeLayer(this.backwardLineGuide);\n        },\n\n        blockEvents: function () {\n            // Hack: force map not to listen to other layers events while drawing.\n            if (!this._oldTargets) {\n                this._oldTargets = this.map._targets;\n                this.map._targets = {};\n            }\n        },\n\n        unblockEvents: function () {\n            if (this._oldTargets) {\n                // Reset, but keep targets created while drawing.\n                this.map._targets = L.extend(this.map._targets, this._oldTargets);\n                delete this._oldTargets;\n            }\n        },\n\n        registerForDrawing: function (editor) {\n            if (this._drawingEditor) this.unregisterForDrawing(this._drawingEditor);\n            this.blockEvents();\n            editor.reset();  // Make sure editor tools still receive events.\n            this._drawingEditor = editor;\n            this.map.on('mousemove touchmove', editor.onDrawingMouseMove, editor);\n            this.map.on('mousedown', this.onMousedown, this);\n            this.map.on('mouseup', this.onMouseup, this);\n            L.DomUtil.addClass(this.map._container, this.options.drawingCSSClass);\n            this.defaultMapCursor = this.map._container.style.cursor;\n            this.map._container.style.cursor = this.options.drawingCursor;\n        },\n\n        unregisterForDrawing: function (editor) {\n            this.unblockEvents();\n            L.DomUtil.removeClass(this.map._container, this.options.drawingCSSClass);\n            this.map._container.style.cursor = this.defaultMapCursor;\n            editor = editor || this._drawingEditor;\n            if (!editor) return;\n            this.map.off('mousemove touchmove', editor.onDrawingMouseMove, editor);\n            this.map.off('mousedown', this.onMousedown, this);\n            this.map.off('mouseup', this.onMouseup, this);\n            if (editor !== this._drawingEditor) return;\n            delete this._drawingEditor;\n            if (editor._drawing) editor.cancelDrawing();\n        },\n\n        onMousedown: function (e) {\n            this._mouseDown = e;\n            this._drawingEditor.onDrawingMouseDown(e);\n        },\n\n        onMouseup: function (e) {\n            if (this._mouseDown) {\n                var editor = this._drawingEditor,\n                    mouseDown = this._mouseDown;\n                this._mouseDown = null;\n                editor.onDrawingMouseUp(e);\n                if (this._drawingEditor !== editor) return;  // onDrawingMouseUp may call unregisterFromDrawing.\n                var origin = L.point(mouseDown.originalEvent.clientX, mouseDown.originalEvent.clientY);\n                var distance = L.point(e.originalEvent.clientX, e.originalEvent.clientY).distanceTo(origin);\n                if (Math.abs(distance) < 9 * (window.devicePixelRatio || 1)) this._drawingEditor.onDrawingClick(e);\n            }\n        },\n\n        // 🍂section Public methods\n        // You will generally access them by the `map.editTools`\n        // instance:\n        //\n        // `map.editTools.startPolyline();`\n\n        // 🍂method drawing(): boolean\n        // Return true if any drawing action is ongoing.\n        drawing: function () {\n            return this._drawingEditor && this._drawingEditor.drawing();\n        },\n\n        // 🍂method stopDrawing()\n        // When you need to stop any ongoing drawing, without needing to know which editor is active.\n        stopDrawing: function () {\n            this.unregisterForDrawing();\n        },\n\n        // 🍂method commitDrawing()\n        // When you need to commit any ongoing drawing, without needing to know which editor is active.\n        commitDrawing: function (e) {\n            if (!this._drawingEditor) return;\n            this._drawingEditor.commitDrawing(e);\n        },\n\n        connectCreatedToMap: function (layer) {\n            return this.featuresLayer.addLayer(layer);\n        },\n\n        // 🍂method startPolyline(latlng: L.LatLng, options: hash): L.Polyline\n        // Start drawing a Polyline. If `latlng` is given, a first point will be added. In any case, continuing on user click.\n        // If `options` is given, it will be passed to the Polyline class constructor.\n        startPolyline: function (latlng, options) {\n            var line = this.createPolyline([], options);\n            line.enableEdit(this.map).newShape(latlng);\n            return line;\n        },\n\n        // 🍂method startPolygon(latlng: L.LatLng, options: hash): L.Polygon\n        // Start drawing a Polygon. If `latlng` is given, a first point will be added. In any case, continuing on user click.\n        // If `options` is given, it will be passed to the Polygon class constructor.\n        startPolygon: function (latlng, options) {\n            var polygon = this.createPolygon([], options);\n            polygon.enableEdit(this.map).newShape(latlng);\n            return polygon;\n        },\n\n        // 🍂method startMarker(latlng: L.LatLng, options: hash): L.Marker\n        // Start adding a Marker. If `latlng` is given, the Marker will be shown first at this point.\n        // In any case, it will follow the user mouse, and will have a final `latlng` on next click (or touch).\n        // If `options` is given, it will be passed to the Marker class constructor.\n        startMarker: function (latlng, options) {\n            latlng = latlng || this.map.getCenter().clone();\n            var marker = this.createMarker(latlng, options);\n            marker.enableEdit(this.map).startDrawing();\n            return marker;\n        },\n\n        // 🍂method startRectangle(latlng: L.LatLng, options: hash): L.Rectangle\n        // Start drawing a Rectangle. If `latlng` is given, the Rectangle anchor will be added. In any case, continuing on user drag.\n        // If `options` is given, it will be passed to the Rectangle class constructor.\n        startRectangle: function(latlng, options) {\n            var corner = latlng || L.latLng([0, 0]);\n            var bounds = new L.LatLngBounds(corner, corner);\n            var rectangle = this.createRectangle(bounds, options);\n            rectangle.enableEdit(this.map).startDrawing();\n            return rectangle;\n        },\n\n        // 🍂method startCircle(latlng: L.LatLng, options: hash): L.Circle\n        // Start drawing a Circle. If `latlng` is given, the Circle anchor will be added. In any case, continuing on user drag.\n        // If `options` is given, it will be passed to the Circle class constructor.\n        startCircle: function (latlng, options) {\n            latlng = latlng || this.map.getCenter().clone();\n            var circle = this.createCircle(latlng, options);\n            circle.enableEdit(this.map).startDrawing();\n            return circle;\n        },\n\n        startHole: function (editor, latlng) {\n            editor.newHole(latlng);\n        },\n\n        createLayer: function (klass, latlngs, options) {\n            options = L.Util.extend({editOptions: {editTools: this}}, options);\n            var layer = new klass(latlngs, options);\n            // 🍂namespace Editable\n            // 🍂event editable:created: LayerEvent\n            // Fired when a new feature (Marker, Polyline…) is created.\n            this.fireAndForward('editable:created', {layer: layer});\n            return layer;\n        },\n\n        createPolyline: function (latlngs, options) {\n            return this.createLayer(options && options.polylineClass || this.options.polylineClass, latlngs, options);\n        },\n\n        createPolygon: function (latlngs, options) {\n            return this.createLayer(options && options.polygonClass || this.options.polygonClass, latlngs, options);\n        },\n\n        createMarker: function (latlng, options) {\n            return this.createLayer(options && options.markerClass || this.options.markerClass, latlng, options);\n        },\n\n        createRectangle: function (bounds, options) {\n            return this.createLayer(options && options.rectangleClass || this.options.rectangleClass, bounds, options);\n        },\n\n        createCircle: function (latlng, options) {\n            return this.createLayer(options && options.circleClass || this.options.circleClass, latlng, options);\n        }\n\n    });\n\n    L.extend(L.Editable, {\n\n        makeCancellable: function (e) {\n            e.cancel = function () {\n                e._cancelled = true;\n            };\n        }\n\n    });\n\n    // 🍂namespace Map; 🍂class Map\n    // Leaflet.Editable add options and events to the `L.Map` object.\n    // See `Editable` events for the list of events fired on the Map.\n    // 🍂example\n    //\n    // ```js\n    // var map = L.map('map', {\n    //  editable: true,\n    //  editOptions: {\n    //    …\n    // }\n    // });\n    // ```\n    // 🍂section Editable Map Options\n    L.Map.mergeOptions({\n\n        // 🍂namespace Map\n        // 🍂section Map Options\n        // 🍂option editToolsClass: class = L.Editable\n        // Class to be used as vertex, for path editing.\n        editToolsClass: L.Editable,\n\n        // 🍂option editable: boolean = false\n        // Whether to create a L.Editable instance at map init.\n        editable: false,\n\n        // 🍂option editOptions: hash = {}\n        // Options to pass to L.Editable when instanciating.\n        editOptions: {}\n\n    });\n\n    L.Map.addInitHook(function () {\n\n        this.whenReady(function () {\n            if (this.options.editable) {\n                this.editTools = new this.options.editToolsClass(this, this.options.editOptions);\n            }\n        });\n\n    });\n\n    L.Editable.VertexIcon = L.DivIcon.extend({\n\n        options: {\n            iconSize: new L.Point(8, 8)\n        }\n\n    });\n\n    L.Editable.TouchVertexIcon = L.Editable.VertexIcon.extend({\n\n        options: {\n            iconSize: new L.Point(20, 20)\n        }\n\n    });\n\n\n    // 🍂namespace Editable; 🍂class VertexMarker; Handler for dragging path vertices.\n    L.Editable.VertexMarker = L.Marker.extend({\n\n        options: {\n            draggable: true,\n            className: 'leaflet-div-icon leaflet-vertex-icon'\n        },\n\n\n        // 🍂section Public methods\n        // The marker used to handle path vertex. You will usually interact with a `VertexMarker`\n        // instance when listening for events like `editable:vertex:ctrlclick`.\n\n        initialize: function (latlng, latlngs, editor, options) {\n            // We don't use this._latlng, because on drag Leaflet replace it while\n            // we want to keep reference.\n            this.latlng = latlng;\n            this.latlngs = latlngs;\n            this.editor = editor;\n            L.Marker.prototype.initialize.call(this, latlng, options);\n            this.options.icon = this.editor.tools.createVertexIcon({className: this.options.className});\n            this.latlng.__vertex = this;\n            this.editor.editLayer.addLayer(this);\n            this.setZIndexOffset(editor.tools._lastZIndex + 1);\n        },\n\n        onAdd: function (map) {\n            L.Marker.prototype.onAdd.call(this, map);\n            this.on('drag', this.onDrag);\n            this.on('dragstart', this.onDragStart);\n            this.on('dragend', this.onDragEnd);\n            this.on('mouseup', this.onMouseup);\n            this.on('click', this.onClick);\n            this.on('contextmenu', this.onContextMenu);\n            this.on('mousedown touchstart', this.onMouseDown);\n            this.addMiddleMarkers();\n        },\n\n        onRemove: function (map) {\n            if (this.middleMarker) this.middleMarker.delete();\n            delete this.latlng.__vertex;\n            this.off('drag', this.onDrag);\n            this.off('dragstart', this.onDragStart);\n            this.off('dragend', this.onDragEnd);\n            this.off('mouseup', this.onMouseup);\n            this.off('click', this.onClick);\n            this.off('contextmenu', this.onContextMenu);\n            this.off('mousedown touchstart', this.onMouseDown);\n            L.Marker.prototype.onRemove.call(this, map);\n        },\n\n        onDrag: function (e) {\n            e.vertex = this;\n            this.editor.onVertexMarkerDrag(e);\n            var iconPos = L.DomUtil.getPosition(this._icon),\n                latlng = this._map.layerPointToLatLng(iconPos);\n            this.latlng.update(latlng);\n            this._latlng = this.latlng;  // Push back to Leaflet our reference.\n            this.editor.refresh();\n            if (this.middleMarker) this.middleMarker.updateLatLng();\n            var next = this.getNext();\n            if (next && next.middleMarker) next.middleMarker.updateLatLng();\n        },\n\n        onDragStart: function (e) {\n            e.vertex = this;\n            this.editor.onVertexMarkerDragStart(e);\n        },\n\n        onDragEnd: function (e) {\n            e.vertex = this;\n            this.editor.onVertexMarkerDragEnd(e);\n        },\n\n        onClick: function (e) {\n            e.vertex = this;\n            this.editor.onVertexMarkerClick(e);\n        },\n\n        onMouseup: function (e) {\n            L.DomEvent.stop(e);\n            e.vertex = this;\n            this.editor.map.fire('mouseup', e);\n        },\n\n        onContextMenu: function (e) {\n            e.vertex = this;\n            this.editor.onVertexMarkerContextMenu(e);\n        },\n\n        onMouseDown: function (e) {\n            e.vertex = this;\n            this.editor.onVertexMarkerMouseDown(e);\n        },\n\n        // 🍂method delete()\n        // Delete a vertex and the related LatLng.\n        delete: function () {\n            var next = this.getNext();  // Compute before changing latlng\n            this.latlngs.splice(this.getIndex(), 1);\n            this.editor.editLayer.removeLayer(this);\n            this.editor.onVertexDeleted({latlng: this.latlng, vertex: this});\n            if (!this.latlngs.length) this.editor.deleteShape(this.latlngs);\n            if (next) next.resetMiddleMarker();\n            this.editor.refresh();\n        },\n\n        // 🍂method getIndex(): int\n        // Get the index of the current vertex among others of the same LatLngs group.\n        getIndex: function () {\n            return this.latlngs.indexOf(this.latlng);\n        },\n\n        // 🍂method getLastIndex(): int\n        // Get last vertex index of the LatLngs group of the current vertex.\n        getLastIndex: function () {\n            return this.latlngs.length - 1;\n        },\n\n        // 🍂method getPrevious(): VertexMarker\n        // Get the previous VertexMarker in the same LatLngs group.\n        getPrevious: function () {\n            if (this.latlngs.length < 2) return;\n            var index = this.getIndex(),\n                previousIndex = index - 1;\n            if (index === 0 && this.editor.CLOSED) previousIndex = this.getLastIndex();\n            var previous = this.latlngs[previousIndex];\n            if (previous) return previous.__vertex;\n        },\n\n        // 🍂method getNext(): VertexMarker\n        // Get the next VertexMarker in the same LatLngs group.\n        getNext: function () {\n            if (this.latlngs.length < 2) return;\n            var index = this.getIndex(),\n                nextIndex = index + 1;\n            if (index === this.getLastIndex() && this.editor.CLOSED) nextIndex = 0;\n            var next = this.latlngs[nextIndex];\n            if (next) return next.__vertex;\n        },\n\n        addMiddleMarker: function (previous) {\n            if (!this.editor.hasMiddleMarkers()) return;\n            previous = previous || this.getPrevious();\n            if (previous && !this.middleMarker) this.middleMarker = this.editor.addMiddleMarker(previous, this, this.latlngs, this.editor);\n        },\n\n        addMiddleMarkers: function () {\n            if (!this.editor.hasMiddleMarkers()) return;\n            var previous = this.getPrevious();\n            if (previous) this.addMiddleMarker(previous);\n            var next = this.getNext();\n            if (next) next.resetMiddleMarker();\n        },\n\n        resetMiddleMarker: function () {\n            if (this.middleMarker) this.middleMarker.delete();\n            this.addMiddleMarker();\n        },\n\n        // 🍂method split()\n        // Split the vertex LatLngs group at its index, if possible.\n        split: function () {\n            if (!this.editor.splitShape) return;  // Only for PolylineEditor\n            this.editor.splitShape(this.latlngs, this.getIndex());\n        },\n\n        // 🍂method continue()\n        // Continue the vertex LatLngs from this vertex. Only active for first and last vertices of a Polyline.\n        continue: function () {\n            if (!this.editor.continueBackward) return;  // Only for PolylineEditor\n            var index = this.getIndex();\n            if (index === 0) this.editor.continueBackward(this.latlngs);\n            else if (index === this.getLastIndex()) this.editor.continueForward(this.latlngs);\n        }\n\n    });\n\n    L.Editable.mergeOptions({\n\n        // 🍂namespace Editable\n        // 🍂option vertexMarkerClass: class = VertexMarker\n        // Class to be used as vertex, for path editing.\n        vertexMarkerClass: L.Editable.VertexMarker\n\n    });\n\n    L.Editable.MiddleMarker = L.Marker.extend({\n\n        options: {\n            opacity: 0.5,\n            className: 'leaflet-div-icon leaflet-middle-icon',\n            draggable: true\n        },\n\n        initialize: function (left, right, latlngs, editor, options) {\n            this.left = left;\n            this.right = right;\n            this.editor = editor;\n            this.latlngs = latlngs;\n            L.Marker.prototype.initialize.call(this, this.computeLatLng(), options);\n            this._opacity = this.options.opacity;\n            this.options.icon = this.editor.tools.createVertexIcon({className: this.options.className});\n            this.editor.editLayer.addLayer(this);\n            this.setVisibility();\n        },\n\n        setVisibility: function () {\n            var leftPoint = this._map.latLngToContainerPoint(this.left.latlng),\n                rightPoint = this._map.latLngToContainerPoint(this.right.latlng),\n                size = L.point(this.options.icon.options.iconSize);\n            if (leftPoint.distanceTo(rightPoint) < size.x * 3) this.hide();\n            else this.show();\n        },\n\n        show: function () {\n            this.setOpacity(this._opacity);\n        },\n\n        hide: function () {\n            this.setOpacity(0);\n        },\n\n        updateLatLng: function () {\n            this.setLatLng(this.computeLatLng());\n            this.setVisibility();\n        },\n\n        computeLatLng: function () {\n            var leftPoint = this.editor.map.latLngToContainerPoint(this.left.latlng),\n                rightPoint = this.editor.map.latLngToContainerPoint(this.right.latlng),\n                y = (leftPoint.y + rightPoint.y) / 2,\n                x = (leftPoint.x + rightPoint.x) / 2;\n            return this.editor.map.containerPointToLatLng([x, y]);\n        },\n\n        onAdd: function (map) {\n            L.Marker.prototype.onAdd.call(this, map);\n            L.DomEvent.on(this._icon, 'mousedown touchstart', this.onMouseDown, this);\n            map.on('zoomend', this.setVisibility, this);\n        },\n\n        onRemove: function (map) {\n            delete this.right.middleMarker;\n            L.DomEvent.off(this._icon, 'mousedown touchstart', this.onMouseDown, this);\n            map.off('zoomend', this.setVisibility, this);\n            L.Marker.prototype.onRemove.call(this, map);\n        },\n\n        onMouseDown: function (e) {\n            var iconPos = L.DomUtil.getPosition(this._icon),\n                latlng = this.editor.map.layerPointToLatLng(iconPos);\n            e = {\n                originalEvent: e,\n                latlng: latlng\n            };\n            if (this.options.opacity === 0) return;\n            L.Editable.makeCancellable(e);\n            this.editor.onMiddleMarkerMouseDown(e);\n            if (e._cancelled) return;\n            this.latlngs.splice(this.index(), 0, e.latlng);\n            this.editor.refresh();\n            var icon = this._icon;\n            var marker = this.editor.addVertexMarker(e.latlng, this.latlngs);\n            this.editor.onNewVertex(marker);\n            /* Hack to workaround browser not firing touchend when element is no more on DOM */\n            var parent = marker._icon.parentNode;\n            parent.removeChild(marker._icon);\n            marker._icon = icon;\n            parent.appendChild(marker._icon);\n            marker._initIcon();\n            marker._initInteraction();\n            marker.setOpacity(1);\n            /* End hack */\n            // Transfer ongoing dragging to real marker\n            L.Draggable._dragging = false;\n            marker.dragging._draggable._onDown(e.originalEvent);\n            this.delete();\n        },\n\n        delete: function () {\n            this.editor.editLayer.removeLayer(this);\n        },\n\n        index: function () {\n            return this.latlngs.indexOf(this.right.latlng);\n        }\n\n    });\n\n    L.Editable.mergeOptions({\n\n        // 🍂namespace Editable\n        // 🍂option middleMarkerClass: class = VertexMarker\n        // Class to be used as middle vertex, pulled by the user to create a new point in the middle of a path.\n        middleMarkerClass: L.Editable.MiddleMarker\n\n    });\n\n    // 🍂namespace Editable; 🍂class BaseEditor; 🍂aka L.Editable.BaseEditor\n    // When editing a feature (Marker, Polyline…), an editor is attached to it. This\n    // editor basically knows how to handle the edition.\n    L.Editable.BaseEditor = L.Handler.extend({\n\n        initialize: function (map, feature, options) {\n            L.setOptions(this, options);\n            this.map = map;\n            this.feature = feature;\n            this.feature.editor = this;\n            this.editLayer = new L.LayerGroup();\n            this.tools = this.options.editTools || map.editTools;\n        },\n\n        // 🍂method enable(): this\n        // Set up the drawing tools for the feature to be editable.\n        addHooks: function () {\n            if (this.isConnected()) this.onFeatureAdd();\n            else this.feature.once('add', this.onFeatureAdd, this);\n            this.onEnable();\n            this.feature.on(this._getEvents(), this);\n            return;\n        },\n\n        // 🍂method disable(): this\n        // Remove the drawing tools for the feature.\n        removeHooks: function () {\n            this.feature.off(this._getEvents(), this);\n            if (this.feature.dragging) this.feature.dragging.disable();\n            this.editLayer.clearLayers();\n            this.tools.editLayer.removeLayer(this.editLayer);\n            this.onDisable();\n            if (this._drawing) this.cancelDrawing();\n            return;\n        },\n\n        // 🍂method drawing(): boolean\n        // Return true if any drawing action is ongoing with this editor.\n        drawing: function () {\n            return !!this._drawing;\n        },\n\n        reset: function () {},\n\n        onFeatureAdd: function () {\n            this.tools.editLayer.addLayer(this.editLayer);\n            if (this.feature.dragging) this.feature.dragging.enable();\n        },\n\n        hasMiddleMarkers: function () {\n            return !this.options.skipMiddleMarkers && !this.tools.options.skipMiddleMarkers;\n        },\n\n        fireAndForward: function (type, e) {\n            e = e || {};\n            e.layer = this.feature;\n            this.feature.fire(type, e);\n            this.tools.fireAndForward(type, e);\n        },\n\n        onEnable: function () {\n            // 🍂namespace Editable\n            // 🍂event editable:enable: Event\n            // Fired when an existing feature is ready to be edited.\n            this.fireAndForward('editable:enable');\n        },\n\n        onDisable: function () {\n            // 🍂namespace Editable\n            // 🍂event editable:disable: Event\n            // Fired when an existing feature is not ready anymore to be edited.\n            this.fireAndForward('editable:disable');\n        },\n\n        onEditing: function () {\n            // 🍂namespace Editable\n            // 🍂event editable:editing: Event\n            // Fired as soon as any change is made to the feature geometry.\n            this.fireAndForward('editable:editing');\n        },\n\n        onStartDrawing: function () {\n            // 🍂namespace Editable\n            // 🍂section Drawing events\n            // 🍂event editable:drawing:start: Event\n            // Fired when a feature is to be drawn.\n            this.fireAndForward('editable:drawing:start');\n        },\n\n        onEndDrawing: function () {\n            // 🍂namespace Editable\n            // 🍂section Drawing events\n            // 🍂event editable:drawing:end: Event\n            // Fired when a feature is not drawn anymore.\n            this.fireAndForward('editable:drawing:end');\n        },\n\n        onCancelDrawing: function () {\n            // 🍂namespace Editable\n            // 🍂section Drawing events\n            // 🍂event editable:drawing:cancel: Event\n            // Fired when user cancel drawing while a feature is being drawn.\n            this.fireAndForward('editable:drawing:cancel');\n        },\n\n        onCommitDrawing: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Drawing events\n            // 🍂event editable:drawing:commit: Event\n            // Fired when user finish drawing a feature.\n            this.fireAndForward('editable:drawing:commit', e);\n        },\n\n        onDrawingMouseDown: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Drawing events\n            // 🍂event editable:drawing:mousedown: Event\n            // Fired when user `mousedown` while drawing.\n            this.fireAndForward('editable:drawing:mousedown', e);\n        },\n\n        onDrawingMouseUp: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Drawing events\n            // 🍂event editable:drawing:mouseup: Event\n            // Fired when user `mouseup` while drawing.\n            this.fireAndForward('editable:drawing:mouseup', e);\n        },\n\n        startDrawing: function () {\n            if (!this._drawing) this._drawing = L.Editable.FORWARD;\n            this.tools.registerForDrawing(this);\n            this.onStartDrawing();\n        },\n\n        commitDrawing: function (e) {\n            this.onCommitDrawing(e);\n            this.endDrawing();\n        },\n\n        cancelDrawing: function () {\n            // If called during a vertex drag, the vertex will be removed before\n            // the mouseup fires on it. This is a workaround. Maybe better fix is\n            // To have L.Draggable reset it's status on disable (Leaflet side).\n            L.Draggable._dragging = false;\n            this.onCancelDrawing();\n            this.endDrawing();\n        },\n\n        endDrawing: function () {\n            this._drawing = false;\n            this.tools.unregisterForDrawing(this);\n            this.onEndDrawing();\n        },\n\n        onDrawingClick: function (e) {\n            if (!this.drawing()) return;\n            L.Editable.makeCancellable(e);\n            // 🍂namespace Editable\n            // 🍂section Drawing events\n            // 🍂event editable:drawing:click: CancelableEvent\n            // Fired when user `click` while drawing, before any internal action is being processed.\n            this.fireAndForward('editable:drawing:click', e);\n            if (e._cancelled) return;\n            if (!this.isConnected()) this.connect(e);\n            this.processDrawingClick(e);\n        },\n\n        isConnected: function () {\n            return this.map.hasLayer(this.feature);\n        },\n\n        connect: function (e) {\n            this.tools.connectCreatedToMap(this.feature);\n            this.tools.editLayer.addLayer(this.editLayer);\n        },\n\n        onMove: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Drawing events\n            // 🍂event editable:drawing:move: Event\n            // Fired when `move` mouse while drawing, while dragging a marker, and while dragging a vertex.\n            this.fireAndForward('editable:drawing:move', e);\n        },\n\n        onDrawingMouseMove: function (e) {\n            this.onMove(e);\n        },\n\n        _getEvents: function () {\n            return {\n                dragstart: this.onDragStart,\n                drag: this.onDrag,\n                dragend: this.onDragEnd,\n                remove: this.disable\n            };\n        },\n\n        onDragStart: function (e) {\n            this.onEditing();\n            // 🍂namespace Editable\n            // 🍂event editable:dragstart: Event\n            // Fired before a path feature is dragged.\n            this.fireAndForward('editable:dragstart', e);\n        },\n\n        onDrag: function (e) {\n            this.onMove(e);\n            // 🍂namespace Editable\n            // 🍂event editable:drag: Event\n            // Fired when a path feature is being dragged.\n            this.fireAndForward('editable:drag', e);\n        },\n\n        onDragEnd: function (e) {\n            // 🍂namespace Editable\n            // 🍂event editable:dragend: Event\n            // Fired after a path feature has been dragged.\n            this.fireAndForward('editable:dragend', e);\n        }\n\n    });\n\n    // 🍂namespace Editable; 🍂class MarkerEditor; 🍂aka L.Editable.MarkerEditor\n    // 🍂inherits BaseEditor\n    // Editor for Marker.\n    L.Editable.MarkerEditor = L.Editable.BaseEditor.extend({\n\n        onDrawingMouseMove: function (e) {\n            L.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this, e);\n            if (this._drawing) this.feature.setLatLng(e.latlng);\n        },\n\n        processDrawingClick: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Drawing events\n            // 🍂event editable:drawing:clicked: Event\n            // Fired when user `click` while drawing, after all internal actions.\n            this.fireAndForward('editable:drawing:clicked', e);\n            this.commitDrawing(e);\n        },\n\n        connect: function (e) {\n            // On touch, the latlng has not been updated because there is\n            // no mousemove.\n            if (e) this.feature._latlng = e.latlng;\n            L.Editable.BaseEditor.prototype.connect.call(this, e);\n        }\n\n    });\n\n    // 🍂namespace Editable; 🍂class PathEditor; 🍂aka L.Editable.PathEditor\n    // 🍂inherits BaseEditor\n    // Base class for all path editors.\n    L.Editable.PathEditor = L.Editable.BaseEditor.extend({\n\n        CLOSED: false,\n        MIN_VERTEX: 2,\n\n        addHooks: function () {\n            L.Editable.BaseEditor.prototype.addHooks.call(this);\n            if (this.feature) this.initVertexMarkers();\n            return this;\n        },\n\n        initVertexMarkers: function (latlngs) {\n            if (!this.enabled()) return;\n            latlngs = latlngs || this.getLatLngs();\n            if (isFlat(latlngs)) this.addVertexMarkers(latlngs);\n            else for (var i = 0; i < latlngs.length; i++) this.initVertexMarkers(latlngs[i]);\n        },\n\n        getLatLngs: function () {\n            return this.feature.getLatLngs();\n        },\n\n        // 🍂method reset()\n        // Rebuild edit elements (Vertex, MiddleMarker, etc.).\n        reset: function () {\n            this.editLayer.clearLayers();\n            this.initVertexMarkers();\n        },\n\n        addVertexMarker: function (latlng, latlngs) {\n            return new this.tools.options.vertexMarkerClass(latlng, latlngs, this);\n        },\n\n        onNewVertex: function (vertex) {\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:new: VertexEvent\n            // Fired when a new vertex is created.\n            this.fireAndForward('editable:vertex:new', {latlng: vertex.latlng, vertex: vertex});\n        },\n\n        addVertexMarkers: function (latlngs) {\n            for (var i = 0; i < latlngs.length; i++) {\n                this.addVertexMarker(latlngs[i], latlngs);\n            }\n        },\n\n        refreshVertexMarkers: function (latlngs) {\n            latlngs = latlngs || this.getDefaultLatLngs();\n            for (var i = 0; i < latlngs.length; i++) {\n                latlngs[i].__vertex.update();\n            }\n        },\n\n        addMiddleMarker: function (left, right, latlngs) {\n            return new this.tools.options.middleMarkerClass(left, right, latlngs, this);\n        },\n\n        onVertexMarkerClick: function (e) {\n            L.Editable.makeCancellable(e);\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:click: CancelableVertexEvent\n            // Fired when a `click` is issued on a vertex, before any internal action is being processed.\n            this.fireAndForward('editable:vertex:click', e);\n            if (e._cancelled) return;\n            if (this.tools.drawing() && this.tools._drawingEditor !== this) return;\n            var index = e.vertex.getIndex(), commit;\n            if (e.originalEvent.ctrlKey) {\n                this.onVertexMarkerCtrlClick(e);\n            } else if (e.originalEvent.altKey) {\n                this.onVertexMarkerAltClick(e);\n            } else if (e.originalEvent.shiftKey) {\n                this.onVertexMarkerShiftClick(e);\n            } else if (e.originalEvent.metaKey) {\n                this.onVertexMarkerMetaKeyClick(e);\n            } else if (index === e.vertex.getLastIndex() && this._drawing === L.Editable.FORWARD) {\n                if (index >= this.MIN_VERTEX - 1) commit = true;\n            } else if (index === 0 && this._drawing === L.Editable.BACKWARD && this._drawnLatLngs.length >= this.MIN_VERTEX) {\n                commit = true;\n            } else if (index === 0 && this._drawing === L.Editable.FORWARD && this._drawnLatLngs.length >= this.MIN_VERTEX && this.CLOSED) {\n                commit = true;  // Allow to close on first point also for polygons\n            } else {\n                this.onVertexRawMarkerClick(e);\n            }\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:clicked: VertexEvent\n            // Fired when a `click` is issued on a vertex, after all internal actions.\n            this.fireAndForward('editable:vertex:clicked', e);\n            if (commit) this.commitDrawing(e);\n        },\n\n        onVertexRawMarkerClick: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:rawclick: CancelableVertexEvent\n            // Fired when a `click` is issued on a vertex without any special key and without being in drawing mode.\n            this.fireAndForward('editable:vertex:rawclick', e);\n            if (e._cancelled) return;\n            if (!this.vertexCanBeDeleted(e.vertex)) return;\n            e.vertex.delete();\n        },\n\n        vertexCanBeDeleted: function (vertex) {\n            return vertex.latlngs.length > this.MIN_VERTEX;\n        },\n\n        onVertexDeleted: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:deleted: VertexEvent\n            // Fired after a vertex has been deleted by user.\n            this.fireAndForward('editable:vertex:deleted', e);\n        },\n\n        onVertexMarkerCtrlClick: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:ctrlclick: VertexEvent\n            // Fired when a `click` with `ctrlKey` is issued on a vertex.\n            this.fireAndForward('editable:vertex:ctrlclick', e);\n        },\n\n        onVertexMarkerShiftClick: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:shiftclick: VertexEvent\n            // Fired when a `click` with `shiftKey` is issued on a vertex.\n            this.fireAndForward('editable:vertex:shiftclick', e);\n        },\n\n        onVertexMarkerMetaKeyClick: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:metakeyclick: VertexEvent\n            // Fired when a `click` with `metaKey` is issued on a vertex.\n            this.fireAndForward('editable:vertex:metakeyclick', e);\n        },\n\n        onVertexMarkerAltClick: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:altclick: VertexEvent\n            // Fired when a `click` with `altKey` is issued on a vertex.\n            this.fireAndForward('editable:vertex:altclick', e);\n        },\n\n        onVertexMarkerContextMenu: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:contextmenu: VertexEvent\n            // Fired when a `contextmenu` is issued on a vertex.\n            this.fireAndForward('editable:vertex:contextmenu', e);\n        },\n\n        onVertexMarkerMouseDown: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:mousedown: VertexEvent\n            // Fired when user `mousedown` a vertex.\n            this.fireAndForward('editable:vertex:mousedown', e);\n        },\n\n        onMiddleMarkerMouseDown: function (e) {\n            // 🍂namespace Editable\n            // 🍂section MiddleMarker events\n            // 🍂event editable:middlemarker:mousedown: VertexEvent\n            // Fired when user `mousedown` a middle marker.\n            this.fireAndForward('editable:middlemarker:mousedown', e);\n        },\n\n        onVertexMarkerDrag: function (e) {\n            this.onMove(e);\n            if (this.feature._bounds) this.extendBounds(e);\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:drag: VertexEvent\n            // Fired when a vertex is dragged by user.\n            this.fireAndForward('editable:vertex:drag', e);\n        },\n\n        onVertexMarkerDragStart: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:dragstart: VertexEvent\n            // Fired before a vertex is dragged by user.\n            this.fireAndForward('editable:vertex:dragstart', e);\n        },\n\n        onVertexMarkerDragEnd: function (e) {\n            // 🍂namespace Editable\n            // 🍂section Vertex events\n            // 🍂event editable:vertex:dragend: VertexEvent\n            // Fired after a vertex is dragged by user.\n            this.fireAndForward('editable:vertex:dragend', e);\n        },\n\n        setDrawnLatLngs: function (latlngs) {\n            this._drawnLatLngs = latlngs || this.getDefaultLatLngs();\n        },\n\n        startDrawing: function () {\n            if (!this._drawnLatLngs) this.setDrawnLatLngs();\n            L.Editable.BaseEditor.prototype.startDrawing.call(this);\n        },\n\n        startDrawingForward: function () {\n            this.startDrawing();\n        },\n\n        endDrawing: function () {\n            this.tools.detachForwardLineGuide();\n            this.tools.detachBackwardLineGuide();\n            if (this._drawnLatLngs && this._drawnLatLngs.length < this.MIN_VERTEX) this.deleteShape(this._drawnLatLngs);\n            L.Editable.BaseEditor.prototype.endDrawing.call(this);\n            delete this._drawnLatLngs;\n        },\n\n        addLatLng: function (latlng) {\n            if (this._drawing === L.Editable.FORWARD) this._drawnLatLngs.push(latlng);\n            else this._drawnLatLngs.unshift(latlng);\n            this.feature._bounds.extend(latlng);\n            var vertex = this.addVertexMarker(latlng, this._drawnLatLngs);\n            this.onNewVertex(vertex);\n            this.refresh();\n        },\n\n        newPointForward: function (latlng) {\n            this.addLatLng(latlng);\n            this.tools.attachForwardLineGuide();\n            this.tools.anchorForwardLineGuide(latlng);\n        },\n\n        newPointBackward: function (latlng) {\n            this.addLatLng(latlng);\n            this.tools.anchorBackwardLineGuide(latlng);\n        },\n\n        // 🍂namespace PathEditor\n        // 🍂method push()\n        // Programmatically add a point while drawing.\n        push: function (latlng) {\n            if (!latlng) return console.error('L.Editable.PathEditor.push expect a vaild latlng as parameter');\n            if (this._drawing === L.Editable.FORWARD) this.newPointForward(latlng);\n            else this.newPointBackward(latlng);\n        },\n\n        removeLatLng: function (latlng) {\n            latlng.__vertex.delete();\n            this.refresh();\n        },\n\n        // 🍂method pop(): L.LatLng or null\n        // Programmatically remove last point (if any) while drawing.\n        pop: function () {\n            if (this._drawnLatLngs.length <= 1) return;\n            var latlng;\n            if (this._drawing === L.Editable.FORWARD) latlng = this._drawnLatLngs[this._drawnLatLngs.length - 1];\n            else latlng = this._drawnLatLngs[0];\n            this.removeLatLng(latlng);\n            if (this._drawing === L.Editable.FORWARD) this.tools.anchorForwardLineGuide(this._drawnLatLngs[this._drawnLatLngs.length - 1]);\n            else this.tools.anchorForwardLineGuide(this._drawnLatLngs[0]);\n            return latlng;\n        },\n\n        processDrawingClick: function (e) {\n            if (e.vertex && e.vertex.editor === this) return;\n            if (this._drawing === L.Editable.FORWARD) this.newPointForward(e.latlng);\n            else this.newPointBackward(e.latlng);\n            this.fireAndForward('editable:drawing:clicked', e);\n        },\n\n        onDrawingMouseMove: function (e) {\n            L.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this, e);\n            if (this._drawing) {\n                this.tools.moveForwardLineGuide(e.latlng);\n                this.tools.moveBackwardLineGuide(e.latlng);\n            }\n        },\n\n        refresh: function () {\n            this.feature.redraw();\n            this.onEditing();\n        },\n\n        // 🍂namespace PathEditor\n        // 🍂method newShape(latlng?: L.LatLng)\n        // Add a new shape (Polyline, Polygon) in a multi, and setup up drawing tools to draw it;\n        // if optional `latlng` is given, start a path at this point.\n        newShape: function (latlng) {\n            var shape = this.addNewEmptyShape();\n            if (!shape) return;\n            this.setDrawnLatLngs(shape[0] || shape);  // Polygon or polyline\n            this.startDrawingForward();\n            // 🍂namespace Editable\n            // 🍂section Shape events\n            // 🍂event editable:shape:new: ShapeEvent\n            // Fired when a new shape is created in a multi (Polygon or Polyline).\n            this.fireAndForward('editable:shape:new', {shape: shape});\n            if (latlng) this.newPointForward(latlng);\n        },\n\n        deleteShape: function (shape, latlngs) {\n            var e = {shape: shape};\n            L.Editable.makeCancellable(e);\n            // 🍂namespace Editable\n            // 🍂section Shape events\n            // 🍂event editable:shape:delete: CancelableShapeEvent\n            // Fired before a new shape is deleted in a multi (Polygon or Polyline).\n            this.fireAndForward('editable:shape:delete', e);\n            if (e._cancelled) return;\n            shape = this._deleteShape(shape, latlngs);\n            if (this.ensureNotFlat) this.ensureNotFlat();  // Polygon.\n            this.feature.setLatLngs(this.getLatLngs());  // Force bounds reset.\n            this.refresh();\n            this.reset();\n            // 🍂namespace Editable\n            // 🍂section Shape events\n            // 🍂event editable:shape:deleted: ShapeEvent\n            // Fired after a new shape is deleted in a multi (Polygon or Polyline).\n            this.fireAndForward('editable:shape:deleted', {shape: shape});\n            return shape;\n        },\n\n        _deleteShape: function (shape, latlngs) {\n            latlngs = latlngs || this.getLatLngs();\n            if (!latlngs.length) return;\n            var self = this,\n                inplaceDelete = function (latlngs, shape) {\n                    // Called when deleting a flat latlngs\n                    shape = latlngs.splice(0, Number.MAX_VALUE);\n                    return shape;\n                },\n                spliceDelete = function (latlngs, shape) {\n                    // Called when removing a latlngs inside an array\n                    latlngs.splice(latlngs.indexOf(shape), 1);\n                    if (!latlngs.length) self._deleteShape(latlngs);\n                    return shape;\n                };\n            if (latlngs === shape) return inplaceDelete(latlngs, shape);\n            for (var i = 0; i < latlngs.length; i++) {\n                if (latlngs[i] === shape) return spliceDelete(latlngs, shape);\n                else if (latlngs[i].indexOf(shape) !== -1) return spliceDelete(latlngs[i], shape);\n            }\n        },\n\n        // 🍂namespace PathEditor\n        // 🍂method deleteShapeAt(latlng: L.LatLng): Array\n        // Remove a path shape at the given `latlng`.\n        deleteShapeAt: function (latlng) {\n            var shape = this.feature.shapeAt(latlng);\n            if (shape) return this.deleteShape(shape);\n        },\n\n        // 🍂method appendShape(shape: Array)\n        // Append a new shape to the Polygon or Polyline.\n        appendShape: function (shape) {\n            this.insertShape(shape);\n        },\n\n        // 🍂method prependShape(shape: Array)\n        // Prepend a new shape to the Polygon or Polyline.\n        prependShape: function (shape) {\n            this.insertShape(shape, 0);\n        },\n\n        // 🍂method insertShape(shape: Array, index: int)\n        // Insert a new shape to the Polygon or Polyline at given index (default is to append).\n        insertShape: function (shape, index) {\n            this.ensureMulti();\n            shape = this.formatShape(shape);\n            if (typeof index === 'undefined') index = this.feature._latlngs.length;\n            this.feature._latlngs.splice(index, 0, shape);\n            this.feature.redraw();\n            if (this._enabled) this.reset();\n        },\n\n        extendBounds: function (e) {\n            this.feature._bounds.extend(e.vertex.latlng);\n        },\n\n        onDragStart: function (e) {\n            this.editLayer.clearLayers();\n            L.Editable.BaseEditor.prototype.onDragStart.call(this, e);\n        },\n\n        onDragEnd: function (e) {\n            this.initVertexMarkers();\n            L.Editable.BaseEditor.prototype.onDragEnd.call(this, e);\n        }\n\n    });\n\n    // 🍂namespace Editable; 🍂class PolylineEditor; 🍂aka L.Editable.PolylineEditor\n    // 🍂inherits PathEditor\n    L.Editable.PolylineEditor = L.Editable.PathEditor.extend({\n\n        startDrawingBackward: function () {\n            this._drawing = L.Editable.BACKWARD;\n            this.startDrawing();\n        },\n\n        // 🍂method continueBackward(latlngs?: Array)\n        // Set up drawing tools to continue the line backward.\n        continueBackward: function (latlngs) {\n            if (this.drawing()) return;\n            latlngs = latlngs || this.getDefaultLatLngs();\n            this.setDrawnLatLngs(latlngs);\n            if (latlngs.length > 0) {\n                this.tools.attachBackwardLineGuide();\n                this.tools.anchorBackwardLineGuide(latlngs[0]);\n            }\n            this.startDrawingBackward();\n        },\n\n        // 🍂method continueForward(latlngs?: Array)\n        // Set up drawing tools to continue the line forward.\n        continueForward: function (latlngs) {\n            if (this.drawing()) return;\n            latlngs = latlngs || this.getDefaultLatLngs();\n            this.setDrawnLatLngs(latlngs);\n            if (latlngs.length > 0) {\n                this.tools.attachForwardLineGuide();\n                this.tools.anchorForwardLineGuide(latlngs[latlngs.length - 1]);\n            }\n            this.startDrawingForward();\n        },\n\n        getDefaultLatLngs: function (latlngs) {\n            latlngs = latlngs || this.feature._latlngs;\n            if (!latlngs.length || latlngs[0] instanceof L.LatLng) return latlngs;\n            else return this.getDefaultLatLngs(latlngs[0]);\n        },\n\n        ensureMulti: function () {\n            if (this.feature._latlngs.length && isFlat(this.feature._latlngs)) {\n                this.feature._latlngs = [this.feature._latlngs];\n            }\n        },\n\n        addNewEmptyShape: function () {\n            if (this.feature._latlngs.length) {\n                var shape = [];\n                this.appendShape(shape);\n                return shape;\n            } else {\n                return this.feature._latlngs;\n            }\n        },\n\n        formatShape: function (shape) {\n            if (isFlat(shape)) return shape;\n            else if (shape[0]) return this.formatShape(shape[0]);\n        },\n\n        // 🍂method splitShape(latlngs?: Array, index: int)\n        // Split the given `latlngs` shape at index `index` and integrate new shape in instance `latlngs`.\n        splitShape: function (shape, index) {\n            if (!index || index >= shape.length - 1) return;\n            this.ensureMulti();\n            var shapeIndex = this.feature._latlngs.indexOf(shape);\n            if (shapeIndex === -1) return;\n            var first = shape.slice(0, index + 1),\n                second = shape.slice(index);\n            // We deal with reference, we don't want twice the same latlng around.\n            second[0] = L.latLng(second[0].lat, second[0].lng, second[0].alt);\n            this.feature._latlngs.splice(shapeIndex, 1, first, second);\n            this.refresh();\n            this.reset();\n        }\n\n    });\n\n    // 🍂namespace Editable; 🍂class PolygonEditor; 🍂aka L.Editable.PolygonEditor\n    // 🍂inherits PathEditor\n    L.Editable.PolygonEditor = L.Editable.PathEditor.extend({\n\n        CLOSED: true,\n        MIN_VERTEX: 3,\n\n        newPointForward: function (latlng) {\n            L.Editable.PathEditor.prototype.newPointForward.call(this, latlng);\n            if (!this.tools.backwardLineGuide._latlngs.length) this.tools.anchorBackwardLineGuide(latlng);\n            if (this._drawnLatLngs.length === 2) this.tools.attachBackwardLineGuide();\n        },\n\n        addNewEmptyHole: function (latlng) {\n            this.ensureNotFlat();\n            var latlngs = this.feature.shapeAt(latlng);\n            if (!latlngs) return;\n            var holes = [];\n            latlngs.push(holes);\n            return holes;\n        },\n\n        // 🍂method newHole(latlng?: L.LatLng, index: int)\n        // Set up drawing tools for creating a new hole on the Polygon. If the `latlng` param is given, a first point is created.\n        newHole: function (latlng) {\n            var holes = this.addNewEmptyHole(latlng);\n            if (!holes) return;\n            this.setDrawnLatLngs(holes);\n            this.startDrawingForward();\n            if (latlng) this.newPointForward(latlng);\n        },\n\n        addNewEmptyShape: function () {\n            if (this.feature._latlngs.length && this.feature._latlngs[0].length) {\n                var shape = [];\n                this.appendShape(shape);\n                return shape;\n            } else {\n                return this.feature._latlngs;\n            }\n        },\n\n        ensureMulti: function () {\n            if (this.feature._latlngs.length && isFlat(this.feature._latlngs[0])) {\n                this.feature._latlngs = [this.feature._latlngs];\n            }\n        },\n\n        ensureNotFlat: function () {\n            if (!this.feature._latlngs.length || isFlat(this.feature._latlngs)) this.feature._latlngs = [this.feature._latlngs];\n        },\n\n        vertexCanBeDeleted: function (vertex) {\n            var parent = this.feature.parentShape(vertex.latlngs),\n                idx = L.Util.indexOf(parent, vertex.latlngs);\n            if (idx > 0) return true;  // Holes can be totally deleted without removing the layer itself.\n            return L.Editable.PathEditor.prototype.vertexCanBeDeleted.call(this, vertex);\n        },\n\n        getDefaultLatLngs: function () {\n            if (!this.feature._latlngs.length) this.feature._latlngs.push([]);\n            return this.feature._latlngs[0];\n        },\n\n        formatShape: function (shape) {\n            // [[1, 2], [3, 4]] => must be nested\n            // [] => must be nested\n            // [[]] => is already nested\n            if (isFlat(shape) && (!shape[0] || shape[0].length !== 0)) return [shape];\n            else return shape;\n        }\n\n    });\n\n    // 🍂namespace Editable; 🍂class RectangleEditor; 🍂aka L.Editable.RectangleEditor\n    // 🍂inherits PathEditor\n    L.Editable.RectangleEditor = L.Editable.PathEditor.extend({\n\n        CLOSED: true,\n        MIN_VERTEX: 4,\n\n        options: {\n            skipMiddleMarkers: true\n        },\n\n        extendBounds: function (e) {\n            var index = e.vertex.getIndex(),\n                next = e.vertex.getNext(),\n                previous = e.vertex.getPrevious(),\n                oppositeIndex = (index + 2) % 4,\n                opposite = e.vertex.latlngs[oppositeIndex],\n                bounds = new L.LatLngBounds(e.latlng, opposite);\n            // Update latlngs by hand to preserve order.\n            previous.latlng.update([e.latlng.lat, opposite.lng]);\n            next.latlng.update([opposite.lat, e.latlng.lng]);\n            this.updateBounds(bounds);\n            this.refreshVertexMarkers();\n        },\n\n        onDrawingMouseDown: function (e) {\n            L.Editable.PathEditor.prototype.onDrawingMouseDown.call(this, e);\n            this.connect();\n            var latlngs = this.getDefaultLatLngs();\n            // L.Polygon._convertLatLngs removes last latlng if it equals first point,\n            // which is the case here as all latlngs are [0, 0]\n            if (latlngs.length === 3) latlngs.push(e.latlng);\n            var bounds = new L.LatLngBounds(e.latlng, e.latlng);\n            this.updateBounds(bounds);\n            this.updateLatLngs(bounds);\n            this.refresh();\n            this.reset();\n            // Stop dragging map.\n            // L.Draggable has two workflows:\n            // - mousedown => mousemove => mouseup\n            // - touchstart => touchmove => touchend\n            // Problem: L.Map.Tap does not allow us to listen to touchstart, so we only\n            // can deal with mousedown, but then when in a touch device, we are dealing with\n            // simulated events (actually simulated by L.Map.Tap), which are no more taken\n            // into account by L.Draggable.\n            // Ref.: https://github.com/Leaflet/Leaflet.Editable/issues/103\n            e.originalEvent._simulated = false;\n            this.map.dragging._draggable._onUp(e.originalEvent);\n            // Now transfer ongoing drag action to the bottom right corner.\n            // Should we refine which corne will handle the drag according to\n            // drag direction?\n            latlngs[3].__vertex.dragging._draggable._onDown(e.originalEvent);\n        },\n\n        onDrawingMouseUp: function (e) {\n            this.commitDrawing(e);\n            e.originalEvent._simulated = false;\n            L.Editable.PathEditor.prototype.onDrawingMouseUp.call(this, e);\n        },\n\n        onDrawingMouseMove: function (e) {\n            e.originalEvent._simulated = false;\n            L.Editable.PathEditor.prototype.onDrawingMouseMove.call(this, e);\n        },\n\n\n        getDefaultLatLngs: function (latlngs) {\n            return latlngs || this.feature._latlngs[0];\n        },\n\n        updateBounds: function (bounds) {\n            this.feature._bounds = bounds;\n        },\n\n        updateLatLngs: function (bounds) {\n            var latlngs = this.getDefaultLatLngs(),\n                newLatlngs = this.feature._boundsToLatLngs(bounds);\n            // Keep references.\n            for (var i = 0; i < latlngs.length; i++) {\n                latlngs[i].update(newLatlngs[i]);\n            };\n        }\n\n    });\n\n    // 🍂namespace Editable; 🍂class CircleEditor; 🍂aka L.Editable.CircleEditor\n    // 🍂inherits PathEditor\n    L.Editable.CircleEditor = L.Editable.PathEditor.extend({\n\n        MIN_VERTEX: 2,\n\n        options: {\n            skipMiddleMarkers: true\n        },\n\n        initialize: function (map, feature, options) {\n            L.Editable.PathEditor.prototype.initialize.call(this, map, feature, options);\n            this._resizeLatLng = this.computeResizeLatLng();\n        },\n\n        computeResizeLatLng: function () {\n            // While circle is not added to the map, _radius is not set.\n            var delta = (this.feature._radius || this.feature._mRadius) * Math.cos(Math.PI / 4),\n                point = this.map.project(this.feature._latlng);\n            return this.map.unproject([point.x + delta, point.y - delta]);\n        },\n\n        updateResizeLatLng: function () {\n            this._resizeLatLng.update(this.computeResizeLatLng());\n            this._resizeLatLng.__vertex.update();\n        },\n\n        getLatLngs: function () {\n            return [this.feature._latlng, this._resizeLatLng];\n        },\n\n        getDefaultLatLngs: function () {\n            return this.getLatLngs();\n        },\n\n        onVertexMarkerDrag: function (e) {\n            if (e.vertex.getIndex() === 1) this.resize(e);\n            else this.updateResizeLatLng(e);\n            L.Editable.PathEditor.prototype.onVertexMarkerDrag.call(this, e);\n        },\n\n        resize: function (e) {\n            var radius = this.feature._latlng.distanceTo(e.latlng)\n            this.feature.setRadius(radius);\n        },\n\n        onDrawingMouseDown: function (e) {\n            L.Editable.PathEditor.prototype.onDrawingMouseDown.call(this, e);\n            this._resizeLatLng.update(e.latlng);\n            this.feature._latlng.update(e.latlng);\n            this.connect();\n            // Stop dragging map.\n            e.originalEvent._simulated = false;\n            this.map.dragging._draggable._onUp(e.originalEvent);\n            // Now transfer ongoing drag action to the radius handler.\n            this._resizeLatLng.__vertex.dragging._draggable._onDown(e.originalEvent);\n        },\n\n        onDrawingMouseUp: function (e) {\n            this.commitDrawing(e);\n            e.originalEvent._simulated = false;\n            L.Editable.PathEditor.prototype.onDrawingMouseUp.call(this, e);\n        },\n\n        onDrawingMouseMove: function (e) {\n            e.originalEvent._simulated = false;\n            L.Editable.PathEditor.prototype.onDrawingMouseMove.call(this, e);\n        },\n\n        onDrag: function (e) {\n            L.Editable.PathEditor.prototype.onDrag.call(this, e);\n            this.feature.dragging.updateLatLng(this._resizeLatLng);\n        }\n\n    });\n\n    // 🍂namespace Editable; 🍂class EditableMixin\n    // `EditableMixin` is included to `L.Polyline`, `L.Polygon`, `L.Rectangle`, `L.Circle`\n    // and `L.Marker`. It adds some methods to them.\n    // *When editing is enabled, the editor is accessible on the instance with the\n    // `editor` property.*\n    var EditableMixin = {\n\n        createEditor: function (map) {\n            map = map || this._map;\n            var tools = (this.options.editOptions || {}).editTools || map.editTools;\n            if (!tools) throw Error('Unable to detect Editable instance.')\n            var Klass = this.options.editorClass || this.getEditorClass(tools);\n            return new Klass(map, this, this.options.editOptions);\n        },\n\n        // 🍂method enableEdit(map?: L.Map): this.editor\n        // Enable editing, by creating an editor if not existing, and then calling `enable` on it.\n        enableEdit: function (map) {\n            if (!this.editor) this.createEditor(map);\n            this.editor.enable();\n            return this.editor;\n        },\n\n        // 🍂method editEnabled(): boolean\n        // Return true if current instance has an editor attached, and this editor is enabled.\n        editEnabled: function () {\n            return this.editor && this.editor.enabled();\n        },\n\n        // 🍂method disableEdit()\n        // Disable editing, also remove the editor property reference.\n        disableEdit: function () {\n            if (this.editor) {\n                this.editor.disable();\n                delete this.editor;\n            }\n        },\n\n        // 🍂method toggleEdit()\n        // Enable or disable editing, according to current status.\n        toggleEdit: function () {\n            if (this.editEnabled()) this.disableEdit();\n            else this.enableEdit();\n        },\n\n        _onEditableAdd: function () {\n            if (this.editor) this.enableEdit();\n        }\n\n    };\n\n    var PolylineMixin = {\n\n        getEditorClass: function (tools) {\n            return (tools && tools.options.polylineEditorClass) ? tools.options.polylineEditorClass : L.Editable.PolylineEditor;\n        },\n\n        shapeAt: function (latlng, latlngs) {\n            // We can have those cases:\n            // - latlngs are just a flat array of latlngs, use this\n            // - latlngs is an array of arrays of latlngs, loop over\n            var shape = null;\n            latlngs = latlngs || this._latlngs;\n            if (!latlngs.length) return shape;\n            else if (isFlat(latlngs) && this.isInLatLngs(latlng, latlngs)) shape = latlngs;\n            else for (var i = 0; i < latlngs.length; i++) if (this.isInLatLngs(latlng, latlngs[i])) return latlngs[i];\n            return shape;\n        },\n\n        isInLatLngs: function (l, latlngs) {\n            if (!latlngs) return false;\n            var i, k, len, part = [], p,\n                w = this._clickTolerance();\n            this._projectLatlngs(latlngs, part, this._pxBounds);\n            part = part[0];\n            p = this._map.latLngToLayerPoint(l);\n\n            if (!this._pxBounds.contains(p)) { return false; }\n            for (i = 1, len = part.length, k = 0; i < len; k = i++) {\n\n                if (L.LineUtil.pointToSegmentDistance(p, part[k], part[i]) <= w) {\n                    return true;\n                }\n            }\n            return false;\n        }\n\n    };\n\n    var PolygonMixin = {\n\n        getEditorClass: function (tools) {\n            return (tools && tools.options.polygonEditorClass) ? tools.options.polygonEditorClass : L.Editable.PolygonEditor;\n        },\n\n        shapeAt: function (latlng, latlngs) {\n            // We can have those cases:\n            // - latlngs are just a flat array of latlngs, use this\n            // - latlngs is an array of arrays of latlngs, this is a simple polygon (maybe with holes), use the first\n            // - latlngs is an array of arrays of arrays, this is a multi, loop over\n            var shape = null;\n            latlngs = latlngs || this._latlngs;\n            if (!latlngs.length) return shape;\n            else if (isFlat(latlngs) && this.isInLatLngs(latlng, latlngs)) shape = latlngs;\n            else if (isFlat(latlngs[0]) && this.isInLatLngs(latlng, latlngs[0])) shape = latlngs;\n            else for (var i = 0; i < latlngs.length; i++) if (this.isInLatLngs(latlng, latlngs[i][0])) return latlngs[i];\n            return shape;\n        },\n\n        isInLatLngs: function (l, latlngs) {\n            var inside = false, l1, l2, j, k, len2;\n\n            for (j = 0, len2 = latlngs.length, k = len2 - 1; j < len2; k = j++) {\n                l1 = latlngs[j];\n                l2 = latlngs[k];\n\n                if (((l1.lat > l.lat) !== (l2.lat > l.lat)) &&\n                        (l.lng < (l2.lng - l1.lng) * (l.lat - l1.lat) / (l2.lat - l1.lat) + l1.lng)) {\n                    inside = !inside;\n                }\n            }\n\n            return inside;\n        },\n\n        parentShape: function (shape, latlngs) {\n            latlngs = latlngs || this._latlngs;\n            if (!latlngs) return;\n            var idx = L.Util.indexOf(latlngs, shape);\n            if (idx !== -1) return latlngs;\n            for (var i = 0; i < latlngs.length; i++) {\n                idx = L.Util.indexOf(latlngs[i], shape);\n                if (idx !== -1) return latlngs[i];\n            }\n        }\n\n    };\n\n\n    var MarkerMixin = {\n\n        getEditorClass: function (tools) {\n            return (tools && tools.options.markerEditorClass) ? tools.options.markerEditorClass : L.Editable.MarkerEditor;\n        }\n\n    };\n\n    var RectangleMixin = {\n\n        getEditorClass: function (tools) {\n            return (tools && tools.options.rectangleEditorClass) ? tools.options.rectangleEditorClass : L.Editable.RectangleEditor;\n        }\n\n    };\n\n    var CircleMixin = {\n\n        getEditorClass: function (tools) {\n            return (tools && tools.options.circleEditorClass) ? tools.options.circleEditorClass : L.Editable.CircleEditor;\n        }\n\n    };\n\n    var keepEditable = function () {\n        // Make sure you can remove/readd an editable layer.\n        this.on('add', this._onEditableAdd);\n    };\n\n    var isFlat = L.LineUtil.isFlat || L.LineUtil._flat || L.Polyline._flat;  // <=> 1.1 compat.\n\n\n    if (L.Polyline) {\n        L.Polyline.include(EditableMixin);\n        L.Polyline.include(PolylineMixin);\n        L.Polyline.addInitHook(keepEditable);\n    }\n    if (L.Polygon) {\n        L.Polygon.include(EditableMixin);\n        L.Polygon.include(PolygonMixin);\n    }\n    if (L.Marker) {\n        L.Marker.include(EditableMixin);\n        L.Marker.include(MarkerMixin);\n        L.Marker.addInitHook(keepEditable);\n    }\n    if (L.Rectangle) {\n        L.Rectangle.include(EditableMixin);\n        L.Rectangle.include(RectangleMixin);\n    }\n    if (L.Circle) {\n        L.Circle.include(EditableMixin);\n        L.Circle.include(CircleMixin);\n    }\n\n    L.LatLng.prototype.update = function (latlng) {\n        latlng = L.latLng(latlng);\n        this.lat = latlng.lat;\n        this.lng = latlng.lng;\n    }\n\n}, window));\n"]}