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