@raruto/leaflet-elevation 2.0.7 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"leaflet-elevation.min.js","sources":["../node_modules/leaflet-i18n/Leaflet.i18n.js","../src/utils.js","../src/options.js","../src/control.js","../src/index.js"],"sourcesContent":["// Following https://github.com/Leaflet/Leaflet/blob/master/PLUGIN-GUIDE.md\n(function (factory, window) {\n\n // define an AMD module that relies on 'leaflet'\n if (typeof define === 'function' && define.amd) {\n define(['leaflet'], factory);\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 L.locales = {};\n L.locale = null;\n L.registerLocale = function registerLocale(code, locale) {\n L.locales[code] = L.Util.extend({}, L.locales[code], locale);\n };\n L.setLocale = function setLocale(code) {\n L.locale = code;\n };\n return L.i18n = L._ = function translate(string, data) {\n if (L.locale && L.locales[L.locale] && L.locales[L.locale][string]) {\n string = L.locales[L.locale][string];\n }\n try {\n // Do not fail if some data is missing\n // a bad translation should not break the app\n string = L.Util.template(string, data);\n }\n catch (err) {/*pass*/\n }\n\n return string;\n };\n}, window));\n","/**\n * TODO: exget computed styles of theese values from actual \"CSS vars\"\n **/\nexport const Colors = {\n\t'lightblue': { area: '#3366CC', alpha: 0.45, stroke: '#3366CC' },\n\t'magenta' : { area: '#FF005E' },\n\t'yellow' : { area: '#FF0' },\n\t'purple' : { area: '#732C7B' },\n\t'steelblue': { area: '#4682B4' },\n\t'red' : { area: '#F00' },\n\t'lime' : { area: '#9CC222', line: '#566B13' }\n};\n\nconst SEC = 1000;\nconst MIN = SEC * 60;\nconst HOUR = MIN * 60;\nconst DAY = HOUR * 24;\n\n/**\n * Convert a time (millis) to a human readable duration string (%Dd %H:%M'%S\")\n */\nexport function formatTime(t) {\n\tlet d = Math.floor(t / DAY);\n\tlet h = Math.floor( (t - d * DAY) / HOUR);\n\tlet m = Math.floor( (t - d * DAY - h * HOUR) / MIN);\n\tlet s = Math.round( (t - d * DAY - h * HOUR - m * MIN) / SEC);\n\tif ( s === 60 ) { m++; s = 0; }\n\tif ( m === 60 ) { h++; m = 0; }\n\tif ( h === 24 ) { d++; h = 0; }\n\treturn (d ? d + \"d \" : '') + h.toString().padStart(2, 0) + ':' + m.toString().padStart(2, 0) + \"'\" + s.toString().padStart(2, 0) + '\"';\n}\n\n/**\n * Convert a time (millis) to human readable date string (dd-mm-yyyy hh:mm:ss)\n */\n export function formatDate(format) {\n\tif (!format) {\n\t\treturn (time) => (new Date(time)).toLocaleString().replaceAll('/', '-').replaceAll(',', ' ');\n\t} else if (format == 'time') {\n\t\treturn (time) => (new Date(time)).toLocaleTimeString();\n\t} else if (format == 'date') {\n\t\treturn (time) => (new Date(time)).toLocaleDateString();\n\t}\n\treturn (time) => format(time);\n}\n\n/**\n * Generate download data event.\n */\n export function saveFile(dataURI, fileName) {\n\tlet a = create('a', '', { href: dataURI, target: '_new', download: fileName || \"\", style: \"display:none;\" });\n\tlet b = document.body;\n\tb.appendChild(a);\n\ta.click();\n\tb.removeChild(a);\n}\n\n\n/**\n * Convert SVG Path into Path2D and then update canvas\n */\n export function drawCanvas(ctx, path) {\n\tpath.classed('canvas-path', true);\n\n\tctx.beginPath();\n\tctx.moveTo(0, 0);\n\tlet p = new Path2D(path.attr('d'));\n\n\tctx.strokeStyle = path.attr('stroke');\n\tctx.fillStyle = path.attr('fill');\n\tctx.lineWidth = 1.25;\n\tctx.globalCompositeOperation = 'source-over';\n\n\t// stroke opacity\n\tctx.globalAlpha = path.attr('stroke-opacity') || 0.3;\n\tctx.stroke(p);\n\n\t// fill opacity\n\tctx.globalAlpha = path.attr('fill-opacity') || 0.45;\n\tctx.fill(p);\n\n\tctx.globalAlpha = 1;\n\n\tctx.closePath();\n}\n\n/**\n * Loop and extract GPX Extensions handled by \"@tmcw/toGeoJSON\" (eg. \"coordinateProperties\" > \"times\")\n */\nexport function coordPropsToMeta(coordProps, name, parser) {\n\treturn coordProps && (({props, point, id, isMulti }) => {\n\t\tif (props) {\n\t\t\tfor (const key of coordProps) {\n\t\t\t\tif (key in props) {\n\t\t\t\t\tpoint.meta[name] = (parser || parseInt).call(this, (isMulti ? props[key][isMulti] : props[key]), id);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}\n\n/**\n * Extract numeric property (id) from GeoJSON object\n */\nexport const parseInt = (property, id) => window.parseInt((typeof property === 'object' ? property[id] : property));\n\n/**\n * Extract datetime property (id) from GeoJSON object\n */\nexport const parseDate = (property, id) => new Date(Date.parse((typeof property === 'object' ? property[id] : property)));\n\n/**\n * A little bit shorter than L.DomUtil\n */\nexport const addClass = (n, str) => n && str.split(\" \").every(s => s && L.DomUtil.addClass(n, s));\nexport const removeClass = (n, str) => n && str.split(\" \").every(s => s && L.DomUtil.removeClass(n, s));\nexport const toggleClass = (n, str, cond) => (cond ? addClass : removeClass)(n, str);\nexport const replaceClass = (n, rem, add) => (rem && removeClass(n, rem)) || (add && addClass(n, add));\nexport const style = (n, k, v) => (typeof v === \"undefined\" && L.DomUtil.getStyle(n, k)) || n.style.setProperty(k, v);\nexport const toggleStyle = (n, k, v, cond) => style(n, k, cond ? v : '');\nexport const setAttributes = (n, attrs) => { for (let k in attrs) { n.setAttribute(k, attrs[k]); } };\nexport const toggleEvent = (el, e, fn, cond) => el[cond ? 'on' : 'off'](e, fn);\nexport const create = (tag, str, attrs, n) => { let elem = L.DomUtil.create(tag, str || \"\"); if (attrs) setAttributes(elem, attrs); if (n) append(n, elem); return elem; };\nexport const append = (n, c) => n.appendChild(c);\nexport const insert = (n, c, pos) => n.insertAdjacentElement(pos, c);\nexport const select = (str, n) => (n || document).querySelector(str);\nexport const each = (obj, fn) => { for (let i in obj) fn(obj[i], i); };\nexport const randomId = () => Math.random().toString(36).substr(2, 9);\n\n/**\n * TODO: use generators instead? (ie. \"yield\")\n */\nexport const iMax = (iVal, max) => (iVal > max ? iVal : max) || -Infinity; \nexport const iMin = (iVal, min) => (iVal < min ? iVal : min) || +Infinity;\nexport const iAvg = (iVal, avg) => (iVal + (avg || 0)) / 2.0;\nexport const iSum = (iVal, sum) => iVal + (sum || 0);\n\n/**\n * Alias for some leaflet core functions\n */\nexport const { on, off } = L.DomEvent;\nexport const { throttle, wrapNum } = L.Util;\nexport const { hasClass } = L.DomUtil;\n\n/**\n * Limit floating point precision\n */\nexport const round = L.Util.formatNum;\n\n/**\n * Limit a number between min / max values\n */\nexport const clamp = (val, range) => range ? (val < range[0] ? range[0] : val > range[1] ? range[1] : val) : val;\n\n/**\n * Limit a delta difference between two values\n */\nexport const wrapDelta = (curr, prev, deltaMax) => Math.abs(curr - prev) > deltaMax ? prev + deltaMax * Math.sign(curr - prev) : curr;","import * as _ from './utils';\n\nexport var Options = {\n\tautofitBounds: true,\n\tautohide: false,\n\tautohideMarker: true,\n\talmostover: true,\n\taltitude: true,\n\tcloseBtn: true,\n\tcollapsed: false,\n\tdetached: true,\n\tdistance: true,\n\tdistanceMarkers: { lazy: true, distance: true, direction: true },\n\tdragging: !L.Browser.mobile,\n\tdownloadLink: 'link',\n\televationDiv: \"#elevation-div\",\n\tfollowMarker: true,\n\timperial: false,\n\tlegend: true,\n\thandlers: [],\n\thotline: 'elevation',\n\tmarker: 'elevation-line',\n\tmarkerIcon: L.divIcon({\n\t\tclassName: 'elevation-position-marker',\n\t\thtml: '<i class=\"elevation-position-icon\"></i>',\n\t\ticonSize: [32, 32],\n\t\ticonAnchor: [16, 16],\n\t}),\n\tposition: \"topright\",\n\tpolyline: {\n\t\tclassName: 'elevation-polyline',\n\t\tcolor: '#000',\n\t\topacity: 0.75,\n\t\tweight: 5,\n\t\tlineCap: 'round'\n\t},\n\tpolylineSegments: {\n\t\tclassName: 'elevation-polyline-segments',\n\t\tcolor: '#F00',\n\t\tinteractive: false,\n\t},\n\tpreferCanvas: false,\n\treverseCoords: false,\n\truler: true,\n\ttheme: \"lightblue-theme\",\n\tsummary: 'inline',\n\tslope: false,\n\tspeed: false,\n\ttime: false,\n\ttimeFactor: 3600,\n\ttimestamps: false,\n\ttrkStart: L.circleMarker([0,0], { className: 'start-marker', radius: 6, weight: 2, color: '#fff', fillColor: '#00d800', fillOpacity: 1, interactive: false }),\n\ttrkEnd: L.circleMarker([0,0], { className: 'end-marker', radius: 6, weight: 2, color: '#fff', fillColor: '#ff0606', fillOpacity: 1, interactive: false }),\n\twaypoints: true,\n\twptIcons: {\n\t\t'': L.divIcon({\n\t\t\tclassName: 'elevation-waypoint-marker',\n\t\t\thtml: '<i class=\"elevation-waypoint-icon default\"></i>',\n\t\t\ticonSize: [30, 30],\n\t\t\ticonAnchor: [8, 30],\n\t\t}),\n\t},\n\twptLabels: true,\n\txAttr: \"dist\",\n\txLabel: \"km\",\n\tyAttr: \"z\",\n\tyLabel: \"m\",\n\tzFollow: false,\n\tzooming: !L.Browser.Mobile,\n\n\t// Quite uncommon and undocumented options\n\tmargins: { top: 30, right: 30, bottom: 30, left: 40 },\n\theight: (screen.height * 0.3) || 200,\n\twidth: (screen.width * 0.6) || 600,\n\txTicks: undefined,\n\tyTicks: undefined,\n\n\tdecimalsX: 2,\n\tdecimalsY: 0,\n\tforceAxisBounds: false,\n\tinterpolation: \"curveLinear\",\n\tskipNullZCoords: false,\n\tyAxisMax: undefined,\n\tyAxisMin: undefined,\n};\n","import 'leaflet-i18n';\nimport * as _ from './utils';\nimport { Options } from './options';\n\nexport const Elevation = L.Control.Elevation = L.Control.extend({\n\n\tincludes: L.Evented ? L.Evented.prototype : L.Mixin.Events,\n\n\toptions: Options,\n\t__mileFactor: 0.621371, // 1 km = (0.621371 mi)\n\t__footFactor: 3.28084, // 1 m = (3.28084 ft)\n\t__D3: 'https://unpkg.com/d3@6.5.0/dist/d3.min.js',\n\t__TOGEOJSON: 'https://unpkg.com/@tmcw/togeojson@4.6.0/dist/togeojson.umd.js',\n\t__LGEOMUTIL: 'https://unpkg.com/leaflet-geometryutil@0.9.3/src/leaflet.geometryutil.js',\n\t__LALMOSTOVER: 'https://unpkg.com/leaflet-almostover@1.0.1/src/leaflet.almostover.js',\n\t__LHOTLINE: '../libs/leaflet-hotline.min.js',\n\t__LDISTANCEM: '../libs/leaflet-distance-marker.min.js',\n\t__LCHART: '../src/components/chart.js',\n\t__LMARKER: '../src/components/marker.js',\n\t__LSUMMARY: '../src/components/summary.js',\n\t__modulesFolder: '../src/handlers/',\n\n\t/*\n\t * Add data to the diagram either from GPX or GeoJSON and update the axis domain and data\n\t */\n\taddData: function(d, layer) {\n\t\tthis.import(this.__D3)\n\t\t\t.then(() => {\n\t\t\t\tlayer = layer ?? (d.on && d);\n\t\t\t\tthis._addData(d);\n\t\t\t\tthis._addLayer(layer);\n\t\t\t\tthis._fireEvt(\"eledata_added\", { data: d, layer: layer, track_info: this.track_info });\n\t\t\t});\n\t},\n\n\t/**\n\t * Adds the control to the given map.\n\t */\n\taddTo: function(map) {\n\t\tif (this.options.detached) {\n\t\t\tlet parent = _.select(this.options.elevationDiv);\n\t\t\tlet eleDiv = this.onAdd(map);\n\t\t\tparent ? _.append(parent, eleDiv) : _.insert(map.getContainer(), eleDiv, 'afterend');\n\t\t} else {\n\t\t\tL.Control.prototype.addTo.call(this, map);\n\t\t}\n\t\treturn this;\n\t},\n\n\t/*\n\t * Reset data and display\n\t */\n\tclear: function() {\n\t\tif (this._marker) this._marker.remove();\n\t\tif (this._chart) this._clearChart();\n\t\tif (this._layers) this._clearLayers(this._layers);\n\t\tif (this._markers) this._clearLayers(this._markers);\n\t\tif (this._circleMarkers) this._clearLayers(this._circleMarkers);\n\n\t\tthis._data = [];\n\t\tthis.track_info = {};\n\n\t\tthis._fireEvt(\"eledata_clear\");\n\n\t\tthis._updateChart();\n\t},\n\n\t_clearChart: function() {\n\t\tif (this._events && this._events.elechart_updated) {\n\t\t\tthis._events.elechart_updated.forEach(({fn, ctx}) => this.off('elechart_updated', fn, ctx));\n\t\t}\n\t\tif (this._chart && this._chart._container) {\n\t\t\tthis._chart._container.selectAll('g.point .point').remove();\n\t\t\tthis._chart.clear();\n\t\t}\n\t},\n\n\t_clearLayers: function(l) {\n\t\tl = l || this._layers;\n\t\tif (l && l.eachLayer) {\n\t\t\tl.eachLayer(f => f.remove())\n\t\t\tl.clearLayers();\n\t\t}\n\t},\n\n\t/**\n\t * TODO: Create a base class to handle custom data attributes (heart rate, cadence, temperature, ...)\n\t * \n\t * @link https://leafletjs.com/examples/extending/extending-3-controls.html#handlers\n\t */\n\t// addHandler: function (name, HandlerClass) {\n\t// \tif (HandlerClass) {\n\t// \t\tlet handler = this[name] = new HandlerClass(this);\n\t// \t\tthis.handlers.push(handler);\n\t// \t\tif (this.options[name]) {\n\t// \t\t\thandler.enable();\n\t// \t\t}\n\t// \t}\n\t// \treturn this;\n\t// },\n\n\t/**\n\t * Disable chart brushing.\n\t */\n\tdisableBrush: function() {\n\t\tthis._chart._brushEnabled = false;\n\t\tthis._resetDrag();\n\t},\n\n\t/**\n\t * Enable chart brushing.\n\t */\n\tenableBrush: function() {\n\t\tthis._chart._brushEnabled = true;\n\t},\n\n\t/**\n\t * Disable chart zooming.\n\t */\n\tdisableZoom: function() {\n\t\tthis._chart._zoomEnabled = false;\n\t\tthis._chart._resetZoom();\n\t},\n\n\t/**\n\t * Enable chart zooming.\n\t */\n\tenableZoom: function() {\n\t\tthis._chart._zoomEnabled = true;\n\t},\n\n\t/**\n\t * Sets a map view that contains the given geographical bounds.\n\t */\n\tfitBounds: function(bounds) {\n\t\tbounds = bounds || this.getBounds();\n\t\tif (this._map && bounds.isValid()) this._map.fitBounds(bounds);\n\t},\n\n\tgetBounds: function(data) {\n\t\treturn L.latLngBounds((data || this._data).map((d) => d.latlng));\n\t},\n\n\t/**\n\t * Get default zoom level (followMarker: true).\n\t */\n\tgetZFollow: function() {\n\t\treturn this.options.zFollow;\n\t},\n\n\t/**\n\t * Hide current elevation chart profile.\n\t */\n\thide: function() {\n\t\t_.style(this._container, \"display\", \"none\");\n\t},\n\n\t/**\n\t * Initialize chart control \"options\" and \"container\".\n\t */\n\tinitialize: function(opts) {\n\n\t\topts = L.setOptions(this, opts);\n\n\t\tthis._data = [];\n\t\tthis._layers = L.featureGroup();\n\t\tthis._markers = L.featureGroup();\n\t\tthis._circleMarkers = L.featureGroup();\n\t\tthis._markedSegments = L.polyline([]);\n\t\tthis._start = (opts.trkStart || Options.trkStart);\n\t\tthis._end = (opts.trkEnd || Options.trkEnd);\n\t\tthis._chartEnabled = true;\n\t\tthis._yCoordMax = -Infinity;\n\t\tthis.track_info = {};\n\t\t// this.handlers = [];\n\n\t\tif (opts.followMarker) this._setMapView = _.throttle(this._setMapView, 300, this);\n\t\tif (opts.legend) opts.margins.bottom += 30;\n\t\tif (opts.theme) opts.polylineSegments.className += ' ' + opts.theme;\n\t\tif (opts.wptIcons === true) opts.wptIcons = Options.wptIcons;\n\t\tif (opts.distanceMarkers === true) opts.distanceMarkers = Options.distanceMarkers;\n\t\tif (opts.trkStart) this._start.addTo(this._circleMarkers);\n\t\tif (opts.trkEnd) this._end.addTo(this._circleMarkers);\n\n\n\t\tthis._markedSegments.setStyle(opts.polylineSegments);\n\n\t\t// Leaflet canvas renderer colors\n\t\tL.extend(_.Colors, opts.colors || {});\n\n\t\t// Various stuff\n\t\tthis._fixCanvasPaths();\n\t\tthis._fixTooltipSize();\n\n\t},\n\n\t/**\n\t * Javascript scripts downloader (lazy loader)\n\t */\n\timport: function(src, condition) {\n\t\tswitch(src) {\n\t\t\tcase this.__D3: condition = typeof d3 !== 'object'; break;\n\t\t\tcase this.__TOGEOJSON: condition = typeof toGeoJSON !== 'object'; break;\n\t\t\tcase this.__LGEOMUTIL: condition = typeof L.GeometryUtil !== 'object'; break;\n\t\t\tcase this.__LALMOSTOVER: condition = typeof L.Handler.AlmostOver !== 'function'; break;\n\t\t\tcase this.__LDISTANCEM: condition = typeof L.DistanceMarkers !== 'function'; break;\n\t\t}\n\t\treturn condition !== false ? import(src) : Promise.resolve();\n\t},\n\n\t/**\n\t * Load elevation data (GPX, GeoJSON, KML or TCX).\n\t */\n\tload: function(data) {\n\t\tthis._parseFromString(data).then( geojson => geojson ? this._loadLayer(geojson) : this._loadFile(data));\n\t},\n\n\t/**\n\t * Create container DOM element and related event listeners.\n\t * Called on control.addTo(map).\n\t */\n\tonAdd: function(map) {\n\t\tthis._map = map;\n\n\t\tlet container = this._container = _.create(\"div\", \"elevation-control \" + this.options.theme + \" \" + (this.options.detached ? 'elevation-detached' : 'leaflet-control'), this.options.detached ? { id: 'elevation-' + _.randomId() } : {});\n\n\t\tif (!this.eleDiv) this.eleDiv = container;\n\n\t\tlet modules = [\n\t\t\t\"Distance\",\n\t\t\t\"Time\",\n\t\t\t\"Altitude\",\n\t\t\t\"Slope\",\n\t\t\t\"Speed\",\n\t\t\t\"Acceleration\",\n\t\t\t...this.options.handlers\n\t\t].filter(m => false !== this.options[typeof m == \"string\" && m.toLowerCase()]);\n\n\t\tthis._loadModules(modules);\t// Inject here required modules (data handlers)\n\t\tthis._initButton(container);\n\t\tthis._initChart(container);\n\t\tthis._initSummary(container);\n\t\tthis._initMarker(map);\n\t\tthis._initLayer(map);\n\n\t\treturn container;\n\t},\n\n\t/**\n\t * Clean up control code and related event listeners.\n\t * Called on control.remove().\n\t */\n\tonRemove: function(map) {\n\t\tthis._container = null;\n\n\t\tmap\n\t\t\t.off('zoom viewreset zoomanim', this._hideMarker, this)\n\t\t\t.off('resize', this._resetView, this)\n\t\t\t.off('resize', this._resizeChart, this)\n\t\t\t.off('mousedown', this._resetDrag, this);\n\n\t\t_.off(map.getContainer(), 'mousewheel', this._resetDrag, this);\n\t\t_.off(map.getContainer(), 'touchstart', this._resetDrag, this);\n\t\t_.off(document, 'keydown', this._onKeyDown, this);\n\n\t\tthis\n\t\t\t.off('eledata_added eledata_loaded', this._updateChart, this)\n\t\t\t.off('eledata_added eledata_loaded', this._updateSummary, this);\n\t},\n\n\t/**\n\t * Redraws the chart control. Sometimes useful after screen resize.\n\t */\n\tredraw: function() {\n\t\tthis._resizeChart();\n\t},\n\n\t/**\n\t * Set default zoom level (followMarker: true).\n\t */\n\tsetZFollow: function(zoom) {\n\t\tthis.options.zFollow = zoom;\n\t},\n\n\t/**\n\t * Hide current elevation chart profile.\n\t */\n\tshow: function() {\n\t\t_.style(this._container, \"display\", \"block\");\n\t},\n\n\t/*\n\t * Parsing data either from GPX or GeoJSON and update the diagram data\n\t */\n\t_addData: function(d) {\n\t\tif (!d) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Standard GeoJSON\n\t\tif (d.type === \"FeatureCollection\" ) {\n\t\t\treturn _.each(d.features, feature => this._addData(feature));\n\t\t} else if (d.type === \"Feature\") {\n\t\t\tlet geom = d.geometry;\n\t\t\tif (geom) {\n\t\t\t\tswitch (geom.type) {\n\t\t\t\t\tcase 'LineString':\t\treturn this._addGeoJSONData(geom.coordinates, d.properties);\n\t\t\t\t\tcase 'MultiLineString': return _.each(geom.coordinates, (coords, i) => this._addGeoJSONData(coords, d.properties, i));\n\t\t\t\t\tcase 'Point':\n\t\t\t\t\tdefault:\t\t\t\treturn console.warn('Unsopperted GeoJSON feature geometry type:' + geom.type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Fallback for leaflet layers (eg. L.Gpx)\n\t\tif (d._latlngs) {\n\t\t\treturn this._addGeoJSONData(d._latlngs, d.feature && d.feature.properties);\n\t\t}\n\n\t},\n\n\t/*\n\t * Parsing of GeoJSON data lines and their elevation in z-coordinate\n\t */\n\t_addGeoJSONData: function(coords, properties, nestingLevel) {\n\n\t\t// \"coordinateProperties\" property is generated inside \"@tmcw/toGeoJSON\"\n\t\tlet props = (properties && properties.coordinateProperties) || properties;\n\n\t\tcoords.forEach((point, i) => {\n\n\t\t\t// GARMIN_EXTENSIONS = [\"hr\", \"cad\", \"atemp\", \"wtemp\", \"depth\", \"course\", \"bearing\"];\n\t\t\tpoint.meta = point.meta ?? { time: null, ele: null };\n\t\t\t\n\t\t\tpoint.prev = (attr) => (attr ? this._data[i > 0 ? i - 1 : 0][attr] : this._data[i > 0 ? i - 1 : 0]);\n\n\t\t\tthis.fire(\"elepoint_init\", { point: point, props: props, id: i, isMulti: nestingLevel });\n\n\t\t\tthis._addPoint(\n\t\t\t\tpoint.lat ?? point[1], \n\t\t\t\tpoint.lng ?? point[0],\n\t\t\t\tpoint.alt ?? point.meta.ele ?? point[2]\n\t\t\t);\n\n\t\t\tthis.fire(\"elepoint_added\", { point: point, index: this._data.length - 1 });\n\n\t\t\tif (this._yCoordMax < this._data[this._data.length - 1][this.options.yAttr]) this._yCoordMax = this._data[this._data.length - 1][this.options.yAttr];\n\t\t});\n\n\t\tthis.fire(\"eletrack_added\", { coords: coords, index: this._data.length - 1 });\n\t},\n\n\t/*\n\t * Parse and push a single (x, y, z) point to current elevation profile.\n\t */\n\t_addPoint: function(x, y, z) {\n\t\tif (this.options.reverseCoords) {\n\t\t\t[x, y] = [y, x];\n\t\t}\n\n\t\tthis._data.push({\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\tz: z,\n\t\t\tlatlng: L.latLng(x, y, z)\n\t\t});\n\n\t\tthis.fire(\"eledata_updated\", { index: this._data.length - 1 });\n\t},\n\n\t_addLayer: function(layer) {\n\t\tif (layer) this._layers.addLayer(layer)\n\t\t// Postpone adding the distance markers (lazy: true)\n\t\tif (layer && this.options.distanceMarkers && this.options.distanceMarkers.lazy) {\n\t\t\tlayer.on('add remove', ({target, type}) => L.DistanceMarkers && target instanceof L.Polyline && target[type + 'DistanceMarkers']());\n\t\t}\n\t\treturn layer;\n\t},\n\n\t_addMarker: function(marker) {\n\t\tif (marker) this._markers.addLayer(marker)\n\t\treturn marker;\n\t},\n\n\t/**\n\t * Initialize \"L.AlmostOver\" integration\n\t */\n\t_initAlmostOverHandler: function(map, layer) {\n\t\tif(!map || !this.options.almostOver) return;\n\t\tPromise.all([\n\t\t\tthis.import(this.__LGEOMUTIL),\n\t\t\tthis.import(this.__LALMOSTOVER)\n\t\t]).then(() => {\n\t\t\tmap.addHandler('almostOver', L.Handler.AlmostOver)\n\t\t\tif (L.GeometryUtil && map.almostOver && map.almostOver.enabled()) {\n\t\t\t\tmap.almostOver.addLayer(layer);\n\t\t\t\tmap\n\t\t\t\t\t.on('almost:move', (e) => this._onMouseMoveLayer(e))\n\t\t\t\t\t.on('almost:out', (e) => this._onMouseOut(e));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * Initialize \"L.DistanceMarkers\" integration\n\t */\n\t_initDistanceMarkers: function(map, layer) {\n\t\tif (!map) return;\n\t\tif (this.options.distanceMarkers) {\n\t\t\tPromise.all([\n\t\t\t\tthis.import(this.__LGEOMUTIL),\n\t\t\t\tthis.import(this.__LDISTANCEM)\n\t\t\t]).then(() => this.options.polyline && layer.addTo(map) && this._circleMarkers.bringToFront());\n\t\t} else if (this.options.polyline) {\n\t\t\tlayer.addTo(map);\n\t\t}\n\t},\n\n\t_initHotLine: function(map, layer) {\n\t\tthis._hotline = L.featureGroup();\n\t\tif (this.options.hotline) {\n\t\t\tlayer.on('add', () => {\n\t\t\t\tthis._hotline.eachLayer(line => {\n\t\t\t\t\tthis._hotline.addTo(layer._map);\n\t\t\t\t\tif (line._renderer)\n\t\t\t\t\tline._renderer._container.parentElement.insertBefore(line._renderer._container, line._renderer._container.parentElement.firstChild);\n\t\t\t\t});\n\t\t\t});\n\t\t\tlet prop = typeof this.options.hotline == 'string' ? this.options.hotline : 'elevation';\n\t\t\tthis.import(this.__LHOTLINE)\n\t\t\t\t.then(() => {\n\t\t\t\t\tlayer.setStyle({opacity: 0});\n\t\t\t\t\tlayer.eachLayer((trkseg) => {\n\t\t\t\t\t\tif(trkseg.feature.geometry.type != \"Point\") {\n\t\t\t\t\t\t\tlet geo = L.geoJson(trkseg.toGeoJSON(), { coordsToLatLng: (coords) => L.latLng(coords[0], coords[1], coords[2])});\n\t\t\t\t\t\t\tlet line = L.hotline(geo.toGeoJSON().features[0].geometry.coordinates, {\n\t\t\t\t\t\t\t\tmin: isFinite(this.track_info[prop + '_min']) ? this.track_info[prop + '_min'] : 0,\n\t\t\t\t\t\t\t\tmax: isFinite(this.track_info[prop + '_max']) ? this.track_info[prop + '_max'] : 1,\n\t\t\t\t\t\t\t\tpalette: {\n\t\t\t\t\t\t\t\t\t0.0: '#008800',\n\t\t\t\t\t\t\t\t\t0.5: '#ffff00',\n\t\t\t\t\t\t\t\t\t1.0: '#ff0000'\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tweight: 5,\n\t\t\t\t\t\t\t\toutlineColor: '#000000',\n\t\t\t\t\t\t\t\toutlineWidth: 1\n\t\t\t\t\t\t\t}).addTo(this._hotline);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t});\n\t\t}\n\t},\n\n\t/**\n\t * Initialize \"L.AlmostOver\" and \"L.DistanceMarkers\"\n\t */\n\t_initMapIntegrations: function(control, layer) {\n\t\tlet map = control._map;\n\t\tif (control._data.length) {\n\t\t\tcontrol._start.setLatLng(control._data[0].latlng);\n\t\t\tcontrol._end.setLatLng(control._data[control._data.length -1].latlng);\n\t\t}\n\t\tif (map) {\n\t\t\tcontrol._circleMarkers.addTo(map);\n\t\t\tmap.once('layeradd', (e) => control.options.autofitBounds && control.fitBounds(layer.getBounds()));\n\t\t\tif (!L.Browser.mobile) {\n\t\t\t\tcontrol._initHotLine(map, layer);\n\t\t\t\tcontrol._initAlmostOverHandler(map, layer);\n\t\t\t\tcontrol._initDistanceMarkers(map, layer);\n\t\t\t} else if (control.options.polyline) {\n\t\t\t\tlayer.addTo(map);\n\t\t\t}\n\t\t\tmap.invalidateSize();\n\t\t} else {\n\t\t\tconsole.warn(\"Undefined elevation map object\");;\n\t\t}\n\t},\n\n\t/*\n\t * Collapse current chart control.\n\t */\n\t_collapse: function() {\n\t\t_.replaceClass(this._container, 'elevation-expanded', 'elevation-collapsed');\n\t\tif (this._map) this._map.invalidateSize();\n\t},\n\n\t/*\n\t * Expand current chart control.\n\t */\n\t_expand: function() {\n\t\t_.replaceClass(this._container, 'elevation-collapsed', 'elevation-expanded');\n\t\tif (this._map) this._map.invalidateSize();\n\t},\n\n\t/**\n\t * Add some basic colors to leaflet canvas renderer (preferCanvas: true).\n\t */\n\t_fixCanvasPaths: function() {\n\t\tlet oldProto = L.Canvas.prototype._fillStroke;\n\t\tlet control = this;\n\n\t\tlet theme = this.options.theme.split(' ')[0].replace('-theme', '');\n\t\tlet color = _.Colors[theme] || {};\n\n\t\tL.Canvas.include({\n\t\t\t_fillStroke: function(ctx, layer) {\n\t\t\t\tif (control._layers.hasLayer(layer)) {\n\n\t\t\t\t\tlet options = layer.options;\n\n\t\t\t\t\toptions.color = color.line || color.area || theme;\n\t\t\t\t\toptions.stroke = !!options.color;\n\n\t\t\t\t\toldProto.call(this, ctx, layer);\n\n\t\t\t\t\tif (options.stroke && options.weight !== 0) {\n\t\t\t\t\t\tlet oldVal = ctx.globalCompositeOperation || 'source-over';\n\t\t\t\t\t\tctx.globalCompositeOperation = 'destination-over'\n\t\t\t\t\t\tctx.strokeStyle = color.outline || '#FFF';\n\t\t\t\t\t\tctx.lineWidth = options.weight * 1.75;\n\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t\tctx.globalCompositeOperation = oldVal;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\toldProto.call(this, ctx, layer);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * Partial fix for initial tooltip size\n\t * \n\t * @link https://github.com/Raruto/leaflet-elevation/issues/81#issuecomment-713477050\n\t */\n\t_fixTooltipSize: function() {\n\t\tthis.on('elechart_init', () =>\n\t\t\tthis.once('elechart_change elechart_hover', ({data, xCoord}) => {\n\t\t\t\tif (this._chartEnabled) {\n\t\t\t\t\tthis._chart._showDiagramIndicator(data, xCoord);\n\t\t\t\t\tthis._chart._showDiagramIndicator(data, xCoord);\n\t\t\t\t}\n\t\t\t\tthis._updateMarker(data);\n\t\t\t})\n\t\t);\n\t},\n\n\t/*\n\t * Finds a data entry for the given LatLng\n\t */\n\t_findItemForLatLng: function(latlng) {\n\t\treturn this._data[this._chart._findIndexForLatLng(latlng)];\n\t},\n\n\t/*\n\t * Finds a data entry for the given xDiagCoord\n\t */\n\t_findItemForX: function(x) {\n\t\treturn this._data[this._chart._findIndexForXCoord(x)];\n\t},\n\n\t/**\n\t * Fires an event of the specified type.\n\t */\n\t_fireEvt: function(type, data, propagate) {\n\t\tif (this.fire) this.fire(type, data, propagate);\n\t\tif (this._map) this._map.fire(type, data, propagate);\n\t},\n\n\t/*\n\t * Hides the position/height indicator marker drawn onto the map\n\t */\n\t_hideMarker: function() {\n\t\tif (this.options.autohideMarker) {\n\t\t\tthis._marker.remove();\n\t\t}\n\t},\n\n\t/**\n\t * Generate \"svg\" chart (DOM element).\n\t */\n\t_initChart: function(container) {\n\t\tlet opts = this.options;\n\n\t\tif (opts.detached) {\n\t\t\tlet { offsetWidth, offsetHeight} = this.eleDiv;\n\t\t\tif (offsetWidth > 0) opts.width = offsetWidth;\n\t\t\tif (offsetHeight > 20) opts.height = offsetHeight - 20; // 20 = horizontal scrollbar size.\n\t\t} else {\n\t\t\tlet { clientWidth } = this._map.getContainer();\n\t\t\topts._maxWidth = opts._maxWidth > opts.width ? opts._maxWidth : opts.width;\n\t\t\tthis._container.style.maxWidth = opts._maxWidth + 'px';\n\t\t\tif (opts._maxWidth > clientWidth) opts.width = clientWidth - 30;\n\t\t}\n\n\t\tPromise.all([\n\t\t\tthis.import(this.__D3),\n\t\t\tthis.import(this.__LCHART)\n\t\t]).then((m) => {\n\n\t\t\tlet chart = this._chart = new (m[1] || Elevation).Chart(opts, this);\n\t\n\t\t\tthis._x = this._chart._x;\n\t\t\tthis._y = this._chart._y;\n\t\n\t\t\td3\n\t\t\t\t.select(container)\n\t\t\t\t.call(chart.render())\n\t\n\t\t\tchart\n\t\t\t\t.on('reset_drag', this._hideMarker, this)\n\t\t\t\t.on('mouse_enter', this._onMouseEnter, this)\n\t\t\t\t.on('dragged', this._onDragEnd, this)\n\t\t\t\t.on('mouse_move', this._onMouseMove, this)\n\t\t\t\t.on('mouse_out', this._onMouseOut, this)\n\t\t\t\t.on('ruler_filter', this._onRulerFilter, this)\n\t\t\t\t.on('zoom', this._updateChart, this)\n\t\t\t\t.on('elepath_toggle', this._onToggleChart, this)\n\t\t\t\t.on('margins_updated', this._resizeChart, this);\n\t\n\t\n\t\t\tthis.fire(\"elechart_init\");\n\n\t\t\tmap\n\t\t\t\t.on('zoom viewreset zoomanim', this._hideMarker, this)\n\t\t\t\t.on('resize', this._resetView, this)\n\t\t\t\t.on('resize', this._resizeChart, this)\n\t\t\t\t.on('rotate', this._rotateMarker, this)\n\t\t\t\t.on('mousedown', this._resetDrag, this);\n\n\t\t\t_.on(map.getContainer(), 'mousewheel', this._resetDrag, this);\n\t\t\t_.on(map.getContainer(), 'touchstart', this._resetDrag, this);\n\t\t\t_.on(document, 'keydown', this._onKeyDown, this);\n\n\t\t\tthis\n\t\t\t\t.on('eledata_added eledata_loaded', this._updateChart, this)\n\t\t\t\t.on('eledata_added eledata_loaded', this._updateSummary, this);\n\n\t\t\tthis._updateChart();\n\t\t\tthis._updateSummary();\n\t\t});\n\n\t},\n\n\t_initLayer: function() {\n\t\tthis._layers\n\t\t\t.on('layeradd layerremove', ({layer, type}) => {\n\t\t\t\tlet node = layer.getElement && layer.getElement();\n\t\t\t\t_.toggleClass(node, this.options.polyline.className + ' ' + this.options.theme, type == 'layeradd');\n\t\t\t\t_.toggleEvent(layer, \"mousemove\", this._onMouseMoveLayer.bind(this), type == 'layeradd')\n\t\t\t\t_.toggleEvent(layer, \"mouseout\", this._onMouseOut.bind(this), type == 'layeradd');\n\t\t\t});\n\t},\n\n\t_initMarker: function(map) {\n\t\tlet pane = map.getPane('elevationPane');\n\t\tif (!pane) {\n\t\t\tpane = this._pane = map.createPane('elevationPane', map.getPane('norotatePane') || map.getPane('mapPane'));\n\t\t\tpane.style.zIndex = 625; // This pane is above markers but below popups.\n\t\t\tpane.style.pointerEvents = 'none';\n\t\t}\n\n\t\tif (this._renderer) this._renderer.remove()\n\t\tthis._renderer = L.svg({ pane: \"elevationPane\" }).addTo(this._map); // default leaflet svg renderer\n\n\t\tPromise.all([\n\t\t\tthis.import(this.__D3),\n\t\t\tthis.import(this.__LMARKER)\n\t\t]).then((m) => {\n\t\t\tthis._marker = new (m[1] || Elevation).Marker(this.options, this);\n\t\t\tthis.fire(\"elechart_marker\");\n\t\t});\n\t},\n\n\t/**\n\t * Inspired by L.Control.Layers\n\t */\n\t_initButton: function(container) {\n\n\t\tif (L.Browser.mobile || !this.options.detached) {\n\t\t\tL.DomEvent\n\t\t\t\t.disableClickPropagation(container)\n\t\t\t\t.disableScrollPropagation(container);\n\t\t}\n\n\t\tthis.options.collapsed ? this._collapse() : this._expand();\n\n\t\tif (this.options.autohide) {\n\t\t\t_.on(container, 'mouseover', this._expand, this);\n\t\t\t_.on(container, 'mouseout', this._collapse, this);\n\t\t\tthis._map.on('click', this._collapse, this);\n\t\t}\n\n\t\tif (this.options.closeBtn) {\n\t\t\tlet link = this._button = _.create('a', \"elevation-toggle-icon\", { href: '#', title: L._('Elevation'), }, container);\n\t\t\t_.on(link, 'click', L.DomEvent.stop);\n\t\t\t_.on(link, 'click', this._toggle, this);\n\t\t\t_.on(link, 'focus', this._toggle, this);\n\t\t}\n\t},\n\n\t_initSummary: function(container) {\n\t\tthis.import(this.__LSUMMARY).then((m)=>{\n\t\t\tthis._summary = new (m || Elevation).Summary({ summary: this.options.summary }, this);\n\n\t\t\tthis.on('elechart_init', () => {\n\t\t\t\td3.select(container).call(this._summary.render());\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n\t * Retrieve data from a remote url (HTTP).\n\t */\n\t_loadFile: function(url) {\n\t\tfetch(url)\n\t\t\t.then((response) => response.text())\n\t\t\t.then((data) => {\n\t\t\t\tthis._downloadURL = url; // TODO: handle multiple urls?\n\t\t\t\tthis._parseFromString(data)\n\t\t\t\t\t.then( geojson => geojson && this._loadLayer(geojson));\n\t\t\t}).catch((err) => console.warn(err));\n\t},\n\n\t/**\n\t * Dynamically import only required javascript modules (code splitting)\n\t */\n\t_loadModules: function(handlers) {\n\t\t// First map known classnames (eg. \"Altitude\" --> L.Control.Elevation.Altitude)\n\t\thandlers = handlers.map((h) => typeof h === 'string' && typeof Elevation[h] !== \"undefined\" ? Elevation[h] : h);\n\t\t// Then load optional classes and custom imports (eg. \"Cadence\" --> import('../src/handlers/cadence.js'))\n\t\tPromise.\n\t\t\tall(\n\t\t\t\thandlers\n\t\t\t\t\t.filter(h => typeof h === 'string' || h instanceof Promise)\n\t\t\t\t\t.map(file => file instanceof Promise ? file : this.import(this.__modulesFolder + file.toLowerCase() + '.js'))\n\t\t\t)\n\t\t\t.then((m) => {\n\t\t\t\t_.each(m, (exported) => {\n\t\t\t\t\tlet fn = Object.keys(exported)[0];\n\t\t\t\t\tif (fn && typeof Elevation[fn] === \"undefined\" ) {\n\t\t\t\t\t\thandlers[fn] = Elevation[fn] = exported[fn];\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t_.each(handlers, h => this._registerHandler(h));\n\t\t\t});\n\t},\n\n\t/**\n\t * Simple GeoJSON data loader (L.GeoJSON).\n\t */\n\t_loadLayer: function(geojson) {\n\t\tlet { polyline, theme, waypoints, wptIcons, wptLabels, distanceMarkers } = this.options;\n\t\tlet style = L.extend({}, polyline);\n\n\t\tif (theme) {\n\t\t\tstyle.className += ' ' + theme;\n\t\t}\n\n\t\tif (geojson.name) {\n\t\t\tthis.track_info.name = geojson.name;\n\t\t}\n\n\t\tlet layer = L.geoJson(geojson, {\n\t\t\tdistanceMarkers: distanceMarkers,\n\t\t\tstyle: style,\n\t\t\tpointToLayer: (feature, latlng) => {\n\t\t\t\tif (waypoints) {\n\t\t\t\t\tlet { desc, name, sym } = feature.properties;\n\t\t\t\t\tdesc = desc || '';\n\t\t\t\t\tname = name || '';\n\t\t\t\t\t// Handle chart waypoints (dots)\n\t\t\t\t\tif ([true, 'dots'].includes(waypoints)) {\n\t\t\t\t\t\tthis._registerCheckPoint({\n\t\t\t\t\t\t\tlatlng: latlng,\n\t\t\t\t\t\t\tlabel : ([true, 'dots'].includes(wptLabels) ? name : '')\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\t// Handle map waypoints (markers)\n\t\t\t\t\tif ([true, 'markers'].includes(waypoints) && wptIcons != false) {\n\t\t\t\t\t\treturn this._registerMarker({\n\t\t\t\t\t\t\tlatlng : latlng,\n\t\t\t\t\t\t\tsym : (sym ?? name).replace(' ', '-').replace('\"', '').replace(\"'\", '').toLowerCase(),\n\t\t\t\t\t\t\tcontent: [true, 'markers'].includes(wptLabels) && (name || desc) && decodeURI(\"<b>\" + name + \"</b>\" + (desc.length > 0 ? '<br>' + desc : ''))\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tonEachFeature: (feature, layer) => feature.geometry && feature.geometry.type != 'Point' && this.addData(feature, layer),\n\t\t});\n\n\t\tthis.import(this.__D3).then(() => {\n\t\t\tthis._initMapIntegrations(this, layer);\n\t\t\tthis._fireEvt(\"eledata_loaded\", { data: geojson, layer: layer, name: this.track_info.name, track_info: this.track_info });\n\t\t});\n\n\t\treturn layer;\n\t},\n\n\t_onDragEnd: function({ dragstart, dragend}) {\n\t\tthis._hideMarker();\n\t\tthis.fitBounds(L.latLngBounds([dragstart.latlng, dragend.latlng]));\n\n\t\tthis.fire(\"elechart_dragged\");\n\t},\n\n\t_onKeyDown: function({key}) {\n\t\tif(!this.options.detached && key === \"Escape\"){\n\t\t\tthis._collapse()\n\t\t};\n\t},\n\n\t/**\n\t * Trigger mouseenter event.\n\t */\n\t_onMouseEnter: function() {\n\t\tthis.fire('elechart_enter');\n\t},\n\n\t/*\n\t * Handles the moueseover the chart and displays distance and altitude level.\n\t */\n\t_onMouseMove: function({xCoord}) {\n\t\tif (this._chartEnabled && this._data.length) {\n\t\t\tlet item = this._findItemForX(xCoord);\n\t\t\tif (item) {\n\t\t\t\tif (this._chartEnabled) this._chart._showDiagramIndicator(item, xCoord);\n\n\t\t\t\tthis._updateMarker(item);\n\t\t\t\tthis._setMapView(item);\n\n\t\t\t\tif (this._map) {\n\t\t\t\t\t_.addClass(this._map.getContainer(), 'elechart-hover');\n\t\t\t\t}\n\n\t\t\t\tthis.fire(\"elechart_change\", { data: item, xCoord: xCoord });\n\t\t\t\tthis.fire(\"elechart_hover\", { data: item, xCoord: xCoord });\n\t\t\t}\n\t\t}\n\t},\n\n\t/*\n\t * Handles mouseover events of the data layers on the map.\n\t */\n\t_onMouseMoveLayer: function({latlng}) {\n\t\tif (this._data.length) {\n\t\t\tlet item = this._findItemForLatLng(latlng);\n\t\t\tif (item) {\n\t\t\t\tlet xCoord = item.xDiagCoord;\n\t\n\t\t\t\tif (this._chartEnabled) this._chart._showDiagramIndicator(item, xCoord);\n\t\n\t\t\t\tthis._updateMarker(item);\n\t\n\t\t\t\tthis.fire(\"elechart_change\", { data: item, xCoord: xCoord });\n\t\t\t}\n\t\t}\n\t},\n\n\t/*\n\t * Handles the moueseout over the chart.\n\t */\n\t_onMouseOut: function() {\n\t\tif (!this.options.detached) {\n\t\t\tthis._hideMarker();\n\t\t\tthis._chart._hideDiagramIndicator();\n\t\t}\n\n\t\tif (this._map) {\n\t\t\t_.removeClass(this._map.getContainer(), 'elechart-hover');\n\t\t}\n\n\t\tthis.fire(\"elechart_leave\");\n\t},\n\n\t/**\n\t * Handles the drag event over the ruler filter.\n\t */\n\t_onRulerFilter: function({coords}) {\n\t\tthis._updateMapSegments(coords);\n\t},\n\n\t/**\n\t * Toggle chart data on legend click\n\t */\n\t_onToggleChart: function({ name, enabled }) {\n\n\t\tthis._chartEnabled = this._chart._hasActiveLayers();\n\n\t\t// toggle layer visibility on empty chart\n\t\tthis._layers.eachLayer(layer => _.toggleClass(layer.getElement && layer.getElement(), this.options.polyline.className + ' ' + this.options.theme, this._chartEnabled));\n\n\t\t// toggle option value (eg. altitude = { 'disabled' || 'enabled' })\n\t\tthis.options[name] = !enabled && this.options[name] == 'disabled' ? 'enabled' : 'disabled';\n\n\t\t// remove marker on empty chart\n\t\tif (!this._chartEnabled) {\n\t\t\tthis._chart._hideDiagramIndicator();\n\t\t\tthis._marker.remove();\n\t\t}\n\t},\n\n\t/**\n\t * Simple GeoJSON Parser\n\t */\n\t_parseFromGeoJSONString: function(data) {\n\t\ttry {\n\t\t\treturn JSON.parse(data);\n\t\t} catch (e) { }\n\t},\n\n\t/**\n\t * Attempt to parse raw response data (GeoJSON or XML > GeoJSON)\n\t */\n\t_parseFromString: function(data) {\n\t\treturn new Promise(resolve =>\n\t\t\tthis.import(this.__TOGEOJSON).then(() => {\n\t\t\t\tlet geojson;\n\t\t\t\ttry {\n\t\t\t\t\tgeojson = this._parseFromXMLString(data.trim());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tgeojson = this._parseFromGeoJSONString(data.toString());\n\t\t\t\t}\n\t\t\t\tif (geojson) {\n\t\t\t\t\tgeojson.name = geojson.name || (this._downloadURL || '').split('/').pop().split('#')[0].split('?')[0];\n\t\t\t\t}\n\t\t\t\tresolve(geojson);\n\t\t\t})\n\t\t);\n\t},\n\n\t/**\n\t * Simple XML Parser (GPX, KML, TCX)\n\t */\n\t_parseFromXMLString: function(data) {\n\t\tif (data.indexOf(\"<\") != 0) {\n\t\t\tthrow 'Invalid XML';\n\t\t}\n\t\tlet xml = (new DOMParser()).parseFromString(data, \"text/xml\");\n\t\tlet type = xml.documentElement.tagName.toLowerCase(); // \"kml\" or \"gpx\"\n\t\tlet name = xml.getElementsByTagName('name');\n\t\tif (xml.getElementsByTagName('parsererror').length) {\n\t\t\tthrow 'Invalid XML';\n\t\t}\n\t\tif (!(type in toGeoJSON)) {\n\t\t\ttype = xml.documentElement.tagName == \"TrainingCenterDatabase\" ? 'tcx' : 'gpx';\n\t\t}\n\t\tlet geojson = toGeoJSON[type](xml);\n\t\tgeojson.name = name.length > 0 ? (Array.from(name).find(tag => tag.parentElement.tagName == \"trk\") ?? name[0]).textContent : '';\n\t\treturn geojson;\n\t},\n\n\t/**\n\t * Add chart profile to diagram\n\t */\n\t_registerAreaPath: function(props) {\n\t\tthis.on(\"elechart_init\", () => this._chart._registerAreaPath(props));\n\t},\n\n\t/**\n\t * Add chart grid to diagram\n\t */\n\t_registerAxisGrid: function(props) {\n\t\tthis.on(\"elechart_axis\", () => this._chart._registerAxisGrid(props));\n\t},\n\n\t/**\n\t * Add chart axis to diagram\n\t */\n\t_registerAxisScale: function(props) {\n\t\tthis.on(\"elechart_axis\", () => this._chart._registerAxisScale(props));\n\t},\n\n\t/**\n\t * Add a point of interest over the diagram\n\t */\n\t_registerCheckPoint: function(props) {\n\t\tthis.on(\"elechart_updated\", () => this._chart._registerCheckPoint(props));\n\t},\n\n\n\t/**\n\t * Base handler for iterative track statistics (dist, time, z, slope, speed, acceleration, ...)\n\t */\n\t _registerDataAttribute: function(props) {\n\n\t\t// parse of \"coordinateProperties\" for later usage\n\t\tif (props.coordPropsToMeta) {\n\t\t\tthis.on(\"elepoint_init\", (e) => props.coordPropsToMeta.call(this, e));\n\t\t}\n\n\t\t// prevent excessive variabile instanstations\n\t\tlet i, curr, prev, attr;\n\n\t\t// save here a reference to last used point\n\t\tlet lastValid = null; \n\n\t\t// iteration\n\t\tthis.on(\"elepoint_added\", ({index, point}) => {\n\t\t\ti = index;\n\n\t\t\tprev = curr ?? this._data[i]; // same as: this._data[i > 0 ? i - 1 : i]\n\t\t\tcurr = this._data[i];\n\t\t\tattr = props.attr || props.name;\n\n\t\t\t// check and fix missing data on last added point\n\t\t\tif (props.skipNull === false) {\n\t\t\t\tlet curr = this._data[i][attr];\n\t\t\t\tif(i > 0) {\n\t\t\t\t\tlet prev = this._data[i - 1][attr];\n\t\t\t\t\tif (isNaN(prev)) {\n\t\t\t\t\t\tif (!isNaN(lastValid) && !isNaN(curr)) {\n\t\t\t\t\t\t\tprev = (lastValid + curr) / 2;\n\t\t\t\t\t\t} else if (!isNaN(lastValid)) {\n\t\t\t\t\t\t\tprev = lastValid;\n\t\t\t\t\t\t} else if (!isNaN(curr)) {\n\t\t\t\t\t\t\tprev = curr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!isNaN(prev)) return this._data.splice(i - 1, 1);\n\t\t\t\t\t\tthis._data[i - 1][attr] = prev;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// update reference to last used point (ie. if it has data)\n\t\t\t\tif (!isNaN(curr)) {\n\t\t\t\t\tlastValid = curr;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// retrieve point value\n\t\t\tcurr[attr] = props.pointToAttr.call(this, point, i);\n\n\t\t\t// update \"track_info\" stats (min, max, avg, ...)\n\t\t\tif (props.stats) {\n\t\t\t\tfor (const key in props.stats) {\n\t\t\t\t\tlet sname = (props.statsName || attr) + (key != '' ? '_' : '');\n\t\t\t\t\tthis.track_info[sname + key] = props.stats[key].call(this, curr[attr], this.track_info[sname + key]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Limit \"crazy\" delta values.\n\t\t\tif (props.deltaMax) {\n\t\t\t\tcurr[attr] =_.wrapDelta(curr[attr], prev[attr], props.deltaMax);\n\t\t\t}\n\t\t\t\n\t\t\t// Range of acceptable values.\n\t\t\tif (props.clampRange) {\n\t\t\t\tcurr[attr] = _.clamp(curr[attr], props.clampRange);\n\t\t\t}\n\n\t\t\t// Limit floating point precision.\n\t\t\tif (!isNaN(props.decimals)) {\n\t\t\t\tcurr[attr] = _.round(curr[attr], props.decimals);\n\t\t\t}\n\n\t\t\t// update here some mixins (eg. complex \"track_info\" stuff)\n\t\t\tif(props.onPointAdded) props.onPointAdded.call(this, curr[attr], i, point);\n\t\t});\n\t},\n\n\t/**\n\t * Parse a module definition and attach related function listeners\n\t */\n\t_registerHandler: function(props) {\n\n\t\t// eg. L.Control.Altitude\n\t\tif (typeof props === \"function\") {\n\t\t\treturn this._registerHandler(props.call(this));\n\t\t}\n\n\t\tlet {\n\t\t\tname,\n\t\t\tattr,\n\t\t\trequired,\n\t\t\tskipNull,\n\t\t\tdeltaMax,\n\t\t\tclampRange,\n\t\t\tdecimals,\n\t\t\tmeta,\n\t\t\tunit,\n\t\t\tcoordinateProperties,\n\t\t\tcoordPropsToMeta,\n\t\t\tpointToAttr,\n\t\t\tonPointAdded,\n\t\t\tstats,\n\t\t\tstatsName,\n\t\t\tgrid,\n\t\t\tscale,\n\t\t\tpath,\n\t\t\ttooltip,\n\t\t\tsummary\n\t\t} = props;\n\n\t\t// eg. \"altitude\" == true\n\t\tif (this.options[name] || required) {\n\n\t\t\tthis._registerDataAttribute({\n\t\t\t\tname,\n\t\t\t\tattr,\n\t\t\t\tskipNull,\n\t\t\t\tdeltaMax,\n\t\t\t\tclampRange,\n\t\t\t\tdecimals,\n\t\t\t\tcoordPropsToMeta: _.coordPropsToMeta(coordinateProperties, meta || name, coordPropsToMeta),\n\t\t\t\tpointToAttr,\n\t\t\t\tonPointAdded,\n\t\t\t\tstats,\n\t\t\t\tstatsName,\n\t\t\t});\n\n\t\t\tif (grid) {\n\t\t\t\tthis._registerAxisGrid(L.extend({ name }, grid));\n\t\t\t}\n\n\t\t\tif (this.options[name] !== \"summary\") {\n\t\t\t\tif (scale) this._registerAxisScale(L.extend({ name, label: unit }, scale));\n\t\t\t\tif (path) this._registerAreaPath(L.extend({ name }, path));\n\t\t\t}\n\n\t\t\tif (tooltip || props.tooltips) {\n\t\t\t\t_.each([tooltip, ...(props.tooltips || [])], t => t && this._registerTooltip(L.extend({ name }, t)));\n\t\t\t}\n\n\t\t\tif (summary) {\n\t\t\t\t_.each(summary, (s, k) => summary[k] = L.extend({ unit }, s));\n\t\t\t\tthis._registerSummary(summary);\n\t\t\t}\n\t\t}\n\t},\n\n\t_registerMarker({latlng, sym, content}) {\n\t\tlet { wptIcons } = this.options;\n\t\t// generate and cache appropriate icon symbol\n\t\tif (!wptIcons.hasOwnProperty(sym)) {\n\t\t\twptIcons[sym] = L.divIcon(L.extend({}, wptIcons[\"\"].options, { html: '<i class=\"elevation-waypoint-icon ' + sym + '\"></i>' } ));\n\t\t}\n\t\tlet marker = L.marker(latlng, { icon: wptIcons[sym] });\n\t\tif (content) {\n\t\t\tmarker.bindPopup(content, { className: 'elevation-popup', keepInView: true }).openPopup();\n\t\t\tmarker.bindTooltip(content, { className: 'elevation-tooltip', direction: 'auto', sticky: true, opacity: 1 }).openTooltip();\n\t\t}\n\t\treturn this._addMarker(marker)\n\t},\n\t\n\t/**\n\t * Add chart or marker tooltip info\n\t */\n\t_registerTooltip: function(props) {\n\t\tprops.chart && this.on(\"elechart_init\", () => this._chart._registerTooltip(L.extend({}, props, { value: props.chart })));\n\t\tprops.marker && this.on(\"elechart_marker\", () => this._marker._registerTooltip(L.extend({}, props, { value: props.marker })));\n\t},\n\n\t/**\n\t * Add summary info to diagram\n\t */\n\t_registerSummary: function(props) {\n\t\tthis.on('elechart_summary', () => this._summary._registerSummary(props));\n\t},\n\n\t/*\n\t * Removes the drag rectangle and zoms back to the total extent of the data.\n\t */\n\t_resetDrag: function() {\n\t\tthis._chart._resetDrag();\n\t\tthis._hideMarker();\n\t},\n\n\t/**\n\t * Resets drag, marker and bounds.\n\t */\n\t_resetView: function() {\n\t\tif (this._map && this._map._isFullscreen) return;\n\t\tthis._resetDrag();\n\t\tthis._hideMarker();\n\t\tif (this.options.autofitBounds) {\n\t\t\tthis.fitBounds();\n\t\t}\n\t},\n\n\t/**\n\t * Hacky way for handling chart resize. Deletes it and redraw chart.\n\t */\n\t_resizeChart: function() {\n\t\tif (this._container && _.style(this._container, \"display\") != \"none\") {\n\t\t\tlet opts = this.options;\n\t\t\tlet newWidth = opts.detached ? (this.eleDiv || this._container).offsetWidth : _.clamp(opts._maxWidth, [0, this._map.getContainer().clientWidth - 30]);\n\t\t\tif (newWidth) {\n\t\t\t\topts.width = newWidth;\n\t\t\t\tif (this._chart && this._chart._chart) {\n\t\t\t\t\tthis._chart._chart._resize(opts);\n\t\t\t\t\tthis._updateChart();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._updateMapSegments();\n\t\t}\n\t},\n\n\t/**\n\t * Collapse or Expand chart control.\n\t */\n\t_toggle: function() {\n\t\t_.hasClass(this._container, \"elevation-expanded\") ? this._collapse() : this._expand();\n\t},\n\n\t/**\n\t * Update map center and zoom (followMarker: true)\n\t */\n\t_setMapView: function(item) {\n\t\tif (this._map && this.options.followMarker) {\n\t\t\tlet zoom = this._map.getZoom();\n\t\t\tlet z = this.options.zFollow;\n\t\t\tif (typeof z === \"number\") {\n\t\t\t\tthis._map.setView(item.latlng, (zoom < z ? z : zoom), { animate: true, duration: 0.25 });\n\t\t\t} else if (!this._map.getBounds().contains(item.latlng)) {\n\t\t\t\tthis._map.setView(item.latlng, zoom, { animate: true, duration: 0.25 });\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Calculates [x, y] domain and then update chart.\n\t */\n\t_updateChart: function() {\n\t\tif (this._chart && this._container) {\n\t\t\tthis.fire(\"elechart_axis\");\n\t\n\t\t\tthis._chart.update({ data: this._data, options: this.options });\n\t\n\t\t\tthis._x = this._chart._x;\n\t\t\tthis._y = this._chart._y;\n\t\n\t\t\tthis.fire('elechart_updated');\t\t\n\t\t}\n\t},\n\n\t/*\n\t * Update the position/height indicator marker drawn onto the map\n\t */\n\t_updateMarker: function(item) {\n\t\tif (this._marker) {\n\t\t\tthis._marker.update({\n\t\t\t\tmap : this._map,\n\t\t\t\titem : item,\n\t\t\t\tyCoordMax : this._yCoordMax || 0,\n\t\t\t\toptions : this.options\n\t\t\t});\n\t\t}\n\t},\n\n\t/**\n\t * Fix marker rotation on rotated maps\n\t */\n\t_rotateMarker: function() {\n\t\tif (this._marker) {\n\t\t\tthis._marker.update();\n\t\t}\n\t},\n\n\t/**\n\t * Highlight track segments on the map.\n\t */\n\t_updateMapSegments: function(coords) {\n\t\tthis._markedSegments.setLatLngs(coords || []);\n\t\tif (coords && this._map && !this._map.hasLayer(this._markedSegments)) {\n\t\t\tthis._markedSegments.addTo(this._map);\n\t\t}\n\t},\n\n\t/**\n\t * Update chart summary.\n\t */\n\t_updateSummary: function() {\n\t\tif (this._summary) {\n\t\t\tthis._summary.reset();\n\t\t\tif (this.options.summary) {\n\t\t\t\tthis.fire(\"elechart_summary\");\n\t\t\t\tthis._summary.update();\n\t\t\t}\n\t\t\tif (this.options.downloadLink && this._downloadURL) { // TODO: generate dynamically file content instead of using static file urls.\n\t\t\t\tthis._summary._container.innerHTML += '<span class=\"download\"><a href=\"#\">' + L._('Download') + '</a></span>'\n\t\t\t\t_.select('.download a', this._summary._container).onclick = (e) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tlet event = { downloadLink: this.options.downloadLink, confirm: _.saveFile.bind(this, this._downloadURL) };\n\t\t\t\t\tif (this.options.downloadLink == 'modal' && typeof CustomEvent === \"function\") {\n\t\t\t\t\t\tdocument.dispatchEvent(new CustomEvent(\"eletrack_download\", { detail: event }));\n\t\t\t\t\t} else if (this.options.downloadLink == 'link' || this.options.downloadLink === true) {\n\t\t\t\t\t\tevent.confirm();\n\t\t\t\t\t}\n\t\t\t\t\tthis.fire('eletrack_download', event);\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t},\n\n\n\t/**\n\t * Calculates chart width.\n\t */\n\t_width: function() {\n\t\tif (this._chart) return this._chart._width();\n\t\tconst { width, margins } = this.options;\n\t\treturn width - margins.left - margins.right;\n\t},\n\n\t/**\n\t * Calculates chart height.\n\t */\n\t_height: function() {\n\t\tif (this._chart) return this._chart._height();\n\t\tconst { height, margins } = this.options;\n\t\treturn height - margins.top - margins.bottom;\n\t},\n\n});","/*\n * Copyright (c) 2019, GPL-3.0+ Project, Raruto\n *\n * This file is free software: you may copy, redistribute and/or modify it\n * under the terms of the GNU General Public License as published by the\n * Free Software Foundation, either version 2 of the License, or (at your\n * option) any later version.\n *\n * This file is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n *\n * This file incorporates work covered by the following copyright and\n * permission notice:\n *\n * Copyright (c) 2013-2016, MIT License, Felix “MrMufflon” Bache\n *\n * Permission to use, copy, modify, and/or distribute this software\n * for any purpose with or without fee is hereby granted, provided\n * that the above copyright notice and this permission notice appear\n * in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL\n * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE\n * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR\n * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,\n * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN\n * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport 'leaflet-i18n';\nimport * as _ from './utils';\nimport { Elevation } from './control';\n\nElevation.Utils = _;\n\n/* Temporary fix for empty values evaluated as false (leaflet-i18n v0.3.1) */\n(function(){\n\tlet proto = L.i18n.bind({});\n\tL.i18n = L._ = (string, data) => {\n\t\tif (L.locale && L.locales[L.locale] && L.locales[L.locale][string] == \"\") {\n\t\t\tL.locales[L.locale][string] = \"\\u200B\";\n\t\t}\n\t\treturn proto.call(null, string, data);\n\t};\n})();\n\nL.control.elevation = (options) => new Elevation(options);\n"],"names":["factory","window","define","amd","exports","module","require","L","locales","locale","registerLocale","code","Util","extend","setLocale","i18n","_","string","data","template","err","Colors","lightblue","area","alpha","stroke","magenta","yellow","purple","steelblue","red","lime","line","MIN","SEC","HOUR","DAY","saveFile","dataURI","fileName","a","create","href","target","download","style","b","document","body","appendChild","click","removeChild","coordPropsToMeta","coordProps","name","parser","props","point","id","isMulti","key","meta","parseInt","call","this","property","addClass","n","str","split","every","s","DomUtil","removeClass","toggleClass","cond","replaceClass","rem","add","k","v","getStyle","setProperty","setAttributes","attrs","setAttribute","toggleEvent","el","e","fn","tag","elem","append","c","insert","pos","insertAdjacentElement","select","querySelector","each","obj","i","randomId","Math","random","toString","substr","on","off","DomEvent","throttle","wrapNum","hasClass","round","formatNum","clamp","val","range","wrapDelta","curr","prev","deltaMax","abs","sign","t","d","floor","h","m","padStart","format","time","Date","toLocaleTimeString","toLocaleDateString","toLocaleString","replaceAll","ctx","path","classed","beginPath","moveTo","p","Path2D","attr","strokeStyle","fillStyle","lineWidth","globalCompositeOperation","globalAlpha","fill","closePath","parse","iVal","max","Infinity","min","avg","sum","Options","autofitBounds","autohide","autohideMarker","almostover","altitude","closeBtn","collapsed","detached","distance","distanceMarkers","lazy","direction","dragging","Browser","mobile","downloadLink","elevationDiv","followMarker","imperial","legend","handlers","hotline","marker","markerIcon","divIcon","className","html","iconSize","iconAnchor","position","polyline","color","opacity","weight","lineCap","polylineSegments","interactive","preferCanvas","reverseCoords","ruler","theme","summary","slope","speed","timeFactor","timestamps","trkStart","circleMarker","radius","fillColor","fillOpacity","trkEnd","waypoints","wptIcons","wptLabels","xAttr","xLabel","yAttr","yLabel","zFollow","zooming","Mobile","margins","top","right","bottom","left","height","screen","width","xTicks","undefined","yTicks","decimalsX","decimalsY","forceAxisBounds","interpolation","skipNullZCoords","yAxisMax","yAxisMin","Elevation","Control","includes","Evented","prototype","Mixin","Events","options","__mileFactor","__footFactor","__D3","__TOGEOJSON","__LGEOMUTIL","__LALMOSTOVER","__LHOTLINE","__LDISTANCEM","__LCHART","__LMARKER","__LSUMMARY","__modulesFolder","addData","layer","import","then","_addData","_addLayer","_fireEvt","track_info","addTo","map","parent","_.select","eleDiv","onAdd","_.append","_.insert","getContainer","clear","_marker","remove","_chart","_clearChart","_layers","_clearLayers","_markers","_circleMarkers","_data","_updateChart","_events","elechart_updated","forEach","_container","selectAll","l","eachLayer","f","clearLayers","disableBrush","_brushEnabled","_resetDrag","enableBrush","disableZoom","_zoomEnabled","_resetZoom","enableZoom","fitBounds","bounds","getBounds","_map","isValid","latLngBounds","latlng","getZFollow","hide","_.style","initialize","opts","setOptions","featureGroup","_markedSegments","_start","_end","_chartEnabled","_yCoordMax","_setMapView","_.throttle","setStyle","_.Colors","colors","_fixCanvasPaths","_fixTooltipSize","src","condition","d3","toGeoJSON","GeometryUtil","Handler","AlmostOver","DistanceMarkers","Promise","resolve","load","_parseFromString","geojson","_loadLayer","_loadFile","container","_.create","_.randomId","modules","filter","toLowerCase","_loadModules","_initButton","_initChart","_initSummary","_initMarker","_initLayer","onRemove","_hideMarker","_resetView","_resizeChart","_.off","_onKeyDown","_updateSummary","redraw","setZFollow","zoom","show","type","_.each","features","feature","geom","geometry","_addGeoJSONData","coordinates","properties","coords","console","warn","_latlngs","nestingLevel","coordinateProperties","ele","fire","_addPoint","lat","lng","alt","index","length","x","y","z","push","latLng","addLayer","Polyline","_addMarker","_initAlmostOverHandler","almostOver","all","addHandler","enabled","_onMouseMoveLayer","_onMouseOut","_initDistanceMarkers","bringToFront","_initHotLine","_hotline","_renderer","parentElement","insertBefore","firstChild","prop","trkseg","geo","geoJson","coordsToLatLng","isFinite","palette","0","0.5","1","outlineColor","outlineWidth","_initMapIntegrations","control","setLatLng","once","invalidateSize","_collapse","_.replaceClass","_expand","oldProto","Canvas","_fillStroke","replace","include","hasLayer","oldVal","outline","xCoord","_showDiagramIndicator","_updateMarker","_findItemForLatLng","_findIndexForLatLng","_findItemForX","_findIndexForXCoord","propagate","offsetWidth","offsetHeight","clientWidth","_maxWidth","maxWidth","chart","Chart","_x","_y","render","_onMouseEnter","_onDragEnd","_onMouseMove","_onRulerFilter","_onToggleChart","_rotateMarker","_.on","node","getElement","_.toggleClass","_.toggleEvent","bind","pane","getPane","_pane","createPane","zIndex","pointerEvents","svg","Marker","disableClickPropagation","disableScrollPropagation","link","_button","title","stop","_toggle","_summary","Summary","url","fetch","response","text","_downloadURL","catch","file","exported","Object","keys","_registerHandler","pointToLayer","desc","sym","_registerCheckPoint","label","_registerMarker","content","decodeURI","onEachFeature","dragstart","dragend","item","_.addClass","xDiagCoord","_hideDiagramIndicator","_.removeClass","_updateMapSegments","_hasActiveLayers","_parseFromGeoJSONString","JSON","_parseFromXMLString","trim","pop","indexOf","xml","DOMParser","parseFromString","documentElement","tagName","getElementsByTagName","Array","from","find","textContent","_registerAreaPath","_registerAxisGrid","_registerAxisScale","_registerDataAttribute","lastValid","skipNull","isNaN","splice","pointToAttr","stats","sname","statsName","_.wrapDelta","clampRange","_.clamp","decimals","_.round","onPointAdded","required","unit","grid","scale","tooltip","_.coordPropsToMeta","tooltips","_registerTooltip","_registerSummary","[object Object]","hasOwnProperty","icon","bindPopup","keepInView","openPopup","bindTooltip","sticky","openTooltip","value","_isFullscreen","newWidth","_resize","_.hasClass","getZoom","setView","animate","duration","contains","update","yCoordMax","setLatLngs","reset","innerHTML","onclick","preventDefault","event","confirm","_.saveFile","CustomEvent","dispatchEvent","detail","_width","_height","Utils","proto","elevation"],"mappings":"4FACC,SAAUA,EAASC,GAGM,mBAAXC,QAAyBA,OAAOC,IACvCD,OAAO,CAAC,WAAYF,GAGM,iBAAZI,UACdC,OAAOD,QAAUJ,EAAQM,QAAQ,kBAIf,IAAXL,GAA0BA,EAAOM,GACxCP,EAAQC,EAAOM,GAbvB,EAgBE,SAAUA,GASR,OARAA,EAAEC,QAAU,GACZD,EAAEE,OAAS,KACXF,EAAEG,eAAiB,SAAwBC,EAAMF,GAC7CF,EAAEC,QAAQG,GAAQJ,EAAEK,KAAKC,OAAO,GAAIN,EAAEC,QAAQG,GAAOF,IAEzDF,EAAEO,UAAY,SAAmBH,GAC7BJ,EAAEE,OAASE,GAERJ,EA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,EAAEC,QAAQD,EAAEE,QAAQQ,KAC1DV,EAAEC,QAAQD,EAAEE,QAAQQ,GAAU,KAExBokB,EAAMthB,KAAK,KAAM9C,EAAQC,IANlC,GAUAX,EAAEqa,QAAQ0K,UAAa/V,GAAY,IAAIP,EAAUO"}
1
+ {"version":3,"file":"leaflet-elevation.min.js","sources":["../node_modules/leaflet-i18n/Leaflet.i18n.js","../src/utils.js","../src/options.js","../src/control.js","../src/index.js"],"sourcesContent":["// Following https://github.com/Leaflet/Leaflet/blob/master/PLUGIN-GUIDE.md\n(function (factory, window) {\n\n // define an AMD module that relies on 'leaflet'\n if (typeof define === 'function' && define.amd) {\n define(['leaflet'], factory);\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 L.locales = {};\n L.locale = null;\n L.registerLocale = function registerLocale(code, locale) {\n L.locales[code] = L.Util.extend({}, L.locales[code], locale);\n };\n L.setLocale = function setLocale(code) {\n L.locale = code;\n };\n return L.i18n = L._ = function translate(string, data) {\n if (L.locale && L.locales[L.locale] && L.locales[L.locale][string]) {\n string = L.locales[L.locale][string];\n }\n try {\n // Do not fail if some data is missing\n // a bad translation should not break the app\n string = L.Util.template(string, data);\n }\n catch (err) {/*pass*/\n }\n\n return string;\n };\n}, window));\n","/**\n * TODO: exget computed styles of theese values from actual \"CSS vars\"\n **/\nexport const Colors = {\n\t'lightblue': { area: '#3366CC', alpha: 0.45, stroke: '#3366CC' },\n\t'magenta' : { area: '#FF005E' },\n\t'yellow' : { area: '#FF0' },\n\t'purple' : { area: '#732C7B' },\n\t'steelblue': { area: '#4682B4' },\n\t'red' : { area: '#F00' },\n\t'lime' : { area: '#9CC222', line: '#566B13' }\n};\n\nconst SEC = 1000;\nconst MIN = SEC * 60;\nconst HOUR = MIN * 60;\nconst DAY = HOUR * 24;\n\n/**\n * Convert a time (millis) to a human readable duration string (%Dd %H:%M'%S\")\n */\nexport function formatTime(t) {\n\tlet d = Math.floor(t / DAY);\n\tlet h = Math.floor( (t - d * DAY) / HOUR);\n\tlet m = Math.floor( (t - d * DAY - h * HOUR) / MIN);\n\tlet s = Math.round( (t - d * DAY - h * HOUR - m * MIN) / SEC);\n\tif ( s === 60 ) { m++; s = 0; }\n\tif ( m === 60 ) { h++; m = 0; }\n\tif ( h === 24 ) { d++; h = 0; }\n\treturn (d ? d + \"d \" : '') + h.toString().padStart(2, 0) + ':' + m.toString().padStart(2, 0) + \"'\" + s.toString().padStart(2, 0) + '\"';\n}\n\n/**\n * Convert a time (millis) to human readable date string (dd-mm-yyyy hh:mm:ss)\n */\n export function formatDate(format) {\n\tif (!format) {\n\t\treturn (time) => (new Date(time)).toLocaleString().replaceAll('/', '-').replaceAll(',', ' ');\n\t} else if (format == 'time') {\n\t\treturn (time) => (new Date(time)).toLocaleTimeString();\n\t} else if (format == 'date') {\n\t\treturn (time) => (new Date(time)).toLocaleDateString();\n\t}\n\treturn (time) => format(time);\n}\n\n/**\n * Generate download data event.\n */\n export function saveFile(dataURI, fileName) {\n\tlet a = create('a', '', { href: dataURI, target: '_new', download: fileName || \"\", style: \"display:none;\" });\n\tlet b = document.body;\n\tb.appendChild(a);\n\ta.click();\n\tb.removeChild(a);\n}\n\n\n/**\n * Convert SVG Path into Path2D and then update canvas\n */\n export function drawCanvas(ctx, path) {\n\tpath.classed('canvas-path', true);\n\n\tctx.beginPath();\n\tctx.moveTo(0, 0);\n\tlet p = new Path2D(path.attr('d'));\n\n\tctx.strokeStyle = path.attr('stroke');\n\tctx.fillStyle = path.attr('fill');\n\tctx.lineWidth = 1.25;\n\tctx.globalCompositeOperation = 'source-over';\n\n\t// stroke opacity\n\tctx.globalAlpha = path.attr('stroke-opacity') || 0.3;\n\tctx.stroke(p);\n\n\t// fill opacity\n\tctx.globalAlpha = path.attr('fill-opacity') || 0.45;\n\tctx.fill(p);\n\n\tctx.globalAlpha = 1;\n\n\tctx.closePath();\n}\n\n/**\n * Loop and extract GPX Extensions handled by \"@tmcw/toGeoJSON\" (eg. \"coordinateProperties\" > \"times\")\n */\nexport function coordPropsToMeta(coordProps, name, parser) {\n\treturn coordProps && (({props, point, id, isMulti }) => {\n\t\tif (props) {\n\t\t\tfor (const key of coordProps) {\n\t\t\t\tif (key in props) {\n\t\t\t\t\tpoint.meta[name] = (parser || parseInt).call(this, (isMulti ? props[key][isMulti] : props[key]), id);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}\n\n/**\n * Extract numeric property (id) from GeoJSON object\n */\nexport const parseInt = (property, id) => window.parseInt((typeof property === 'object' ? property[id] : property));\n\n/**\n * Extract datetime property (id) from GeoJSON object\n */\nexport const parseDate = (property, id) => new Date(Date.parse((typeof property === 'object' ? property[id] : property)));\n\n/**\n * A little bit shorter than L.DomUtil\n */\nexport const addClass = (n, str) => n && str.split(\" \").every(s => s && L.DomUtil.addClass(n, s));\nexport const removeClass = (n, str) => n && str.split(\" \").every(s => s && L.DomUtil.removeClass(n, s));\nexport const toggleClass = (n, str, cond) => (cond ? addClass : removeClass)(n, str);\nexport const replaceClass = (n, rem, add) => (rem && removeClass(n, rem)) || (add && addClass(n, add));\nexport const style = (n, k, v) => (typeof v === \"undefined\" && L.DomUtil.getStyle(n, k)) || n.style.setProperty(k, v);\nexport const toggleStyle = (n, k, v, cond) => style(n, k, cond ? v : '');\nexport const setAttributes = (n, attrs) => { for (let k in attrs) { n.setAttribute(k, attrs[k]); } };\nexport const toggleEvent = (el, e, fn, cond) => el[cond ? 'on' : 'off'](e, fn);\nexport const create = (tag, str, attrs, n) => { let elem = L.DomUtil.create(tag, str || \"\"); if (attrs) setAttributes(elem, attrs); if (n) append(n, elem); return elem; };\nexport const append = (n, c) => n.appendChild(c);\nexport const insert = (n, c, pos) => n.insertAdjacentElement(pos, c);\nexport const select = (str, n) => (n || document).querySelector(str);\nexport const each = (obj, fn) => { for (let i in obj) fn(obj[i], i); };\nexport const randomId = () => Math.random().toString(36).substr(2, 9);\n\n/**\n * TODO: use generators instead? (ie. \"yield\")\n */\nexport const iMax = (iVal, max) => (iVal > max ? iVal : max) || -Infinity; \nexport const iMin = (iVal, min) => (iVal < min ? iVal : min) || +Infinity;\nexport const iAvg = (iVal, avg) => (iVal + (avg || 0)) / 2.0;\nexport const iSum = (iVal, sum) => iVal + (sum || 0);\n\n/**\n * Alias for some leaflet core functions\n */\nexport const { on, off } = L.DomEvent;\nexport const { throttle, wrapNum } = L.Util;\nexport const { hasClass } = L.DomUtil;\n\n/**\n * Limit floating point precision\n */\nexport const round = L.Util.formatNum;\n\n/**\n * Limit a number between min / max values\n */\nexport const clamp = (val, range) => range ? (val < range[0] ? range[0] : val > range[1] ? range[1] : val) : val;\n\n/**\n * Limit a delta difference between two values\n */\nexport const wrapDelta = (curr, prev, deltaMax) => Math.abs(curr - prev) > deltaMax ? prev + deltaMax * Math.sign(curr - prev) : curr;","import * as _ from './utils';\n\nexport var Options = {\n\tautofitBounds: true,\n\tautohide: false,\n\tautohideMarker: true,\n\talmostover: true,\n\taltitude: true,\n\tcloseBtn: true,\n\tcollapsed: false,\n\tdetached: true,\n\tdistance: true,\n\tdistanceMarkers: { lazy: true, distance: true, direction: true },\n\tdragging: !L.Browser.mobile,\n\tdownloadLink: 'link',\n\televationDiv: \"#elevation-div\",\n\tfollowMarker: true,\n\timperial: false,\n\tlegend: true,\n\thandlers: [],\n\thotline: 'elevation',\n\tmarker: 'elevation-line',\n\tmarkerIcon: L.divIcon({\n\t\tclassName: 'elevation-position-marker',\n\t\thtml: '<i class=\"elevation-position-icon\"></i>',\n\t\ticonSize: [32, 32],\n\t\ticonAnchor: [16, 16],\n\t}),\n\tposition: \"topright\",\n\tpolyline: {\n\t\tclassName: 'elevation-polyline',\n\t\tcolor: '#000',\n\t\topacity: 0.75,\n\t\tweight: 5,\n\t\tlineCap: 'round'\n\t},\n\tpolylineSegments: {\n\t\tclassName: 'elevation-polyline-segments',\n\t\tcolor: '#F00',\n\t\tinteractive: false,\n\t},\n\tpreferCanvas: false,\n\treverseCoords: false,\n\truler: true,\n\ttheme: \"lightblue-theme\",\n\tsummary: 'inline',\n\tslope: false,\n\tspeed: false,\n\ttime: false,\n\ttimeFactor: 3600,\n\ttimestamps: false,\n\ttrkStart: L.circleMarker([0,0], { className: 'start-marker', radius: 6, weight: 2, color: '#fff', fillColor: '#00d800', fillOpacity: 1, interactive: false }),\n\ttrkEnd: L.circleMarker([0,0], { className: 'end-marker', radius: 6, weight: 2, color: '#fff', fillColor: '#ff0606', fillOpacity: 1, interactive: false }),\n\twaypoints: true,\n\twptIcons: {\n\t\t'': L.divIcon({\n\t\t\tclassName: 'elevation-waypoint-marker',\n\t\t\thtml: '<i class=\"elevation-waypoint-icon default\"></i>',\n\t\t\ticonSize: [30, 30],\n\t\t\ticonAnchor: [8, 30],\n\t\t}),\n\t},\n\twptLabels: true,\n\txAttr: \"dist\",\n\txLabel: \"km\",\n\tyAttr: \"z\",\n\tyLabel: \"m\",\n\tzFollow: false,\n\tzooming: !L.Browser.Mobile,\n\n\t// Quite uncommon and undocumented options\n\tmargins: { top: 30, right: 30, bottom: 30, left: 40 },\n\theight: (screen.height * 0.3) || 200,\n\twidth: (screen.width * 0.6) || 600,\n\txTicks: undefined,\n\tyTicks: undefined,\n\n\tdecimalsX: 2,\n\tdecimalsY: 0,\n\tforceAxisBounds: false,\n\tinterpolation: \"curveLinear\",\n\tskipNullZCoords: false,\n\tyAxisMax: undefined,\n\tyAxisMin: undefined,\n};\n","import 'leaflet-i18n';\nimport * as _ from './utils';\nimport { Options } from './options';\n\nexport const Elevation = L.Control.Elevation = L.Control.extend({\n\n\tincludes: L.Evented ? L.Evented.prototype : L.Mixin.Events,\n\n\toptions: Options,\n\t__mileFactor: 0.621371, // 1 km = (0.621371 mi)\n\t__footFactor: 3.28084, // 1 m = (3.28084 ft)\n\t__D3: 'https://unpkg.com/d3@6.5.0/dist/d3.min.js',\n\t__TOGEOJSON: 'https://unpkg.com/@tmcw/togeojson@4.6.0/dist/togeojson.umd.js',\n\t__LGEOMUTIL: 'https://unpkg.com/leaflet-geometryutil@0.9.3/src/leaflet.geometryutil.js',\n\t__LALMOSTOVER: 'https://unpkg.com/leaflet-almostover@1.0.1/src/leaflet.almostover.js',\n\t__LHOTLINE: '../libs/leaflet-hotline.min.js',\n\t__LDISTANCEM: '../libs/leaflet-distance-marker.min.js',\n\t__LCHART: '../src/components/chart.js',\n\t__LMARKER: '../src/components/marker.js',\n\t__LSUMMARY: '../src/components/summary.js',\n\t__modulesFolder: '../src/handlers/',\n\n\t/*\n\t * Add data to the diagram either from GPX or GeoJSON and update the axis domain and data\n\t */\n\taddData: function(d, layer) {\n\t\tthis.import(this.__D3)\n\t\t\t.then(() => {\n\t\t\t\tlayer = layer ?? (d.on && d);\n\t\t\t\tthis._addData(d);\n\t\t\t\tthis._addLayer(layer);\n\t\t\t\tthis._fireEvt(\"eledata_added\", { data: d, layer: layer, track_info: this.track_info });\n\t\t\t});\n\t},\n\n\t/**\n\t * Adds the control to the given map.\n\t */\n\taddTo: function(map) {\n\t\tif (this.options.detached) {\n\t\t\tlet parent = _.select(this.options.elevationDiv);\n\t\t\tlet eleDiv = this.onAdd(map);\n\t\t\tparent ? _.append(parent, eleDiv) : _.insert(map.getContainer(), eleDiv, 'afterend');\n\t\t} else {\n\t\t\tL.Control.prototype.addTo.call(this, map);\n\t\t}\n\t\treturn this;\n\t},\n\n\t/*\n\t * Reset data and display\n\t */\n\tclear: function() {\n\t\tif (this._marker) this._marker.remove();\n\t\tif (this._chart) this._clearChart();\n\t\tif (this._layers) this._clearLayers(this._layers);\n\t\tif (this._markers) this._clearLayers(this._markers);\n\t\tif (this._circleMarkers) this._circleMarkers.remove();\n\t\tif (this._hotline) this._clearLayers(this._hotline);\n\n\t\tthis._data = [];\n\t\tthis.track_info = {};\n\n\t\tthis._fireEvt(\"eledata_clear\");\n\n\t\tthis._updateChart();\n\t},\n\n\t_clearChart: function() {\n\t\tif (this._events && this._events.elechart_updated) {\n\t\t\tthis._events.elechart_updated.forEach(({fn, ctx}) => this.off('elechart_updated', fn, ctx));\n\t\t}\n\t\tif (this._chart && this._chart._container) {\n\t\t\tthis._chart._container.selectAll('g.point .point').remove();\n\t\t\tthis._chart.clear();\n\t\t}\n\t},\n\n\t_clearLayers: function(l) {\n\t\tl = l || this._layers;\n\t\tif (l && l.eachLayer) {\n\t\t\tl.eachLayer(f => f.remove())\n\t\t\tl.clearLayers();\n\t\t}\n\t},\n\n\t/**\n\t * TODO: Create a base class to handle custom data attributes (heart rate, cadence, temperature, ...)\n\t * \n\t * @link https://leafletjs.com/examples/extending/extending-3-controls.html#handlers\n\t */\n\t// addHandler: function (name, HandlerClass) {\n\t// \tif (HandlerClass) {\n\t// \t\tlet handler = this[name] = new HandlerClass(this);\n\t// \t\tthis.handlers.push(handler);\n\t// \t\tif (this.options[name]) {\n\t// \t\t\thandler.enable();\n\t// \t\t}\n\t// \t}\n\t// \treturn this;\n\t// },\n\n\t/**\n\t * Disable chart brushing.\n\t */\n\tdisableBrush: function() {\n\t\tthis._chart._brushEnabled = false;\n\t\tthis._resetDrag();\n\t},\n\n\t/**\n\t * Enable chart brushing.\n\t */\n\tenableBrush: function() {\n\t\tthis._chart._brushEnabled = true;\n\t},\n\n\t/**\n\t * Disable chart zooming.\n\t */\n\tdisableZoom: function() {\n\t\tthis._chart._zoomEnabled = false;\n\t\tthis._chart._resetZoom();\n\t},\n\n\t/**\n\t * Enable chart zooming.\n\t */\n\tenableZoom: function() {\n\t\tthis._chart._zoomEnabled = true;\n\t},\n\n\t/**\n\t * Sets a map view that contains the given geographical bounds.\n\t */\n\tfitBounds: function(bounds) {\n\t\tbounds = bounds || this.getBounds();\n\t\tif (this._map && bounds.isValid()) this._map.fitBounds(bounds);\n\t},\n\n\tgetBounds: function(data) {\n\t\treturn L.latLngBounds((data || this._data).map((d) => d.latlng));\n\t},\n\n\t/**\n\t * Get default zoom level (followMarker: true).\n\t */\n\tgetZFollow: function() {\n\t\treturn this.options.zFollow;\n\t},\n\n\t/**\n\t * Hide current elevation chart profile.\n\t */\n\thide: function() {\n\t\t_.style(this._container, \"display\", \"none\");\n\t},\n\n\t/**\n\t * Initialize chart control \"options\" and \"container\".\n\t */\n\tinitialize: function(opts) {\n\n\t\topts = L.setOptions(this, opts);\n\n\t\tthis._data = [];\n\t\tthis._layers = L.featureGroup();\n\t\tthis._markers = L.featureGroup();\n\t\tthis._hotline = L.featureGroup();\n\t\tthis._circleMarkers = L.featureGroup();\n\t\tthis._markedSegments = L.polyline([]);\n\t\tthis._start = (opts.trkStart || Options.trkStart);\n\t\tthis._end = (opts.trkEnd || Options.trkEnd);\n\t\tthis._chartEnabled = true;\n\t\tthis._yCoordMax = -Infinity;\n\t\tthis.track_info = {};\n\t\t// this.handlers = [];\n\n\t\tif (opts.followMarker) this._setMapView = _.throttle(this._setMapView, 300, this);\n\t\tif (opts.legend) opts.margins.bottom += 30;\n\t\tif (opts.theme) opts.polylineSegments.className += ' ' + opts.theme;\n\t\tif (opts.wptIcons === true) opts.wptIcons = Options.wptIcons;\n\t\tif (opts.distanceMarkers === true) opts.distanceMarkers = Options.distanceMarkers;\n\t\tif (opts.trkStart) this._start.addTo(this._circleMarkers);\n\t\tif (opts.trkEnd) this._end.addTo(this._circleMarkers);\n\n\n\t\tthis._markedSegments.setStyle(opts.polylineSegments);\n\n\t\t// Leaflet canvas renderer colors\n\t\tL.extend(_.Colors, opts.colors || {});\n\n\t\t// Various stuff\n\t\tthis._fixCanvasPaths();\n\t\tthis._fixTooltipSize();\n\n\t},\n\n\t/**\n\t * Javascript scripts downloader (lazy loader)\n\t */\n\timport: function(src, condition) {\n\t\tswitch(src) {\n\t\t\tcase this.__D3: condition = typeof d3 !== 'object'; break;\n\t\t\tcase this.__TOGEOJSON: condition = typeof toGeoJSON !== 'object'; break;\n\t\t\tcase this.__LGEOMUTIL: condition = typeof L.GeometryUtil !== 'object'; break;\n\t\t\tcase this.__LALMOSTOVER: condition = typeof L.Handler.AlmostOver !== 'function'; break;\n\t\t\tcase this.__LDISTANCEM: condition = typeof L.DistanceMarkers !== 'function'; break;\n\t\t}\n\t\treturn condition !== false ? import(src) : Promise.resolve();\n\t},\n\n\t/**\n\t * Load elevation data (GPX, GeoJSON, KML or TCX).\n\t */\n\tload: function(data) {\n\t\tthis._parseFromString(data).then( geojson => geojson ? this._loadLayer(geojson) : this._loadFile(data));\n\t},\n\n\t/**\n\t * Create container DOM element and related event listeners.\n\t * Called on control.addTo(map).\n\t */\n\tonAdd: function(map) {\n\t\tthis._map = map;\n\n\t\tlet container = this._container = _.create(\"div\", \"elevation-control \" + this.options.theme + \" \" + (this.options.detached ? 'elevation-detached' : 'leaflet-control'), this.options.detached ? { id: 'elevation-' + _.randomId() } : {});\n\n\t\tif (!this.eleDiv) this.eleDiv = container;\n\n\t\tlet modules = [\n\t\t\t\"Distance\",\n\t\t\t\"Time\",\n\t\t\t\"Altitude\",\n\t\t\t\"Slope\",\n\t\t\t\"Speed\",\n\t\t\t\"Acceleration\",\n\t\t\t...this.options.handlers\n\t\t].filter(m => false !== this.options[typeof m == \"string\" && m.toLowerCase()]);\n\n\t\tthis._loadModules(modules).then(() => { // Inject here required modules (data handlers)\n\t\t\tthis._initChart(container);\n\t\t\tthis._initButton(container);\n\t\t\tthis._initSummary(container);\n\t\t\tthis._initMarker(map);\n\t\t\tthis._initLayer(map);\n\t\t});\n\n\t\tthis.fire('add');\n\n\t\treturn container;\n\t},\n\n\t/**\n\t * Clean up control code and related event listeners.\n\t * Called on control.remove().\n\t */\n\tonRemove: function(map) {\n\t\tthis._container = null;\n\n\t\tmap\n\t\t\t.off('zoom viewreset zoomanim', this._hideMarker, this)\n\t\t\t.off('resize', this._resetView, this)\n\t\t\t.off('resize', this._resizeChart, this)\n\t\t\t.off('mousedown', this._resetDrag, this);\n\n\t\t_.off(map.getContainer(), 'mousewheel', this._resetDrag, this);\n\t\t_.off(map.getContainer(), 'touchstart', this._resetDrag, this);\n\t\t_.off(document, 'keydown', this._onKeyDown, this);\n\n\t\tthis\n\t\t\t.off('eledata_added eledata_loaded', this._updateChart, this)\n\t\t\t.off('eledata_added eledata_loaded', this._updateSummary, this);\n\n\t\tthis.fire('remove');\n\t},\n\n\t/**\n\t * Redraws the chart control. Sometimes useful after screen resize.\n\t */\n\tredraw: function() {\n\t\tthis._resizeChart();\n\t},\n\n\t/**\n\t * Set default zoom level (followMarker: true).\n\t */\n\tsetZFollow: function(zoom) {\n\t\tthis.options.zFollow = zoom;\n\t},\n\n\t/**\n\t * Hide current elevation chart profile.\n\t */\n\tshow: function() {\n\t\t_.style(this._container, \"display\", \"block\");\n\t},\n\n\t/*\n\t * Parsing data either from GPX or GeoJSON and update the diagram data\n\t */\n\t_addData: function(d) {\n\t\tif (!d) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Standard GeoJSON\n\t\tif (d.type === \"FeatureCollection\" ) {\n\t\t\treturn _.each(d.features, feature => this._addData(feature));\n\t\t} else if (d.type === \"Feature\") {\n\t\t\tlet geom = d.geometry;\n\t\t\tif (geom) {\n\t\t\t\tswitch (geom.type) {\n\t\t\t\t\tcase 'LineString':\t\treturn this._addGeoJSONData(geom.coordinates, d.properties);\n\t\t\t\t\tcase 'MultiLineString': return _.each(geom.coordinates, (coords, i) => this._addGeoJSONData(coords, d.properties, i));\n\t\t\t\t\tcase 'Point':\n\t\t\t\t\tdefault:\t\t\t\treturn console.warn('Unsopperted GeoJSON feature geometry type:' + geom.type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Fallback for leaflet layers (eg. L.Gpx)\n\t\tif (d._latlngs) {\n\t\t\treturn this._addGeoJSONData(d._latlngs, d.feature && d.feature.properties);\n\t\t}\n\n\t},\n\n\t/*\n\t * Parsing of GeoJSON data lines and their elevation in z-coordinate\n\t */\n\t_addGeoJSONData: function(coords, properties, nestingLevel) {\n\n\t\t// \"coordinateProperties\" property is generated inside \"@tmcw/toGeoJSON\"\n\t\tlet props = (properties && properties.coordinateProperties) || properties;\n\n\t\tcoords.forEach((point, i) => {\n\n\t\t\t// GARMIN_EXTENSIONS = [\"hr\", \"cad\", \"atemp\", \"wtemp\", \"depth\", \"course\", \"bearing\"];\n\t\t\tpoint.meta = point.meta ?? { time: null, ele: null };\n\t\t\t\n\t\t\tpoint.prev = (attr) => (attr ? this._data[i > 0 ? i - 1 : 0][attr] : this._data[i > 0 ? i - 1 : 0]);\n\n\t\t\tthis.fire(\"elepoint_init\", { point: point, props: props, id: i, isMulti: nestingLevel });\n\n\t\t\tthis._addPoint(\n\t\t\t\tpoint.lat ?? point[1], \n\t\t\t\tpoint.lng ?? point[0],\n\t\t\t\tpoint.alt ?? point.meta.ele ?? point[2]\n\t\t\t);\n\n\t\t\tthis.fire(\"elepoint_added\", { point: point, index: this._data.length - 1 });\n\n\t\t\tif (this._yCoordMax < this._data[this._data.length - 1][this.options.yAttr]) this._yCoordMax = this._data[this._data.length - 1][this.options.yAttr];\n\t\t});\n\n\t\tthis.fire(\"eletrack_added\", { coords: coords, index: this._data.length - 1 });\n\t},\n\n\t/*\n\t * Parse and push a single (x, y, z) point to current elevation profile.\n\t */\n\t_addPoint: function(x, y, z) {\n\t\tif (this.options.reverseCoords) {\n\t\t\t[x, y] = [y, x];\n\t\t}\n\n\t\tthis._data.push({\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\tz: z,\n\t\t\tlatlng: L.latLng(x, y, z)\n\t\t});\n\n\t\tthis.fire(\"eledata_updated\", { index: this._data.length - 1 });\n\t},\n\n\t_addLayer: function(layer) {\n\t\tif (layer) this._layers.addLayer(layer)\n\t\t// Postpone adding the distance markers (lazy: true)\n\t\tif (layer && this.options.distanceMarkers && this.options.distanceMarkers.lazy) {\n\t\t\tlayer.on('add remove', ({target, type}) => L.DistanceMarkers && target instanceof L.Polyline && target[type + 'DistanceMarkers']());\n\t\t}\n\t\treturn layer;\n\t},\n\n\t_addMarker: function(marker) {\n\t\tif (marker) this._markers.addLayer(marker)\n\t\treturn marker;\n\t},\n\n\t/**\n\t * Initialize \"L.AlmostOver\" integration\n\t */\n\t_initAlmostOverHandler: function(map, layer) {\n\t\treturn (map && this.options.almostOver && !L.Browser.mobile) ? Promise.all([\n\t\t\tthis.import(this.__LGEOMUTIL),\n\t\t\tthis.import(this.__LALMOSTOVER)\n\t\t]).then(() => {\n\t\t\tmap.addHandler('almostOver', L.Handler.AlmostOver)\n\t\t\tif (L.GeometryUtil && map.almostOver && map.almostOver.enabled()) {\n\t\t\t\tmap.almostOver.addLayer(layer);\n\t\t\t\tmap\n\t\t\t\t\t.on('almost:move', (e) => this._onMouseMoveLayer(e))\n\t\t\t\t\t.on('almost:out', (e) => this._onMouseOut(e));\n\t\t\t}\n\t\t}) : Promise.resolve();\n\t},\n\n\t/**\n\t * Initialize \"L.DistanceMarkers\" integration\n\t */\n\t_initDistanceMarkers: function() {\n\t\treturn this.options.distanceMarkers ? Promise.all([this.import(this.__LGEOMUTIL), this.import(this.__LDISTANCEM)]) : Promise.resolve();\n\t},\n\n\t_initHotLine: function(layer) {\n\t\tlet prop = typeof this.options.hotline == 'string' ? this.options.hotline : 'elevation';\n\t\treturn this.options.hotline ? this.import(this.__LHOTLINE)\n\t\t\t.then(() => {\n\t\t\t\tlayer.eachLayer((trkseg) => {\n\t\t\t\t\tif(trkseg.feature.geometry.type != \"Point\") {\n\t\t\t\t\t\tlet geo = L.geoJson(trkseg.toGeoJSON(), { coordsToLatLng: (coords) => L.latLng(coords[0], coords[1], coords[2])});\n\t\t\t\t\t\tlet line = L.hotline(geo.toGeoJSON().features[0].geometry.coordinates, {\n\t\t\t\t\t\t\tmin: isFinite(this.track_info[prop + '_min']) ? this.track_info[prop + '_min'] : 0,\n\t\t\t\t\t\t\tmax: isFinite(this.track_info[prop + '_max']) ? this.track_info[prop + '_max'] : 1,\n\t\t\t\t\t\t\tpalette: {\n\t\t\t\t\t\t\t\t0.0: '#008800',\n\t\t\t\t\t\t\t\t0.5: '#ffff00',\n\t\t\t\t\t\t\t\t1.0: '#ff0000'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tweight: 5,\n\t\t\t\t\t\t\toutlineColor: '#000000',\n\t\t\t\t\t\t\toutlineWidth: 1\n\t\t\t\t\t\t}).addTo(this._hotline);\n\t\t\t\t\t\tlet alpha = trkseg.options.style && trkseg.options.style.opacity || 1;\n\t\t\t\t\t\ttrkseg.on('add remove', ({type}) => {\n\t\t\t\t\t\t\ttrkseg.setStyle({opacity: (type == 'add' ? 0 : alpha)});\n\t\t\t\t\t\t\tline[(type == 'add' ? 'addTo' : 'removeFrom')](trkseg._map);\n\t\t\t\t\t\t\tif (line._renderer) line._renderer._container.parentElement.insertBefore(line._renderer._container, line._renderer._container.parentElement.firstChild);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}) : Promise.resolve();\n\t},\n\n\t/**\n\t * Initialize \"L.AlmostOver\" and \"L.DistanceMarkers\"\n\t */\n\t_initMapIntegrations: function(layer) {\n\t\tlet map = this._map;\n\t\tif (map) {\n\t\t\tif (this._data.length) {\n\t\t\t\tthis._start.setLatLng(this._data[0].latlng);\n\t\t\t\tthis._end.setLatLng(this._data[this._data.length -1].latlng);\n\t\t\t}\n\t\t\tPromise.all([\n\t\t\t\tthis._initHotLine(layer),\n\t\t\t\tthis._initAlmostOverHandler(map, layer),\n\t\t\t\tthis._initDistanceMarkers(),\n\t\t\t]).then(() => {\n\t\t\t\tif\t(this.options.polyline) {\n\t\t\t\t\tlayer.addTo(map);\n\t\t\t\t\tthis._circleMarkers.addTo(map);\n\t\t\t\t}\n\t\t\t\tif (this.options.autofitBounds) {\n\t\t\t\t\tthis.fitBounds(layer.getBounds());\n\t\t\t\t}\n\t\t\t\tmap.invalidateSize();\n\t\t\t});\n\t\t} else {\n\t\t\tthis.once('add', () => this._initMapIntegrations(layer));\n\t\t}\n\t},\n\n\t/*\n\t * Collapse current chart control.\n\t */\n\t_collapse: function() {\n\t\t_.replaceClass(this._container, 'elevation-expanded', 'elevation-collapsed');\n\t\tif (this._map) this._map.invalidateSize();\n\t},\n\n\t/*\n\t * Expand current chart control.\n\t */\n\t_expand: function() {\n\t\t_.replaceClass(this._container, 'elevation-collapsed', 'elevation-expanded');\n\t\tif (this._map) this._map.invalidateSize();\n\t},\n\n\t/**\n\t * Add some basic colors to leaflet canvas renderer (preferCanvas: true).\n\t */\n\t_fixCanvasPaths: function() {\n\t\tlet oldProto = L.Canvas.prototype._fillStroke;\n\t\tlet control = this;\n\n\t\tlet theme = this.options.theme.split(' ')[0].replace('-theme', '');\n\t\tlet color = _.Colors[theme] || {};\n\n\t\tL.Canvas.include({\n\t\t\t_fillStroke: function(ctx, layer) {\n\t\t\t\tif (control._layers.hasLayer(layer)) {\n\n\t\t\t\t\tlet options = layer.options;\n\n\t\t\t\t\toptions.color = color.line || color.area || theme;\n\t\t\t\t\toptions.stroke = !!options.color;\n\n\t\t\t\t\toldProto.call(this, ctx, layer);\n\n\t\t\t\t\tif (options.stroke && options.weight !== 0) {\n\t\t\t\t\t\tlet oldVal = ctx.globalCompositeOperation || 'source-over';\n\t\t\t\t\t\tctx.globalCompositeOperation = 'destination-over'\n\t\t\t\t\t\tctx.strokeStyle = color.outline || '#FFF';\n\t\t\t\t\t\tctx.lineWidth = options.weight * 1.75;\n\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t\tctx.globalCompositeOperation = oldVal;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\toldProto.call(this, ctx, layer);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n\t * Partial fix for initial tooltip size\n\t * \n\t * @link https://github.com/Raruto/leaflet-elevation/issues/81#issuecomment-713477050\n\t */\n\t_fixTooltipSize: function() {\n\t\tthis.on('elechart_init', () =>\n\t\t\tthis.once('elechart_change elechart_hover', ({data, xCoord}) => {\n\t\t\t\tif (this._chartEnabled) {\n\t\t\t\t\tthis._chart._showDiagramIndicator(data, xCoord);\n\t\t\t\t\tthis._chart._showDiagramIndicator(data, xCoord);\n\t\t\t\t}\n\t\t\t\tthis._updateMarker(data);\n\t\t\t})\n\t\t);\n\t},\n\n\t/*\n\t * Finds a data entry for the given LatLng\n\t */\n\t_findItemForLatLng: function(latlng) {\n\t\treturn this._data[this._chart._findIndexForLatLng(latlng)];\n\t},\n\n\t/*\n\t * Finds a data entry for the given xDiagCoord\n\t */\n\t_findItemForX: function(x) {\n\t\treturn this._data[this._chart._findIndexForXCoord(x)];\n\t},\n\n\t/**\n\t * Fires an event of the specified type.\n\t */\n\t_fireEvt: function(type, data, propagate) {\n\t\tif (this.fire) this.fire(type, data, propagate);\n\t\tif (this._map) this._map.fire(type, data, propagate);\n\t},\n\n\t/*\n\t * Hides the position/height indicator marker drawn onto the map\n\t */\n\t_hideMarker: function() {\n\t\tif (this.options.autohideMarker) {\n\t\t\tthis._marker.remove();\n\t\t}\n\t},\n\n\t/**\n\t * Generate \"svg\" chart (DOM element).\n\t */\n\t_initChart: function(container) {\n\t\tlet opts = this.options;\n\n\t\tif (opts.detached) {\n\t\t\tlet { offsetWidth, offsetHeight} = this.eleDiv;\n\t\t\tif (offsetWidth > 0) opts.width = offsetWidth;\n\t\t\tif (offsetHeight > 20) opts.height = offsetHeight - 20; // 20 = horizontal scrollbar size.\n\t\t} else {\n\t\t\tlet { clientWidth } = this._map.getContainer();\n\t\t\topts._maxWidth = opts._maxWidth > opts.width ? opts._maxWidth : opts.width;\n\t\t\tthis._container.style.maxWidth = opts._maxWidth + 'px';\n\t\t\tif (opts._maxWidth > clientWidth) opts.width = clientWidth - 30;\n\t\t}\n\n\t\tPromise.all([\n\t\t\tthis.import(this.__D3),\n\t\t\tthis.import(this.__LCHART)\n\t\t]).then((m) => {\n\n\t\t\tlet chart = this._chart = new (m[1] || Elevation).Chart(opts, this);\n\t\n\t\t\tthis._x = this._chart._x;\n\t\t\tthis._y = this._chart._y;\n\t\n\t\t\td3\n\t\t\t\t.select(container)\n\t\t\t\t.call(chart.render())\n\t\n\t\t\tchart\n\t\t\t\t.on('reset_drag', this._hideMarker, this)\n\t\t\t\t.on('mouse_enter', this._onMouseEnter, this)\n\t\t\t\t.on('dragged', this._onDragEnd, this)\n\t\t\t\t.on('mouse_move', this._onMouseMove, this)\n\t\t\t\t.on('mouse_out', this._onMouseOut, this)\n\t\t\t\t.on('ruler_filter', this._onRulerFilter, this)\n\t\t\t\t.on('zoom', this._updateChart, this)\n\t\t\t\t.on('elepath_toggle', this._onToggleChart, this)\n\t\t\t\t.on('margins_updated', this._resizeChart, this);\n\t\n\t\n\t\t\tthis.fire(\"elechart_init\");\n\n\t\t\tmap\n\t\t\t\t.on('zoom viewreset zoomanim', this._hideMarker, this)\n\t\t\t\t.on('resize', this._resetView, this)\n\t\t\t\t.on('resize', this._resizeChart, this)\n\t\t\t\t.on('rotate', this._rotateMarker, this)\n\t\t\t\t.on('mousedown', this._resetDrag, this);\n\n\t\t\t_.on(map.getContainer(), 'mousewheel', this._resetDrag, this);\n\t\t\t_.on(map.getContainer(), 'touchstart', this._resetDrag, this);\n\t\t\t_.on(document, 'keydown', this._onKeyDown, this);\n\n\t\t\tthis\n\t\t\t\t.on('eledata_added eledata_loaded', this._updateChart, this)\n\t\t\t\t.on('eledata_added eledata_loaded', this._updateSummary, this);\n\n\t\t\tthis._updateChart();\n\t\t\tthis._updateSummary();\n\t\t});\n\n\n\t},\n\n\t_initLayer: function() {\n\t\tthis._layers\n\t\t\t.on('layeradd layerremove', ({layer, type}) => {\n\t\t\t\tlet node = layer.getElement && layer.getElement();\n\t\t\t\t_.toggleClass(node, this.options.polyline.className + ' ' + this.options.theme, type == 'layeradd');\n\t\t\t\t_.toggleEvent(layer, \"mousemove\", this._onMouseMoveLayer.bind(this), type == 'layeradd')\n\t\t\t\t_.toggleEvent(layer, \"mouseout\", this._onMouseOut.bind(this), type == 'layeradd');\n\t\t\t});\n\t},\n\n\t_initMarker: function(map) {\n\t\tlet pane = map.getPane('elevationPane');\n\t\tif (!pane) {\n\t\t\tpane = this._pane = map.createPane('elevationPane', map.getPane('norotatePane') || map.getPane('mapPane'));\n\t\t\tpane.style.zIndex = 625; // This pane is above markers but below popups.\n\t\t\tpane.style.pointerEvents = 'none';\n\t\t}\n\n\t\tif (this._renderer) this._renderer.remove()\n\t\tthis._renderer = L.svg({ pane: \"elevationPane\" }).addTo(this._map); // default leaflet svg renderer\n\n\t\tPromise.all([\n\t\t\tthis.import(this.__D3),\n\t\t\tthis.import(this.__LMARKER)\n\t\t]).then((m) => {\n\t\t\tthis._marker = new (m[1] || Elevation).Marker(this.options, this);\n\t\t\tthis.fire(\"elechart_marker\");\n\t\t});\n\t},\n\n\t/**\n\t * Inspired by L.Control.Layers\n\t */\n\t_initButton: function(container) {\n\t\tL.DomEvent\n\t\t\t.disableClickPropagation(container)\n\t\t\t.disableScrollPropagation(container);\n\n\t\tthis.options.collapsed ? this._collapse() : this._expand();\n\n\t\tif (this.options.autohide) {\n\t\t\t_.on(container, 'mouseover', this._expand, this);\n\t\t\t_.on(container, 'mouseout', this._collapse, this);\n\t\t\tthis._map.on('click', this._collapse, this);\n\t\t}\n\n\t\tif (this.options.closeBtn) {\n\t\t\tlet link = this._button = _.create('a', \"elevation-toggle-icon\", { href: '#', title: L._('Elevation'), }, container);\n\t\t\t_.on(link, 'click', L.DomEvent.stop);\n\t\t\t_.on(link, 'click', this._toggle, this);\n\t\t\t_.on(link, 'focus', this._toggle, this);\n\t\t}\n\t},\n\n\t_initSummary: function(container) {\n\t\tthis.import(this.__LSUMMARY).then((m)=>{\n\t\t\tthis._summary = new (m || Elevation).Summary({ summary: this.options.summary }, this);\n\n\t\t\tthis.on('elechart_init', () => {\n\t\t\t\td3.select(container).call(this._summary.render());\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n\t * Retrieve data from a remote url (HTTP).\n\t */\n\t_loadFile: function(url) {\n\t\tfetch(url)\n\t\t\t.then((response) => response.text())\n\t\t\t.then((data) => {\n\t\t\t\tthis._downloadURL = url; // TODO: handle multiple urls?\n\t\t\t\tthis._parseFromString(data)\n\t\t\t\t\t.then( geojson => geojson && this._loadLayer(geojson));\n\t\t\t}).catch((err) => console.warn(err));\n\t},\n\n\t/**\n\t * Dynamically import only required javascript modules (code splitting)\n\t */\n\t_loadModules: function(handlers) {\n\t\t// First map known classnames (eg. \"Altitude\" --> L.Control.Elevation.Altitude)\n\t\thandlers = handlers.map((h) => typeof h === 'string' && typeof Elevation[h] !== \"undefined\" ? Elevation[h] : h);\n\t\t// Then load optional classes and custom imports (eg. \"Cadence\" --> import('../src/handlers/cadence.js'))\n\t\treturn Promise.\n\t\t\tall(\n\t\t\t\thandlers\n\t\t\t\t\t.filter(h => typeof h === 'string' || h instanceof Promise)\n\t\t\t\t\t.map(file => file instanceof Promise ? file : this.import(this.__modulesFolder + file.toLowerCase() + '.js'))\n\t\t\t)\n\t\t\t.then((m) => {\n\t\t\t\t_.each(m, (exported) => {\n\t\t\t\t\tlet fn = Object.keys(exported)[0];\n\t\t\t\t\tif (fn && typeof Elevation[fn] === \"undefined\" ) {\n\t\t\t\t\t\thandlers[fn] = Elevation[fn] = exported[fn];\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t_.each(handlers, h => this._registerHandler(h));\n\t\t\t});\n\t},\n\n\t/**\n\t * Simple GeoJSON data loader (L.GeoJSON).\n\t */\n\t_loadLayer: function(geojson) {\n\t\tlet { polyline, theme, waypoints, wptIcons, wptLabels, distanceMarkers } = this.options;\n\t\tlet style = L.extend({}, polyline);\n\n\t\tif (theme) {\n\t\t\tstyle.className += ' ' + theme;\n\t\t}\n\n\t\tif (geojson.name) {\n\t\t\tthis.track_info.name = geojson.name;\n\t\t}\n\n\t\tlet layer = L.geoJson(geojson, {\n\t\t\tdistanceMarkers: distanceMarkers,\n\t\t\tstyle: style,\n\t\t\tpointToLayer: (feature, latlng) => {\n\t\t\t\tif (waypoints) {\n\t\t\t\t\tlet { desc, name, sym } = feature.properties;\n\t\t\t\t\tdesc = desc || '';\n\t\t\t\t\tname = name || '';\n\t\t\t\t\t// Handle chart waypoints (dots)\n\t\t\t\t\tif ([true, 'dots'].includes(waypoints)) {\n\t\t\t\t\t\tthis._registerCheckPoint({\n\t\t\t\t\t\t\tlatlng: latlng,\n\t\t\t\t\t\t\tlabel : ([true, 'dots'].includes(wptLabels) ? name : '')\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\t// Handle map waypoints (markers)\n\t\t\t\t\tif ([true, 'markers'].includes(waypoints) && wptIcons != false) {\n\t\t\t\t\t\treturn this._registerMarker({\n\t\t\t\t\t\t\tlatlng : latlng,\n\t\t\t\t\t\t\tsym : (sym ?? name).replace(' ', '-').replace('\"', '').replace(\"'\", '').toLowerCase(),\n\t\t\t\t\t\t\tcontent: [true, 'markers'].includes(wptLabels) && (name || desc) && decodeURI(\"<b>\" + name + \"</b>\" + (desc.length > 0 ? '<br>' + desc : ''))\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tonEachFeature: (feature, layer) => feature.geometry && feature.geometry.type != 'Point' && this.addData(feature, layer),\n\t\t});\n\n\t\tthis.import(this.__D3).then(() => {\n\t\t\tthis._initMapIntegrations(layer);\n\t\t\tthis._fireEvt(\"eledata_loaded\", { data: geojson, layer: layer, name: this.track_info.name, track_info: this.track_info });\n\t\t});\n\n\t\treturn layer;\n\t},\n\n\t_onDragEnd: function({ dragstart, dragend}) {\n\t\tthis._hideMarker();\n\t\tthis.fitBounds(L.latLngBounds([dragstart.latlng, dragend.latlng]));\n\n\t\tthis.fire(\"elechart_dragged\");\n\t},\n\n\t_onKeyDown: function({key}) {\n\t\tif(!this.options.detached && key === \"Escape\"){\n\t\t\tthis._collapse()\n\t\t};\n\t},\n\n\t/**\n\t * Trigger mouseenter event.\n\t */\n\t_onMouseEnter: function() {\n\t\tthis.fire('elechart_enter');\n\t},\n\n\t/*\n\t * Handles the moueseover the chart and displays distance and altitude level.\n\t */\n\t_onMouseMove: function({xCoord}) {\n\t\tif (this._chartEnabled && this._data.length) {\n\t\t\tlet item = this._findItemForX(xCoord);\n\t\t\tif (item) {\n\t\t\t\tif (this._chartEnabled) this._chart._showDiagramIndicator(item, xCoord);\n\n\t\t\t\tthis._updateMarker(item);\n\t\t\t\tthis._setMapView(item);\n\n\t\t\t\tif (this._map) {\n\t\t\t\t\t_.addClass(this._map.getContainer(), 'elechart-hover');\n\t\t\t\t}\n\n\t\t\t\tthis.fire(\"elechart_change\", { data: item, xCoord: xCoord });\n\t\t\t\tthis.fire(\"elechart_hover\", { data: item, xCoord: xCoord });\n\t\t\t}\n\t\t}\n\t},\n\n\t/*\n\t * Handles mouseover events of the data layers on the map.\n\t */\n\t_onMouseMoveLayer: function({latlng}) {\n\t\tif (this._data.length) {\n\t\t\tlet item = this._findItemForLatLng(latlng);\n\t\t\tif (item) {\n\t\t\t\tlet xCoord = item.xDiagCoord;\n\t\n\t\t\t\tif (this._chartEnabled) this._chart._showDiagramIndicator(item, xCoord);\n\t\n\t\t\t\tthis._updateMarker(item);\n\t\n\t\t\t\tthis.fire(\"elechart_change\", { data: item, xCoord: xCoord });\n\t\t\t}\n\t\t}\n\t},\n\n\t/*\n\t * Handles the moueseout over the chart.\n\t */\n\t_onMouseOut: function() {\n\t\tif (!this.options.detached) {\n\t\t\tthis._hideMarker();\n\t\t\tthis._chart._hideDiagramIndicator();\n\t\t}\n\n\t\tif (this._map) {\n\t\t\t_.removeClass(this._map.getContainer(), 'elechart-hover');\n\t\t}\n\n\t\tthis.fire(\"elechart_leave\");\n\t},\n\n\t/**\n\t * Handles the drag event over the ruler filter.\n\t */\n\t_onRulerFilter: function({coords}) {\n\t\tthis._updateMapSegments(coords);\n\t},\n\n\t/**\n\t * Toggle chart data on legend click\n\t */\n\t_onToggleChart: function({ name, enabled }) {\n\n\t\tthis._chartEnabled = this._chart._hasActiveLayers();\n\n\t\t// toggle layer visibility on empty chart\n\t\tthis._layers.eachLayer(layer => _.toggleClass(layer.getElement && layer.getElement(), this.options.polyline.className + ' ' + this.options.theme, this._chartEnabled));\n\n\t\t// toggle option value (eg. altitude = { 'disabled' || 'enabled' })\n\t\tthis.options[name] = !enabled && this.options[name] == 'disabled' ? 'enabled' : 'disabled';\n\n\t\t// remove marker on empty chart\n\t\tif (!this._chartEnabled) {\n\t\t\tthis._chart._hideDiagramIndicator();\n\t\t\tthis._marker.remove();\n\t\t}\n\t},\n\n\t/**\n\t * Simple GeoJSON Parser\n\t */\n\t_parseFromGeoJSONString: function(data) {\n\t\ttry {\n\t\t\treturn JSON.parse(data);\n\t\t} catch (e) { }\n\t},\n\n\t/**\n\t * Attempt to parse raw response data (GeoJSON or XML > GeoJSON)\n\t */\n\t_parseFromString: function(data) {\n\t\treturn new Promise(resolve =>\n\t\t\tthis.import(this.__TOGEOJSON).then(() => {\n\t\t\t\tlet geojson;\n\t\t\t\ttry {\n\t\t\t\t\tgeojson = this._parseFromXMLString(data.trim());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tgeojson = this._parseFromGeoJSONString(data.toString());\n\t\t\t\t}\n\t\t\t\tif (geojson) {\n\t\t\t\t\tgeojson.name = geojson.name || (this._downloadURL || '').split('/').pop().split('#')[0].split('?')[0];\n\t\t\t\t}\n\t\t\t\tresolve(geojson);\n\t\t\t})\n\t\t);\n\t},\n\n\t/**\n\t * Simple XML Parser (GPX, KML, TCX)\n\t */\n\t_parseFromXMLString: function(data) {\n\t\tif (data.indexOf(\"<\") != 0) {\n\t\t\tthrow 'Invalid XML';\n\t\t}\n\t\tlet xml = (new DOMParser()).parseFromString(data, \"text/xml\");\n\t\tlet type = xml.documentElement.tagName.toLowerCase(); // \"kml\" or \"gpx\"\n\t\tlet name = xml.getElementsByTagName('name');\n\t\tif (xml.getElementsByTagName('parsererror').length) {\n\t\t\tthrow 'Invalid XML';\n\t\t}\n\t\tif (!(type in toGeoJSON)) {\n\t\t\ttype = xml.documentElement.tagName == \"TrainingCenterDatabase\" ? 'tcx' : 'gpx';\n\t\t}\n\t\tlet geojson = toGeoJSON[type](xml);\n\t\tgeojson.name = name.length > 0 ? (Array.from(name).find(tag => tag.parentElement.tagName == \"trk\") ?? name[0]).textContent : '';\n\t\treturn geojson;\n\t},\n\n\t/**\n\t * Add chart profile to diagram\n\t */\n\t_registerAreaPath: function(props) {\n\t\tthis.on(\"elechart_init\", () => this._chart._registerAreaPath(props));\n\t},\n\n\t/**\n\t * Add chart grid to diagram\n\t */\n\t_registerAxisGrid: function(props) {\n\t\tthis.on(\"elechart_axis\", () => this._chart._registerAxisGrid(props));\n\t},\n\n\t/**\n\t * Add chart axis to diagram\n\t */\n\t_registerAxisScale: function(props) {\n\t\tthis.on(\"elechart_axis\", () => this._chart._registerAxisScale(props));\n\t},\n\n\t/**\n\t * Add a point of interest over the diagram\n\t */\n\t_registerCheckPoint: function(props) {\n\t\tthis.on(\"elechart_updated\", () => this._chart._registerCheckPoint(props));\n\t},\n\n\n\t/**\n\t * Base handler for iterative track statistics (dist, time, z, slope, speed, acceleration, ...)\n\t */\n\t _registerDataAttribute: function(props) {\n\n\t\t// parse of \"coordinateProperties\" for later usage\n\t\tif (props.coordPropsToMeta) {\n\t\t\tthis.on(\"elepoint_init\", (e) => props.coordPropsToMeta.call(this, e));\n\t\t}\n\n\t\t// prevent excessive variabile instanstations\n\t\tlet i, curr, prev, attr;\n\n\t\t// save here a reference to last used point\n\t\tlet lastValid = null; \n\n\t\t// iteration\n\t\tthis.on(\"elepoint_added\", ({index, point}) => {\n\t\t\ti = index;\n\n\t\t\tprev = curr ?? this._data[i]; // same as: this._data[i > 0 ? i - 1 : i]\n\t\t\tcurr = this._data[i];\n\t\t\tattr = props.attr || props.name;\n\n\t\t\t// check and fix missing data on last added point\n\t\t\tif (props.skipNull === false) {\n\t\t\t\tlet curr = this._data[i][attr];\n\t\t\t\tif(i > 0) {\n\t\t\t\t\tlet prev = this._data[i - 1][attr];\n\t\t\t\t\tif (isNaN(prev)) {\n\t\t\t\t\t\tif (!isNaN(lastValid) && !isNaN(curr)) {\n\t\t\t\t\t\t\tprev = (lastValid + curr) / 2;\n\t\t\t\t\t\t} else if (!isNaN(lastValid)) {\n\t\t\t\t\t\t\tprev = lastValid;\n\t\t\t\t\t\t} else if (!isNaN(curr)) {\n\t\t\t\t\t\t\tprev = curr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!isNaN(prev)) return this._data.splice(i - 1, 1);\n\t\t\t\t\t\tthis._data[i - 1][attr] = prev;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// update reference to last used point (ie. if it has data)\n\t\t\t\tif (!isNaN(curr)) {\n\t\t\t\t\tlastValid = curr;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// retrieve point value\n\t\t\tcurr[attr] = props.pointToAttr.call(this, point, i);\n\n\t\t\t// update \"track_info\" stats (min, max, avg, ...)\n\t\t\tif (props.stats) {\n\t\t\t\tfor (const key in props.stats) {\n\t\t\t\t\tlet sname = (props.statsName || attr) + (key != '' ? '_' : '');\n\t\t\t\t\tthis.track_info[sname + key] = props.stats[key].call(this, curr[attr], this.track_info[sname + key]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Limit \"crazy\" delta values.\n\t\t\tif (props.deltaMax) {\n\t\t\t\tcurr[attr] =_.wrapDelta(curr[attr], prev[attr], props.deltaMax);\n\t\t\t}\n\t\t\t\n\t\t\t// Range of acceptable values.\n\t\t\tif (props.clampRange) {\n\t\t\t\tcurr[attr] = _.clamp(curr[attr], props.clampRange);\n\t\t\t}\n\n\t\t\t// Limit floating point precision.\n\t\t\tif (!isNaN(props.decimals)) {\n\t\t\t\tcurr[attr] = _.round(curr[attr], props.decimals);\n\t\t\t}\n\n\t\t\t// update here some mixins (eg. complex \"track_info\" stuff)\n\t\t\tif(props.onPointAdded) props.onPointAdded.call(this, curr[attr], i, point);\n\t\t});\n\t},\n\n\t/**\n\t * Parse a module definition and attach related function listeners\n\t */\n\t_registerHandler: function(props) {\n\n\t\t// eg. L.Control.Altitude\n\t\tif (typeof props === \"function\") {\n\t\t\treturn this._registerHandler(props.call(this));\n\t\t}\n\n\t\tlet {\n\t\t\tname,\n\t\t\tattr,\n\t\t\trequired,\n\t\t\tskipNull,\n\t\t\tdeltaMax,\n\t\t\tclampRange,\n\t\t\tdecimals,\n\t\t\tmeta,\n\t\t\tunit,\n\t\t\tcoordinateProperties,\n\t\t\tcoordPropsToMeta,\n\t\t\tpointToAttr,\n\t\t\tonPointAdded,\n\t\t\tstats,\n\t\t\tstatsName,\n\t\t\tgrid,\n\t\t\tscale,\n\t\t\tpath,\n\t\t\ttooltip,\n\t\t\tsummary\n\t\t} = props;\n\n\t\t// eg. \"altitude\" == true\n\t\tif (this.options[name] || required) {\n\n\t\t\tthis._registerDataAttribute({\n\t\t\t\tname,\n\t\t\t\tattr,\n\t\t\t\tskipNull,\n\t\t\t\tdeltaMax,\n\t\t\t\tclampRange,\n\t\t\t\tdecimals,\n\t\t\t\tcoordPropsToMeta: _.coordPropsToMeta(coordinateProperties, meta || name, coordPropsToMeta),\n\t\t\t\tpointToAttr,\n\t\t\t\tonPointAdded,\n\t\t\t\tstats,\n\t\t\t\tstatsName,\n\t\t\t});\n\n\t\t\tif (grid) {\n\t\t\t\tthis._registerAxisGrid(L.extend({ name }, grid));\n\t\t\t}\n\n\t\t\tif (this.options[name] !== \"summary\") {\n\t\t\t\tif (scale) this._registerAxisScale(L.extend({ name, label: unit }, scale));\n\t\t\t\tif (path) this._registerAreaPath(L.extend({ name }, path));\n\t\t\t}\n\n\t\t\tif (tooltip || props.tooltips) {\n\t\t\t\t_.each([tooltip, ...(props.tooltips || [])], t => t && this._registerTooltip(L.extend({ name }, t)));\n\t\t\t}\n\n\t\t\tif (summary) {\n\t\t\t\t_.each(summary, (s, k) => summary[k] = L.extend({ unit }, s));\n\t\t\t\tthis._registerSummary(summary);\n\t\t\t}\n\t\t}\n\t},\n\n\t_registerMarker({latlng, sym, content}) {\n\t\tlet { wptIcons } = this.options;\n\t\t// generate and cache appropriate icon symbol\n\t\tif (!wptIcons.hasOwnProperty(sym)) {\n\t\t\twptIcons[sym] = L.divIcon(L.extend({}, wptIcons[\"\"].options, { html: '<i class=\"elevation-waypoint-icon ' + sym + '\"></i>' } ));\n\t\t}\n\t\tlet marker = L.marker(latlng, { icon: wptIcons[sym] });\n\t\tif (content) {\n\t\t\tmarker.bindPopup(content, { className: 'elevation-popup', keepInView: true }).openPopup();\n\t\t\tmarker.bindTooltip(content, { className: 'elevation-tooltip', direction: 'auto', sticky: true, opacity: 1 }).openTooltip();\n\t\t}\n\t\treturn this._addMarker(marker)\n\t},\n\t\n\t/**\n\t * Add chart or marker tooltip info\n\t */\n\t_registerTooltip: function(props) {\n\t\tprops.chart && this.on(\"elechart_init\", () => this._chart._registerTooltip(L.extend({}, props, { value: props.chart })));\n\t\tprops.marker && this.on(\"elechart_marker\", () => this._marker._registerTooltip(L.extend({}, props, { value: props.marker })));\n\t},\n\n\t/**\n\t * Add summary info to diagram\n\t */\n\t_registerSummary: function(props) {\n\t\tthis.on('elechart_summary', () => this._summary._registerSummary(props));\n\t},\n\n\t/*\n\t * Removes the drag rectangle and zoms back to the total extent of the data.\n\t */\n\t_resetDrag: function() {\n\t\tthis._chart._resetDrag();\n\t\tthis._hideMarker();\n\t},\n\n\t/**\n\t * Resets drag, marker and bounds.\n\t */\n\t_resetView: function() {\n\t\tif (this._map && this._map._isFullscreen) return;\n\t\tthis._resetDrag();\n\t\tthis._hideMarker();\n\t\tif (this.options.autofitBounds) {\n\t\t\tthis.fitBounds();\n\t\t}\n\t},\n\n\t/**\n\t * Hacky way for handling chart resize. Deletes it and redraw chart.\n\t */\n\t_resizeChart: function() {\n\t\tif (this._container && _.style(this._container, \"display\") != \"none\") {\n\t\t\tlet opts = this.options;\n\t\t\tlet newWidth = opts.detached ? (this.eleDiv || this._container).offsetWidth : _.clamp(opts._maxWidth, [0, this._map.getContainer().clientWidth - 30]);\n\t\t\tif (newWidth) {\n\t\t\t\topts.width = newWidth;\n\t\t\t\tif (this._chart && this._chart._chart) {\n\t\t\t\t\tthis._chart._chart._resize(opts);\n\t\t\t\t\tthis._updateChart();\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._updateMapSegments();\n\t\t}\n\t},\n\n\t/**\n\t * Collapse or Expand chart control.\n\t */\n\t_toggle: function() {\n\t\t_.hasClass(this._container, \"elevation-expanded\") ? this._collapse() : this._expand();\n\t},\n\n\t/**\n\t * Update map center and zoom (followMarker: true)\n\t */\n\t_setMapView: function(item) {\n\t\tif (this._map && this.options.followMarker) {\n\t\t\tlet zoom = this._map.getZoom();\n\t\t\tlet z = this.options.zFollow;\n\t\t\tif (typeof z === \"number\") {\n\t\t\t\tthis._map.setView(item.latlng, (zoom < z ? z : zoom), { animate: true, duration: 0.25 });\n\t\t\t} else if (!this._map.getBounds().contains(item.latlng)) {\n\t\t\t\tthis._map.setView(item.latlng, zoom, { animate: true, duration: 0.25 });\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Calculates [x, y] domain and then update chart.\n\t */\n\t_updateChart: function() {\n\t\tif (this._chart && this._container) {\n\t\t\tthis.fire(\"elechart_axis\");\n\t\n\t\t\tthis._chart.update({ data: this._data, options: this.options });\n\t\n\t\t\tthis._x = this._chart._x;\n\t\t\tthis._y = this._chart._y;\n\t\n\t\t\tthis.fire('elechart_updated');\t\t\n\t\t}\n\t},\n\n\t/*\n\t * Update the position/height indicator marker drawn onto the map\n\t */\n\t_updateMarker: function(item) {\n\t\tif (this._marker) {\n\t\t\tthis._marker.update({\n\t\t\t\tmap : this._map,\n\t\t\t\titem : item,\n\t\t\t\tyCoordMax : this._yCoordMax || 0,\n\t\t\t\toptions : this.options\n\t\t\t});\n\t\t}\n\t},\n\n\t/**\n\t * Fix marker rotation on rotated maps\n\t */\n\t_rotateMarker: function() {\n\t\tif (this._marker) {\n\t\t\tthis._marker.update();\n\t\t}\n\t},\n\n\t/**\n\t * Highlight track segments on the map.\n\t */\n\t_updateMapSegments: function(coords) {\n\t\tthis._markedSegments.setLatLngs(coords || []);\n\t\tif (coords && this._map && !this._map.hasLayer(this._markedSegments)) {\n\t\t\tthis._markedSegments.addTo(this._map);\n\t\t}\n\t},\n\n\t/**\n\t * Update chart summary.\n\t */\n\t_updateSummary: function() {\n\t\tif (this._summary) {\n\t\t\tthis._summary.reset();\n\t\t\tif (this.options.summary) {\n\t\t\t\tthis.fire(\"elechart_summary\");\n\t\t\t\tthis._summary.update();\n\t\t\t}\n\t\t\tif (this.options.downloadLink && this._downloadURL) { // TODO: generate dynamically file content instead of using static file urls.\n\t\t\t\tthis._summary._container.innerHTML += '<span class=\"download\"><a href=\"#\">' + L._('Download') + '</a></span>'\n\t\t\t\t_.select('.download a', this._summary._container).onclick = (e) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tlet event = { downloadLink: this.options.downloadLink, confirm: _.saveFile.bind(this, this._downloadURL) };\n\t\t\t\t\tif (this.options.downloadLink == 'modal' && typeof CustomEvent === \"function\") {\n\t\t\t\t\t\tdocument.dispatchEvent(new CustomEvent(\"eletrack_download\", { detail: event }));\n\t\t\t\t\t} else if (this.options.downloadLink == 'link' || this.options.downloadLink === true) {\n\t\t\t\t\t\tevent.confirm();\n\t\t\t\t\t}\n\t\t\t\t\tthis.fire('eletrack_download', event);\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t},\n\n\n\t/**\n\t * Calculates chart width.\n\t */\n\t_width: function() {\n\t\tif (this._chart) return this._chart._width();\n\t\tconst { width, margins } = this.options;\n\t\treturn width - margins.left - margins.right;\n\t},\n\n\t/**\n\t * Calculates chart height.\n\t */\n\t_height: function() {\n\t\tif (this._chart) return this._chart._height();\n\t\tconst { height, margins } = this.options;\n\t\treturn height - margins.top - margins.bottom;\n\t},\n\n});","/*\n * Copyright (c) 2019, GPL-3.0+ Project, Raruto\n *\n * This file is free software: you may copy, redistribute and/or modify it\n * under the terms of the GNU General Public License as published by the\n * Free Software Foundation, either version 2 of the License, or (at your\n * option) any later version.\n *\n * This file is distributed in the hope that it will be useful, but\n * WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n *\n * This file incorporates work covered by the following copyright and\n * permission notice:\n *\n * Copyright (c) 2013-2016, MIT License, Felix “MrMufflon” Bache\n *\n * Permission to use, copy, modify, and/or distribute this software\n * for any purpose with or without fee is hereby granted, provided\n * that the above copyright notice and this permission notice appear\n * in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL\n * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE\n * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR\n * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\n * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,\n * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN\n * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\nimport 'leaflet-i18n';\nimport * as _ from './utils';\nimport { Elevation } from './control';\n\nElevation.Utils = _;\n\n/* Temporary fix for empty values evaluated as false (leaflet-i18n v0.3.1) */\n(function(){\n\tlet proto = L.i18n.bind({});\n\tL.i18n = L._ = (string, data) => {\n\t\tif (L.locale && L.locales[L.locale] && L.locales[L.locale][string] == \"\") {\n\t\t\tL.locales[L.locale][string] = \"\\u200B\";\n\t\t}\n\t\treturn proto.call(null, string, data);\n\t};\n})();\n\nL.control.elevation = (options) => new Elevation(options);\n"],"names":["factory","window","define","amd","exports","module","require","L","locales","locale","registerLocale","code","Util","extend","setLocale","i18n","_","string","data","template","err","Colors","lightblue","area","alpha","stroke","magenta","yellow","purple","steelblue","red","lime","line","MIN","SEC","HOUR","DAY","saveFile","dataURI","fileName","a","create","href","target","download","style","b","document","body","appendChild","click","removeChild","coordPropsToMeta","coordProps","name","parser","props","point","id","isMulti","key","meta","parseInt","call","this","property","addClass","n","str","split","every","s","DomUtil","removeClass","toggleClass","cond","replaceClass","rem","add","k","v","getStyle","setProperty","setAttributes","attrs","setAttribute","toggleEvent","el","e","fn","tag","elem","append","c","insert","pos","insertAdjacentElement","select","querySelector","each","obj","i","randomId","Math","random","toString","substr","on","off","DomEvent","throttle","wrapNum","hasClass","round","formatNum","clamp","val","range","wrapDelta","curr","prev","deltaMax","abs","sign","t","d","floor","h","m","padStart","format","time","Date","toLocaleTimeString","toLocaleDateString","toLocaleString","replaceAll","ctx","path","classed","beginPath","moveTo","p","Path2D","attr","strokeStyle","fillStyle","lineWidth","globalCompositeOperation","globalAlpha","fill","closePath","parse","iVal","max","Infinity","min","avg","sum","Options","autofitBounds","autohide","autohideMarker","almostover","altitude","closeBtn","collapsed","detached","distance","distanceMarkers","lazy","direction","dragging","Browser","mobile","downloadLink","elevationDiv","followMarker","imperial","legend","handlers","hotline","marker","markerIcon","divIcon","className","html","iconSize","iconAnchor","position","polyline","color","opacity","weight","lineCap","polylineSegments","interactive","preferCanvas","reverseCoords","ruler","theme","summary","slope","speed","timeFactor","timestamps","trkStart","circleMarker","radius","fillColor","fillOpacity","trkEnd","waypoints","wptIcons","wptLabels","xAttr","xLabel","yAttr","yLabel","zFollow","zooming","Mobile","margins","top","right","bottom","left","height","screen","width","xTicks","undefined","yTicks","decimalsX","decimalsY","forceAxisBounds","interpolation","skipNullZCoords","yAxisMax","yAxisMin","Elevation","Control","includes","Evented","prototype","Mixin","Events","options","__mileFactor","__footFactor","__D3","__TOGEOJSON","__LGEOMUTIL","__LALMOSTOVER","__LHOTLINE","__LDISTANCEM","__LCHART","__LMARKER","__LSUMMARY","__modulesFolder","addData","layer","import","then","_addData","_addLayer","_fireEvt","track_info","addTo","map","parent","_.select","eleDiv","onAdd","_.append","_.insert","getContainer","clear","_marker","remove","_chart","_clearChart","_layers","_clearLayers","_markers","_circleMarkers","_hotline","_data","_updateChart","_events","elechart_updated","forEach","_container","selectAll","l","eachLayer","f","clearLayers","disableBrush","_brushEnabled","_resetDrag","enableBrush","disableZoom","_zoomEnabled","_resetZoom","enableZoom","fitBounds","bounds","getBounds","_map","isValid","latLngBounds","latlng","getZFollow","hide","_.style","initialize","opts","setOptions","featureGroup","_markedSegments","_start","_end","_chartEnabled","_yCoordMax","_setMapView","_.throttle","setStyle","_.Colors","colors","_fixCanvasPaths","_fixTooltipSize","src","condition","d3","toGeoJSON","GeometryUtil","Handler","AlmostOver","DistanceMarkers","Promise","resolve","load","_parseFromString","geojson","_loadLayer","_loadFile","container","_.create","_.randomId","modules","filter","toLowerCase","_loadModules","_initChart","_initButton","_initSummary","_initMarker","_initLayer","fire","onRemove","_hideMarker","_resetView","_resizeChart","_.off","_onKeyDown","_updateSummary","redraw","setZFollow","zoom","show","type","_.each","features","feature","geom","geometry","_addGeoJSONData","coordinates","properties","coords","console","warn","_latlngs","nestingLevel","coordinateProperties","ele","_addPoint","lat","lng","alt","index","length","x","y","z","push","latLng","addLayer","Polyline","_addMarker","_initAlmostOverHandler","almostOver","all","addHandler","enabled","_onMouseMoveLayer","_onMouseOut","_initDistanceMarkers","_initHotLine","prop","trkseg","geo","geoJson","coordsToLatLng","isFinite","palette","0","0.5","1","outlineColor","outlineWidth","_renderer","parentElement","insertBefore","firstChild","_initMapIntegrations","setLatLng","invalidateSize","once","_collapse","_.replaceClass","_expand","oldProto","Canvas","_fillStroke","control","replace","include","hasLayer","oldVal","outline","xCoord","_showDiagramIndicator","_updateMarker","_findItemForLatLng","_findIndexForLatLng","_findItemForX","_findIndexForXCoord","propagate","offsetWidth","offsetHeight","clientWidth","_maxWidth","maxWidth","chart","Chart","_x","_y","render","_onMouseEnter","_onDragEnd","_onMouseMove","_onRulerFilter","_onToggleChart","_rotateMarker","_.on","node","getElement","_.toggleClass","_.toggleEvent","bind","pane","getPane","_pane","createPane","zIndex","pointerEvents","svg","Marker","disableClickPropagation","disableScrollPropagation","link","_button","title","stop","_toggle","_summary","Summary","url","fetch","response","text","_downloadURL","catch","file","exported","Object","keys","_registerHandler","pointToLayer","desc","sym","_registerCheckPoint","label","_registerMarker","content","decodeURI","onEachFeature","dragstart","dragend","item","_.addClass","xDiagCoord","_hideDiagramIndicator","_.removeClass","_updateMapSegments","_hasActiveLayers","_parseFromGeoJSONString","JSON","_parseFromXMLString","trim","pop","indexOf","xml","DOMParser","parseFromString","documentElement","tagName","getElementsByTagName","Array","from","find","textContent","_registerAreaPath","_registerAxisGrid","_registerAxisScale","_registerDataAttribute","lastValid","skipNull","isNaN","splice","pointToAttr","stats","sname","statsName","_.wrapDelta","clampRange","_.clamp","decimals","_.round","onPointAdded","required","unit","grid","scale","tooltip","_.coordPropsToMeta","tooltips","_registerTooltip","_registerSummary","[object Object]","hasOwnProperty","icon","bindPopup","keepInView","openPopup","bindTooltip","sticky","openTooltip","value","_isFullscreen","newWidth","_resize","_.hasClass","getZoom","setView","animate","duration","contains","update","yCoordMax","setLatLngs","reset","innerHTML","onclick","preventDefault","event","confirm","_.saveFile","CustomEvent","dispatchEvent","detail","_width","_height","Utils","proto","elevation"],"mappings":"4FACC,SAAUA,EAASC,GAGM,mBAAXC,QAAyBA,OAAOC,IACvCD,OAAO,CAAC,WAAYF,GAGM,iBAAZI,UACdC,OAAOD,QAAUJ,EAAQM,QAAQ,kBAIf,IAAXL,GAA0BA,EAAOM,GACxCP,EAAQC,EAAOM,GAbvB,EAgBE,SAAUA,GASR,OARAA,EAAEC,QAAU,GACZD,EAAEE,OAAS,KACXF,EAAEG,eAAiB,SAAwBC,EAAMF,GAC7CF,EAAEC,QAAQG,GAAQJ,EAAEK,KAAKC,OAAO,GAAIN,EAAEC,QAAQG,GAAOF,IAEzDF,EAAEO,UAAY,SAAmBH,GAC7BJ,EAAEE,OAASE,GAERJ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KACnBX,EAAEE,QAAUF,EAAEC,QAAQD,EAAEE,SAA0C,IAA/BF,EAAEC,QAAQD,EAAEE,QAAQQ,KAC1DV,EAAEC,QAAQD,EAAEE,QAAQQ,GAAU,KAExBmkB,EAAMrhB,KAAK,KAAM9C,EAAQC,IANlC,GAUAX,EAAE6a,QAAQiK,UAAa9V,GAAY,IAAIP,EAAUO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raruto/leaflet-elevation",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "A Leaflet plugin that allows to add elevation profiles using d3js",
5
5
  "main": "dist/leaflet-elevation.min.js",
6
6
  "module": "src/index.js",