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AK,KAAK,GAAI,YAAa,EAAK,qBAAsB,GAElD,IAKP,EAAE,IAAI,aAAa,CAClB,wBAAwB,IAGzB,EAAE,IAAI,aAAY,WACjB,IAAI,EAAO,KACP,EAAK,QAAQ,yBAChB,EAAK,UAAY,IAAI,EAAE,QAAQ,gBAC/B,EAAK,WAAW,EAAK,WAEvB,IAEA,EAAE,QAAQ,gBAAkB,SAAU,GACrC,OAAO,IAAI,EAAE,QAAQ,gBAAiB,EACvC,CACD","file":"/npm/leaflet.measure@1.0.0/Leaflet.PolylineMeasure.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/leaflet.measure@1.0.0/Leaflet.PolylineMeasure.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function (factory) {\n    if (typeof define === 'function' && define.amd) {\n        // AMD\n        define(['leaflet'], factory);\n    } else if (typeof module !== 'undefined') {\n        // Node/CommonJS\n        module.exports = factory(require('leaflet'));\n    } else {\n        // Browser globals\n        if (typeof window.L === 'undefined') {\n            throw new Error('Leaflet must be loaded first');\n        }\n        factory(window.L);\n    }\n}(function (L) {\n\tvar _measureControlId = 'polyline-measure-control';\n\tvar _unicodeClass = 'polyline-measure-unicode-icon';\n\tvar self;\n\t/**\n\t * Polyline Measure class\n\t * @extends L.Control\n\t */\n\tL.Control.PolylineMeasure = L.Control.extend({\n\n\t\t/**\n\t\t * Default options for the tool\n\t\t * @type {Object}\n\t\t */\n\t\toptions: {\n\t\t\t/**\n\t\t\t * Position to show the control. Possible values are: 'topright', 'topleft', 'bottomright', 'bottomleft'\n\t\t\t * @type {String}\n\t\t\t * @default\n\t\t\t */\n\t\t\tposition: 'topleft',\n\t\t\t/**\n\t\t\t * Which units the distances are displayed in. Possible values are: 'metres', 'landmiles', 'nauticalmiles'\n\t\t\t * @type {String}\n\t\t\t * @default\n\t\t\t */\n\t\t\tunit: 'metres',\n\t\t\t/**\n\t\t\t * Title for the control going to be switched on\n\t\t\t * @type {String}\n\t\t\t * @default\n\t\t\t */\n\t\t\tmeasureControlTitleOn: \"Turn on PolylineMeasure\",\n\t\t\t/**\n\t\t\t * Title for the control going to be switched off\n\t\t\t * @type {String}\n\t\t\t * @default\n\t\t\t */\n\t\t\tmeasureControlTitleOff: \"Turn off PolylineMeasure\",\n\t\t\t/**\n\t\t\t * HTML to place inside the control. This should just be a unicode icon\n\t\t\t * @type {String}\n\t\t\t * @default\n\t\t\t */\n\t\t\tmeasureControlLabel: '&#8614;',\n\t\t\t/**\n\t\t\t * Classes to apply to the control\n\t\t\t * @type {Array}\n\t\t\t * @default\n\t\t\t */\n\t\t\tmeasureControlClasses: [],\n\t\t\t/**\n\t\t\t * Background color for control when selected\n\t\t\t * @type {String}\n\t\t\t * @default\n\t\t\t */\n\t\t\tbackgroundColor: '#8f8',\n\t\t\t/**\n\t\t\t * Cursor type to show when creating measurements\n\t\t\t * @type {String}\n\t\t\t * @default\n\t\t\t */\n\t\t\tcursor: 'crosshair',\n\t\t\t/**\n\t\t\t * Clear the measurements on stop\n\t\t\t * @type {Boolean}\n\t\t\t * @default\n\t\t\t */\n\t\t\tclearMeasurementsOnStop: true,\n\t\t\t/**\n\t\t\t * Show a control to clear all the measurements\n\t\t\t * @type {Boolean}\n\t\t\t * @default\n\t\t\t */\n\t\t\tshowMeasurementsClearControl: false,\n\t\t\t/**\n\t\t\t * Title text to show on the clear measurements control button\n\t\t\t * @type {String}\n\t\t\t * @default\n \t\t\t */\n\t\t\tclearControlTitle: 'Clear Measurements',\n\t\t\t/**\n\t\t\t * Clear control inner html\n\t\t\t * @type {String}\n\t\t\t * @default\n \t\t\t */\n\t\t\tclearControlLabel: '&times;',\n\t\t\t/**\n\t\t\t * Collection of classes to add to clear control button\n\t\t\t * @type {Array}\n\t\t\t * @default\n\t\t\t */\n\t\t\tclearControlClasses: [],\n\t\t\t/**\n\t\t\t * Show a control to change the units of measurements\n\t\t\t * @type {Boolean}\n\t\t\t * @default\n\t\t\t */\n\t\t\tshowUnitControl: false,\n\t\t\t/**\n\t\t\t * Styling settings for the temporary dashed line\n             * @type {Object}\n\t\t\t */\n\t\t\ttempLine: {\n\t\t\t\t/**\n\t\t\t\t * Dashed line color\n\t\t\t\t * @type {String}\n\t\t\t\t * @default\n\t\t\t\t */\n\t\t\t\tcolor: '#00f',\n\t\t\t\t/**\n\t\t\t\t * Dashed line weight\n\t\t\t\t * @type {Number}\n\t\t\t\t * @default\n\t\t\t\t */\n\t\t\t\tweight: 2\n\t\t\t},\n\t\t\t/**\n\t\t\t * Styling for the solid line\n\t\t\t * @type {Object}\n\t\t\t */\n\t\t\tfixedLine: {\n\t\t\t\t/**\n\t\t\t\t * Solid line color\n\t\t\t\t * @type {String}\n\t\t\t\t * @default\n\t\t\t\t */\n\t\t\t\tcolor: '#006',\n\t\t\t\t/**\n\t\t\t\t * Solid line weight\n\t\t\t\t * @type {Number}\n\t\t\t\t * @default\n\t\t\t\t */\n\t\t\t\tweight: 2\n\t\t\t},\n            /**\n             * Style settings for circle marker indicating the starting point of the polyline\n             * @type {Object}\n             */\n\t\t\tstartCircle: {\n                /**\n                 * Color of the border of the circle\n                 * @type {String}\n                 * @default\n                 */\n\t\t\t\tcolor: '#000',\n                /**\n                 * Weight of the circle\n                 * @type {Number}\n                 * @default\n                 */\n\t\t\t\tweight: 1,\n                /**\n                 * Fill color of the circle\n                 * @type {String}\n                 * @default\n                 */\n\t\t\t\tfillColor: '#0f0',\n                /**\n                 * Fill opacity of the circle\n                 * @type {Number}\n                 * @default\n                 */\n\t\t\t\tfillOpacity: 1,\n                /**\n                 * Radius of the circle\n                 * @type {Number}\n                 * @default\n                 */\n\t\t\t\tradius: 3\n\t\t\t},\n            /**\n             * Style settings for all circle markers between startCircle and endCircle\n             * @type {Object}\n             */\n            intermedCircle: {\n                /**\n                 * Color of the border of the circle\n                 * @type {String}\n                 * @default\n                 */\n\t\t\t\tcolor: '#000',\n                /**\n                 * Weight of the circle\n                 * @type {Number}\n                 * @default\n                 */\n\t\t\t\tweight: 1,\n                /**\n                 * Fill color of the circle\n                 * @type {String}\n                 * @default\n                 */\n\t\t\t\tfillColor: '#ff0',\n                /**\n                 * Fill opacity of the circle\n                 * @type {Number}\n                 * @default\n                 */\n\t\t\t\tfillOpacity: 1,\n                /**\n                 * Radius of the circle\n                 * @type {Number}\n                 * @default\n                 */\n\t\t\t\tradius: 3\n\t\t\t},\n            /**\n             * Style settings for circle marker indicating the latest point of the polyline during drawing a line\n             * @type {Object}\n             */\n\t\t\tcurrentCircle: {\n                /**\n                 * Color of the border of the circle\n                 * @type {String}\n                 * @default\n                 */\n                color: '#000',\n                /**\n                 * Weight of the circle\n                 * @type {Number}\n                 * @default\n                 */\n                weight: 1,\n                /**\n                 * Fill color of the circle\n                 * @type {String}\n                 * @default\n                 */\n                fillColor: '#f0f',\n                /**\n                 * Fill opacity of the circle\n                 * @type {Number}\n                 * @default\n                 */\n                fillOpacity: 1,\n                /**\n                 * Radius of the circle\n                 * @type {Number}\n                 * @default\n                 */\n                radius: 6\n\t\t\t},\n            /**\n             * Style settings for circle marker indicating the end point of the polyline\n             * @type {Object}\n             */\n\t\t\tendCircle: {\n                /**\n                 * Color of the border of the circle\n                 * @type {String}\n                 * @default\n                 */\n                color: '#000',\n                /**\n                 * Weight of the circle\n                 * @type {Number}\n                 * @default\n                 */\n                weight: 1,\n                /**\n                 * Fill color of the circle\n                 * @type {String}\n                 * @default\n                 */\n                fillColor: '#f00',\n                /**\n                 * Fill opacity of the circle\n                 * @type {Number}\n                 * @default\n                 */\n                fillOpacity: 1,\n                /**\n                 * Radius of the circle\n                 * @type {Number}\n                 * @default\n                 */\n                radius: 3\n\t\t\t}\n\t\t},\n\t\t\n\t\t/**\n\t\t * Create a control button\n\t\t * @param {String} \t\tlabel\t\t    Label to add\n\t\t * @param {String} \t\ttitle\t\t\tTitle to show on hover\n\t\t * @param {Array} \t\tclassesToAdd\tCollection of classes to add\n\t\t * @param {Element} \tcontainer\t\tParent element\n\t\t * @param {Function} \tfn\t\t\t\tCallback function to run\n\t\t * @param {Object} \t\tcontext\t\t\tContext\n\t\t * @returns {Element}\t\t\t\t\tCreated element\n\t\t * @private\n\t\t */\n\t\t_createControl: function (label, title, classesToAdd, container, fn, context) {\n\t\t\tvar anchor = document.createElement('a');\n\t\t\tanchor.innerHTML = label;\n\t\t\tanchor.setAttribute('title', title);\n\t\t\tclassesToAdd.forEach(function(c) {\n\t\t\t\tanchor.classList.add(c);\n\t\t\t});\n\t\t\tL.DomEvent.on (anchor, 'click', fn, context);\n\t\t\tcontainer.appendChild(anchor);\n\t\t\treturn anchor;\n\t\t},\n\n\t\t/**\n\t\t * Method to fire on add to map\n\t\t * @param {Object} \t\tmap \tMap object\n\t\t * @returns {Element}\t\t\tContaining element\n\t\t */\n\t\tonAdd: function(map) {\n\t\t\tself = this;\n\t\t\tself._container = document.createElement('div');\n\t\t\tself._container.classList.add('leaflet-bar');\n\t\t\tL.DomEvent.disableClickPropagation(self._container); // otherwise drawing process would instantly start at controls' container or double click would zoom-in map\n\t\t\t\n\t\t\tvar title = self.options.measureControlTitleOn;\n\t\t\tvar label = self.options.measureControlLabel;\n\t\t\tvar classes = self.options.measureControlClasses;\n\t\t\tif (label.indexOf('&') != -1) {\n\t\t\t\tclasses.push(_unicodeClass);\n\t\t\t}\n\n\t\t\t// initialize state\n\t\t\tself._lines = [];\n            self._arrArrows = [];\n\t\t\tself._measureControl = self._createControl(label, title, classes, self._container, self._toggleMeasure, self);\n\t\t\tself._measureControl.setAttribute('id', _measureControlId);\n\t\t\t\n\t\t\tif (self.options.showMeasurementsClearControl) {\n\t\t\t\tvar title = self.options.clearControlTitle;\n                var label = self.options.clearControlLabel;\n                var classes = self.options.clearControlClasses;\n                if (label.indexOf('&') != -1) {\n                    classes.push(_unicodeClass);\n                }\n                self._clearMeasureControl = self._createControl(label, title, classes, self._container, self._clearAllMeasurements, self);\n                self._clearMeasureControl.classList.add('polyline-measure-clearControl')\n\t\t\t}\n\t\t\tif (self.options.showUnitControl) {\n\t\t\t\tvar title = \"Change units [\" + self.options.unit  + \"]\";\n\t\t\t\tif (self.options.unit==\"metres\") {\n\t\t\t\t\tvar label = \"m\";\n\t\t\t\t}  else if  (self.options.unit==\"landmiles\") {\n\t\t\t\t\tvar label = \"mi\";\n\t\t\t\t} else {\n\t\t\t\t\tvar label = \"nm\";\n\t\t\t\t}\n\t\t\t\tvar classes = [];\n\t\t\t\tself._unitControl = self._createControl(label, title, classes, self._container, self._changeUnit, self);\n\t\t\t\tself._unitControl.setAttribute('id', 'unitControlId');\n\t\t\t}\n\t\t\treturn self._container;\n\t\t},\n\n\t\t/**\n\t\t * Toggle the measure functionality on or off\n\t\t * @private\n\t\t */\n\t\t_toggleMeasure: function () {\n\t\t\tself._measuring = !self._measuring;\n            if (self._measuring) {   // if measuring is going to be switched on\n\t\t\t\tself._measureControl.style.backgroundColor = self.options.backgroundColor;\n\t\t\t\tself._measureControl.title = self.options.measureControlTitleOff;\n                self._oldCursor = self._map._container.style.cursor;          // save former cursor type\n                self._map._container.style.cursor = self.options.cursor;\n                self._doubleClickZoom = self._map.doubleClickZoom.enabled();  // save former status of doubleClickZoom\n                self._map.doubleClickZoom.disable();\n                // create LayerGroup \"layerPaint\" (only) the first time Measure Control is switched on\n                if (!self._layerPaint) {\n                    self._layerPaint = L.layerGroup().addTo(self._map);\n                }\n                self._map.on ('mousemove', self._mouseMove, self);   //  enable listing to 'mousemove', 'click', 'keydown' events\n                self._map.on ('click', self._mouseClick, self);\n                L.DomEvent.on (document, 'keydown', self._onKeyDown, self);\n                self._resetPathVariables();\n            } else {   // if measuring is going to be switched off\n\t\t\t\tself._measureControl.removeAttribute('style');\n\t\t\t\tself._measureControl.title = self.options.measureControlTitleOn;\n\t\t\t\tself._map._container.style.cursor = self._oldCursor;\n                self._map.off ('mousemove', self._mouseMove, self);\n                self._map.off ('click', self._mouseClick, self);\n                L.DomEvent.off (document, 'keydown', self._onKeyDown, self);\n                if(self._doubleClickZoom) {\n                    self._map.doubleClickZoom.enable();\n                }\n                if(self.options.clearMeasurementsOnStop && self._layerPaint) {\n                    self._clearAllMeasurements();\n                }\n                // to remove temp. Line if line at the moment is being drawn and not finished while clicking the control\n                if (self._cntCircle !== 0) {\n                    self._finishPath();\n                }\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Clear all measurements from the map\n\t\t */\n\t\t_clearAllMeasurements: function() {\n\t\t\tif ((self._cntCircle !== undefined) && (self._cntCircle !== 0)) {\n\t\t\t\t\tself._finishPath();\n            }\n            if (self._layerPaint) {\n\t\t\t\tself._layerPaint.clearLayers();\n\t\t\t}\n            self._lines = [];\n\t\t\tself._arrArrows = [];\n\t\t},\n\t\t\n\t\t_changeUnit: function() {\n\t\t\tif (self.options.unit == \"metres\") {\n\t\t\t\tself.options.unit = \"landmiles\";\n\t\t\t\tdocument.getElementById(\"unitControlId\").innerHTML = \"mi\";\n            } else if (self.options.unit == \"landmiles\") {\n\t\t\t\tself.options.unit = \"nauticalmiles\";\n\t\t\t\tdocument.getElementById(\"unitControlId\").innerHTML = \"nm\";\n\t\t\t} else {\n\t\t\t\tself.options.unit = \"metres\";\n\t\t\t\tdocument.getElementById(\"unitControlId\").innerHTML = \"m\";\n\t\t\t}\n\t\t\tself._unitControl.title = \"Change units [\" + self.options.unit  + \"]\";\n\t\t\tself._lines.map(function(line) {\n                var totalDistance = 0;\n\t\t\t\tline.points.map(function(point, point_index) {\n\t\t\t\t\tif (point_index > 0) {\n                        var distance = line.points[point_index - 1].distanceTo(line.points[point_index]);\n                        totalDistance += distance;\n                        self._updateTooltipDistance(line.tooltips[point_index - 1], totalDistance, distance);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\n        /**\n         * Event to fire when a keyboard key is depressed.\n         * Currently only watching for ESC key (= keyCode 27). 1st press finishes line, 2nd press turns Measuring off.\n         * @param {Object} e Event\n         * @private\n         */\n        _onKeyDown: function (e) {\n\t\t\tif(e.keyCode == 27) {\n\t\t\t\t// if NOT drawing a line (= there's no currentCircle)\n\t\t\t\tif(!self._currentLine) {\n                    self._toggleMeasure();\n\t\t\t\t} else {\n\t\t\t\t\tself._finishPath(e);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n        /**\n         * Get the distance in the format specified in the options\n         * @param {Number} distance Distance to convert\n         * @returns {{value: *, unit: *}}\n         * @private\n         */\n\t\t_getDistance: function (distance) {\n\t\t\tvar dist = distance;\n\t\t\tvar symbol;\n\t\t\tif (self.options.unit === 'nauticalmiles') {\n\t\t\t\tunit = \"nm\";\n\t\t\t\tif (dist >= 1852000) {\n\t\t\t\t\tdist = (dist/1852).toFixed(0);\n\t\t\t\t} else if (dist >= 185200) {\n\t\t\t\t\tdist = (dist/1852).toFixed(1);\n\t\t\t\t\t// don't use 3 decimal digits, cause especially in countries using the \".\" as thousands separator a number could optically be confused (e.g. \"1.234 nm\": is it 1234 nm or 1,234 nm ?)\n\t\t\t\t} else if (dist >= 1852) {\n\t\t\t\t\tdist = (dist/1852).toFixed(2);\n\t\t\t\t} else  {\n\t\t\t\t\tdist = (dist/0.3048).toFixed(0);\n\t\t\t\t\tunit = \"ft\";\n\t\t\t\t}\n\t\t\t} else if (self.options.unit === 'landmiles') {\n\t\t\t\tunit = \"mi\";\n\t\t\t\tif (dist >= 1609344) {\n\t\t\t\t\tdist = (dist/1609.344).toFixed(0);\n\t\t\t\t} else if (dist >= 160934.4) {\n\t\t\t\t\tdist = (dist/1609.344).toFixed(1);\n\t\t\t\t\t// don't use 3 decimal digits, cause especially in countries using the \".\" as thousands separator a number could optically be confused (e.g. \"1.234mi\": is it 1234mi or 1,234mi ?)\n\t\t\t\t} else if (dist >= 1609.344) {\n\t\t\t\t\tdist = (dist/1609.344).toFixed(2);\n\t\t\t\t} else {\n\t\t\t\t\tdist = (dist/0.3048).toFixed(0);\n\t\t\t\t\tunit = \"ft\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tunit = \"km\";\n\t\t\t\tif (dist >= 1000000) {\n\t\t\t\t\tdist = (dist/1000).toFixed(0);\n\t\t\t\t} else if (dist >= 100000) {\n\t\t\t\t\tdist = (dist/1000).toFixed(1);\n\t\t\t\t\t// don't use 3 decimal digits, cause especially in countries using the \".\" as thousands separator a number could optically be confused (e.g. \"1.234 km\": is it 1234 km or 1,234 km ?)\n\t\t\t\t} else if (dist >= 1000) {\n\t\t\t\t\tdist = (dist/1000).toFixed(2);\n\t\t\t\t} else {\n\t\t\t\t\tdist = (dist).toFixed(1);\n\t\t\t\t\tunit = \"m\";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {value:dist, unit:unit};\n\t\t},\n\n/**\n         * Calculate Great-circle Arc (= shortest distance on a sphere like the Earth) between two coordinates\n\t\t * formulas: http://www.edwilliams.org/avform.htm\n         * @private\n         */\t\t\n\t\t_polylineArc: function (_from, _to) {\n\t\t\t\n\t\t\tfunction _GCinterpolate (f) {\n\t\t\t\tA = Math.sin((1 - f) * d) / Math.sin(d);\n\t\t\t\tB = Math.sin(f * d) / Math.sin(d);\n\t\t\t\tx = A * Math.cos(fromLat) * Math.cos(fromLng) + B * Math.cos(toLat) * Math.cos(toLng);\n\t\t\t\ty = A * Math.cos(fromLat) * Math.sin(fromLng) + B * Math.cos(toLat) * Math.sin(toLng);\n\t\t\t\tz = A * Math.sin(fromLat) + B * Math.sin(toLat);\n\t\t\t\t// atan2 better than atan-function cause results are from -pi to +pi\n\t\t\t\t// => results of latInterpol, lngInterpol always within range -180° ... +180°  => conversion into values < -180° or > + 180° has to be done afterwards\n\t\t\t\tlatInterpol = 180 / Math.PI * Math.atan2(z, Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)));\n\t\t\t\tlngInterpol = 180 / Math.PI * Math.atan2(y, x);\n\t\t\t\t// don't split polyline if it crosses dateline ( -180° or +180°).  Without the polyline would look like: +179° ==> +180° ==> -180° ==> -179°...\n\t\t\t\t// algo: if difference lngInterpol-from.lng is > 180° there's been an unwanted split from +180 to -180 cause an arc can never span >180°\n\t\t\t\tdiff = lngInterpol-fromLng*180/Math.PI;\n\t\t\t\tfunction trunc(n) { return Math[n > 0 ? \"floor\" : \"ceil\"](n); }   // alternatively we could use the new Math.trunc method, but Internet Explorer doesn't know it\n\t\t\t\tif (diff < 0) {\n\t\t\t\t\tlngInterpol = lngInterpol  - trunc ((diff - 180)/ 360) * 360; \n\t\t\t\t} else {\n\t\t\t\t\tlngInterpol = lngInterpol  - trunc ((diff +180)/ 360) * 360;\n\t\t\t\t}\n\t\t\t\treturn [latInterpol, lngInterpol];\n\t\t\t}\n\t\t\t \n\t\t\tfunction _GCarc (npoints) {\n\t\t\t\tarrArcCoords = [];\n\t\t\t\tvar delta = 1.0 / (npoints-1 );\n\t\t\t\t// first point of Arc should NOT be returned\n\t\t\t\tfor (var i = 0; i < npoints; i++) {\n\t\t\t\t\tvar step = delta * i;\n\t\t\t\t\tvar coordPair = _GCinterpolate (step);\n\t\t\t\t\tarrArcCoords.push (coordPair);\n\t\t\t\t}\n\t\t\t\treturn arrArcCoords;\n\t\t\t}\n   \n\t\t\tvar fromLat = _from.lat;  // work with with copies of object's elements _from.lat and _from.lng, otherwise they would get modiefied due to call-by-reference on Objects in Javascript\n\t\t\tvar fromLng = _from.lng;\n\t\t\tvar toLat = _to.lat;\n\t\t\tvar toLng = _to.lng;\n\t\t\tfromLat=fromLat * Math.PI / 180;\n\t\t\tfromLng=fromLng * Math.PI / 180;\n\t\t\ttoLat=toLat * Math.PI / 180;\n\t\t\ttoLng=toLng * Math.PI / 180;\n\t\t\td = 2.0 * Math.asin(Math.sqrt(Math.pow (Math.sin((fromLat - toLat) / 2.0), 2) + Math.cos(fromLat) *  Math.cos(toLat) *  Math.pow(Math.sin((fromLng - toLng) / 2.0), 2)));\n\t\t\tif (d === 0) {\n\t\t\t\tarrLatLngs = [[fromLat, fromLng]];\n\t\t\t} else {\n\t\t\t\tarcpoints = 100;   // 100 points = 99 line segments. lower value to make arc less accurate or increase value to make it more accurate.\n\t\t\t\tarrLatLngs = _GCarc(arcpoints);\n\t\t\t}\n\t\t\treturn arrLatLngs;\n\t\t},\n\n        /**\n         * Update the tooltip distance\n         * @param {Number} total        Total distance\n         * @param {Number} difference   Difference in distance between 2 points\n         * @private\n         */\n\t\t_updateTooltipDistance: function(tooltip, total, difference) {\n\t\t\tvar totalRound = self._getDistance(total);\n\t\t\tvar differenceRound = self._getDistance(difference);\n\t\t\tif (differenceRound.value > 0 ) {\n\t\t\t\ttext = '<div class=\"polyline-measure-tooltip-difference\">+' + differenceRound.value + '&nbsp;' +  differenceRound.unit + '</div>';\n\t\t\t}\n\t\t\ttext += '<div class=\"polyline-measure-tooltip-total\">' + totalRound.value + '&nbsp;' +  totalRound.unit + '</div>';\n\t\t\ttooltip._icon.innerHTML = text;\n\t\t},\n\n\t\t_drawArrow: function (arcLine) {\n\t\t\tvar self = this;\n\t\t\tvar P48 = arcLine[48];\n\t\t\t\tvar P49 = arcLine[49];\n\t\t\t\tvar diffLng4849 = P49[1] - P48[1];\n\t\t\t\tvar diffLat4849 = P49[0] - P48[0];\n             var center = [P48[0] + diffLat4849/2, P48[1] + diffLng4849/2];  // center of Great-circle distance, NOT of the arc on a Mercator map! reason: a) to complicated b) map not always Mercator c) good optical feature to see where real center of distance is not the \"virtual\" warped arc center due to Mercator projection\n\t\t\t\t// angle just an aprroximation, which could be somewhat off if Line runs near high latitudes. Use of *geographical coords* for line segment [48] to [49] is best method. Use of *Pixel coords* for just one arc segement [48] to [49] could create for short lines unexact rotation angles, and the use Use of Pixel coords between endpoints [0] to [98] results in even more rotation difference for high latitudes as with geogrpaphical coords-method \n                var cssAngle = -Math.atan2(diffLat4849, diffLng4849)*57.29578   // convert radiant to degree as needed for use as CSS value; cssAngle is opposite to mathematical angle.                 \n\t\t\t\ticonArrow = L.divIcon ({ \n                        className: \"\",  // to avoid getting a default class with paddings and borders assigned by Leaflet\n\t\t\t\t\t\ticonSize: [16, 16],\n                        iconAnchor: [8, 8],\n\t\t\t\t\t\t// html : \"<img src='iconArrow.png' style='background:green; height:100%; vertical-align:top; transform:rotate(\"+ cssAngle +\"deg)'>\" // alternative method by the use of an image instead of a Unicode symbol.\n\t\t\t\t\t\thtml : \"<div style = 'font-size: 16px; line-height: 16px; vertical-align:top; transform: rotate(\"+ cssAngle +\"deg)'>&#x27a4;</div>\"   // best results if iconSize = font-size = line-height and iconAnchor font-size/2 .both values needed to position symbol in center of L.divIcon for all font-sizes. \n\t\t\t\t});\n                arrow = L.marker (center, {icon: iconArrow}).addTo(self._layerPaint);\n\t\t},\n\n        \n\t\t/**\n\t\t * Event to fire on mouse move\n\t\t * @param {Object} e Event\n\t\t * @private\n\t\t */\n\t\t_mouseMove: function(e) {\n\t\t    self._map.on ('click', self._mouseClick, self);  // necassary for _dragCircle. If switched on already within _dragCircle an unwanted click is fired at the end of the drag.\n\t\t\tif(!e.latlng || !self._currentLine) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar lastPoint = self._currentLine.points.last();\n            self._currentLine.tempLine.setLatLngs (self._polylineArc (lastPoint, e.latlng));\n            var tooltip = self._currentLine.tooltips.last();\n\t\t\ttooltip.setLatLng(e.latlng);\n            var distanceSegment = e.latlng.distanceTo(lastPoint);\n            self._updateTooltipDistance(tooltip, self._currentLine.distance + distanceSegment, distanceSegment);\n\t\t},\n\n\t\t_startLine: function() {\n            var icon = L.divIcon({\n                className: 'polyline-measure-tooltip',\n                iconAnchor: [-4, -4]\n            });\n\n            var last = function() {\n            \treturn this.slice(-1)[0];\n\t\t\t};\n\n\t\t\tself._currentLine = {\n\t\t\t\tpoints: [],\n\t\t\t\ttooltips: [],\n\t\t\t\tmarkers: [],\n\t\t\t\tdistance: 0,\n\t\t\t\ttempLine: L.polyline ([], {\n                    // Style of temporary, dashed line while moving the mouse\n                    color: self.options.tempLine.color,\n                    weight: self.options.tempLine.weight,\n                    interactive: false,\n                    dashArray: '8,8'\n                }).addTo(self._layerPaint).bringToBack(),\n\t\t\t\tpath: L.polyline([], {\n                    // Style of fixed, solid line after mouse is clicked\n                    color: self.options.fixedLine.color,\n                    weight: self.options.fixedLine.weight,\n                    interactive: false\n                }).addTo(self._layerPaint).bringToBack(),\n\t\t\t\thandleMarkers: function(latlng) {\n\t\t\t\t\t// update style on previous marker\n                    var oldMarker = this.markers.last();\n                    if (oldMarker) {\n                    \toldMarker.off('click');\n                        if (this.markers.length === 1) {\n                        \toldMarker.setStyle(self.options.startCircle);\n                        } else {\n                            oldMarker.setStyle(self.options.intermedCircle);\n                        }\n                    }\n\n                    // add marker for point\n                    // Style of the circle marking the latest point of the Polyline while still drawing\n                    var marker = new L.CircleMarker(latlng, self.options.currentCircle).addTo(self._layerPaint);\n                    marker.cntLine = self._lines.length;\n                    marker.cntCircle = self._cntCircle;\n                    self._cntCircle++;\n                    marker.on('mousedown', self._dragCircle, self);\n                    marker.on('click', self._finishPath);\n                    this.markers.push(marker);\n\t\t\t\t},\n\t\t\t\taddPoint: function(latlng) {\n                    var lastPoint = this.points.last();\n                    // ignore points we already have\n                    if (lastPoint && lastPoint.equals(latlng)) {\n                    \treturn;\n\t\t\t\t\t}\n                    this.points.push(latlng);\n\t\t\t\t\t// update polyline\n\t\t\t\t\tif (this.points.length > 1) {\n                        var arc = self._polylineArc(lastPoint, latlng);\n\t\t\t\t\t\tif (this.points.length > 2) {\n\t\t\t\t\t\t\tarc.shift();\n                        }\n                        this.path.setLatLngs(this.path.getLatLngs().concat(arc));\n\t\t\t\t\t\t// following lines needed especially for Mobile Browsers where we just use mouseclicks. No mousemoves, no tempLine.\n\t\t\t\t\t\tdistanceSegment = lastPoint.distanceTo(latlng);\n\t\t\t\t\t\tvar tooltip = self._currentLine.tooltips.last();\n\t\t\t\t\t\tself._updateTooltipDistance(tooltip, this.distance + distanceSegment, distanceSegment);\n\t\t\t\t\t\tthis.distance += distanceSegment;\n\t\t\t\t \t\tself._drawArrow(arc);\n\t\t\t\t \t\tself._arrArrowsCurrentline.push (arrow);\n\t\t\t\t\t}\n\n\t\t\t\t\t// update last tooltip with final value\n\t\t\t\t\tvar lastTooltip = this.tooltips.last();\n\t\t\t\t\tif (lastTooltip) {\n\t\t\t\t\t\tlastTooltip.setLatLng(latlng);\n\t\t\t\t\t}\n\n\t\t\t\t\t// add new tooltip to update on mousemove\n                    var tooltip = L.marker(latlng, {\n                        icon: icon,\n                        interactive: false\n                    }).addTo(self._layerPaint);\n                    this.tooltips.push(tooltip);\n\t\t\t\t\t\n                    this.handleMarkers(latlng);\n\t\t\t\t},\n\t\t\t\tfinalize: function() {\n\t\t\t\t\t// clean up tooltip created by last click\n                    self._layerPaint.removeLayer(this.tooltips.last());\n                    this.tooltips.pop();\n                    // clean up temporary line\n                    self._layerPaint.removeLayer(self._currentLine.tempLine);\n                    if (this.points.length > 1) {\n                        this.tooltips.last()._icon.classList.add('polyline-measure-tooltip-end'); // add Class e.g. another background-color to the Previous Tooltip (which is the last fixed tooltip, cause the moving tooltip is being deleted later)\n                        // Style of the circle marking the end of the whole Polyline\n\t\t\t\t\t\tvar oldMarker = this.markers.last()\n                        oldMarker.setStyle(self.options.endCircle);\n                        oldMarker.off('click');\n                        self._lines.push(this);\n\t\t\t\t\t\tself._arrArrows.push (self._arrArrowsCurrentline);\n                    } else {\n                    \t// if there is only one point, just clean it up\n                        self._layerPaint.removeLayer(this.markers.last());\n                    }\n                    self._resetPathVariables();\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._currentLine.points.last = last;\n\t\t\tthis._currentLine.tooltips.last = last;\n\t\t\tthis._currentLine.markers.last = last;\n\t\t},\n\n\t\t/**\n\t\t * Event to fire on mouse click\n\t\t * @param {Object} e Event\n\t\t * @private\n\t\t */\n\t\t_mouseClick: function(e) {\n\t\t\t// skip if there is no latlng or this event's container point matches the finishing point for the line we just completed\n\t\t\tif (!e.latlng || (self._finishPoint && self._finishPoint.equals(e.containerPoint))) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!self._currentLine) {\n\t\t\t\tself._startLine();\n\t\t\t}\n            self._currentLine.addPoint(e.latlng);\n\t\t},\n\n        /**\n         * Finish the drawing of the path\n         * @private\n         */\n\t\t_finishPath: function(e) {\n\t\t\tself._currentLine.finalize();\n\t\t\tself._finishPoint = e.containerPoint;\n\t\t},\n\n        /**\n         * After completing a path, reset all the values to prepare in creating the next polyline measurement\n         * @private\n         */\n\t\t_resetPathVariables: function() {\n            self._cntCircle = 0;\n            self._currentLine = null;\n\t\t\tself._arrArrowsCurrentline = [];\n\t\t},\n      \n\t\t_dragCircleMouseup: function () {\n\t\t\tself._resetPathVariables();\n\t\t\tself._map.off ('mousemove', self._dragCircleMousemove, self);\n\t\t\tself._map.dragging.enable();\n\t\t\tself._map.on ('mousemove', self._mouseMove, self);\n\t\t\tself._map.off ('mouseup', self._dragCircleMouseup, self);\n\t\t},\n\t  \n\t\t_dragCircleMousemove: function (e2) {\n\t\t\tvar mouseNewLat = e2.latlng.lat;\n\t\t\tvar mouseNewLng = e2.latlng.lng;\n\t\t\tvar latDifference = mouseNewLat - self._mouseStartingLat;\n\t\t\tvar lngDifference = mouseNewLng - self._mouseStartingLng;\n\t\t\tvar currentCircleCoords = L.latLng (self._circleStartingLat + latDifference, self._circleStartingLng + lngDifference);\n                lineNr = self._e1.target.cntLine;\n                circleNr = self._e1.target.cntCircle;\n\t\t\t\tself._e1.target.setLatLng (currentCircleCoords);\n                self._lines[lineNr].points[circleNr] = currentCircleCoords;\n                lineCoords = self._lines[lineNr].path.getLatLngs(); // get Coords of each Point of the current Polyline\n\t\t\t\tif (circleNr >= 1)\t {   // redraw previous arc just if circle is not starting circle of polyline\n\t\t\t\t\tnewLineSegment1 = self._polylineArc(self._lines[lineNr].points[circleNr-1], currentCircleCoords);\n\t\t\t\t\t// the next line's syntax has to be used since Internet Explorer doesn't know new spread operator (...) for inserting the individual elements of an array as 3rd argument of the splice method; Otherwise we could write: lineCoords.splice (circleNr*(arcpoints-1), arcpoints, ...newLineSegment1);\n\t\t\t\t\tArray.prototype.splice.apply (lineCoords, [(circleNr-1)*(arcpoints-1), arcpoints].concat (newLineSegment1));\n\t\t\t\t\tself._drawArrow (newLineSegment1);\n\t\t\t\t\tself._arrArrows[lineNr][circleNr-1].removeFrom (self._layerPaint);\n\t\t\t\t\tself._arrArrows[lineNr][circleNr-1] = arrow;\n\t\t\t\t}\n\t\t\t\tif   (circleNr < self._lines[lineNr].points.length-1) {   // redraw following arc just if circle is not end circle of polyline\n\t\t\t\t\tnewLineSegment2 = self._polylineArc (currentCircleCoords, self._lines[lineNr].points[circleNr+1]);\n\t\t\t\t\tArray.prototype.splice.apply (lineCoords, [circleNr*(arcpoints-1), arcpoints].concat (newLineSegment2));\n\t\t\t\t\tself._drawArrow (newLineSegment2);\n\t\t\t\t\tself._arrArrows[lineNr][circleNr].removeFrom (self._layerPaint);\n\t\t\t\t\tself._arrArrows[lineNr][circleNr] = arrow;\n\t\t\t\t}\n                self._lines[lineNr].path.setLatLngs (lineCoords);\n                if (circleNr > 0) {     // just update tooltip position if moved circle is 2nd, 3rd, 4th etc. circle of a polyline\n                    self._lines[lineNr].tooltips[circleNr - 1].setLatLng(currentCircleCoords);\n                }    \n                var totalDistance = 0;\n                // update tooltip texts of each tooltip\n                self._lines[lineNr].tooltips.map (function (item, index) {\n                    var distance = self._lines[lineNr].points[index].distanceTo(self._lines[lineNr].points[index + 1]);\n                    totalDistance += distance;\n                    self._updateTooltipDistance(item, totalDistance, distance);\n                });\n                self._map.on ('mouseup', self._dragCircleMouseup, self);\n            },\n\t  \n        _dragCircle: function (e1) {\n\t\t\tself._e1 = e1;\n\t\t\tif ((self._measuring) && (self._cntCircle === 0)) {    // just execute drag-function if Measuring tool is active but no line is being drawn at the moment.\n\t\t\t\tself._map.dragging.disable();  // turn of moving of the map during drag of a circle\n\t\t\t\tself._map.off ('mousemove', self._mouseMove, self);\n\t\t\t\tself._map.off ('click', self._mouseClick, self);\n\t\t\t\tself._mouseStartingLat = e1.latlng.lat;\n\t\t\t\tself._mouseStartingLng = e1.latlng.lng;\n\t\t\t\tself._circleStartingLat = e1.target._latlng.lat;\n\t\t\t\tself._circleStartingLng = e1.target._latlng.lng;\n\t\t\t\tself._map.on ('mousemove', self._dragCircleMousemove, self);\n\t\t\t}\n        }\n\t});\n\n//======================================================================================\n\n\tL.Map.mergeOptions({\n\t\tPolylineMeasureControl: false\n\t});\n\n\tL.Map.addInitHook(function () {\n\t\tvar self = this;\n\t\tif (self.options.polylineMeasureControl) {\n\t\t\tself.PMControl = new L.Control.PolylineMeasure();\n\t\t\tself.addControl(self.PMControl);\n\t\t}\n\t});\n\n\tL.control.polylineMeasure = function (options) {\n\t\treturn new L.Control.PolylineMeasure (options);\n\t};\n}));\n"]}