@raruto/leaflet-elevation 2.0.4 → 2.0.5
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.
|
@@ -1562,8 +1562,8 @@
|
|
|
1562
1562
|
}
|
|
1563
1563
|
if (this.options.downloadLink && this._downloadURL) { // TODO: generate dynamically file content instead of using static file urls.
|
|
1564
1564
|
this._summary._container.innerHTML += '<span class="download"><a href="#">' + L._('Download') + '</a></span>';
|
|
1565
|
-
select('.download a', this._summary._container).onclick = (
|
|
1566
|
-
preventDefault();
|
|
1565
|
+
select('.download a', this._summary._container).onclick = (e) => {
|
|
1566
|
+
e.preventDefault();
|
|
1567
1567
|
let event = { downloadLink: this.options.downloadLink, confirm: saveFile.bind(this, this._downloadURL) };
|
|
1568
1568
|
if (this.options.downloadLink == 'modal' && typeof CustomEvent === "function") {
|
|
1569
1569
|
document.dispatchEvent(new CustomEvent("eletrack_download", { detail: event }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leaflet-elevation.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\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__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/**\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._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},\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},\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 = ({preventDefault}) => {\n\t\t\t\t\tpreventDefault();\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":["_.select","_.append","_.insert","_.style","_.throttle","_.Colors","_.create","_.randomId","_.off","_.each","_.replaceClass","_.on","_.toggleClass","_.toggleEvent","_.addClass","_.removeClass","_.wrapDelta","_.clamp","_.round","coordPropsToMeta","_.coordPropsToMeta","_.hasClass","_.saveFile"],"mappings":";;;;;IAAA;IACA,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;AAC5B;IACA;IACA,IAAI,IAAI,OAAO,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,GAAG,EAAE;IACpD,QAAQ,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;AACrC;IACA;IACA,KAAK,MAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;IAC5C,QAAQ,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACrD,KAAK;AACL;IACA;IACA,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,CAAC,EAAE;IACnD,QAAQ,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC1B;IACA,KAAK;IACL,CAAC,CAAC,UAAU,CAAC,EAAE;IACf,IAAI,CAAC,CAAC,OAAO,GAAG,EAAE,CAAC;IACnB,IAAI,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,CAAC,cAAc,GAAG,SAAS,cAAc,CAAC,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AAG,OAAO,CAAC,MAAM,CAAC;IAC/C,EAAE;AACF;IACA,CAAC,CAAC;;IC3vCF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AAKA;IACA,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC;AACpB;IACA;IACA,CAAC,UAAU;IACX,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,KAAK;IAClC,EAAE,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE;IAC5E,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;IAC1C,GAAG;IACH,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACxC,EAAE,CAAC;IACH,CAAC,GAAG,CAAC;AACL;IACA,CAAC,CAAC,OAAO,CAAC,SAAS,GAAG,CAAC,OAAO,KAAK,IAAI,SAAS,CAAC,OAAO,CAAC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"leaflet-elevation.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\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__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/**\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._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},\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},\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":["_.select","_.append","_.insert","_.style","_.throttle","_.Colors","_.create","_.randomId","_.off","_.each","_.replaceClass","_.on","_.toggleClass","_.toggleEvent","_.addClass","_.removeClass","_.wrapDelta","_.clamp","_.round","coordPropsToMeta","_.coordPropsToMeta","_.hasClass","_.saveFile"],"mappings":";;;;;IAAA;IACA,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;AAC5B;IACA;IACA,IAAI,IAAI,OAAO,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,GAAG,EAAE;IACpD,QAAQ,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;AACrC;IACA;IACA,KAAK,MAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;IAC5C,QAAQ,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,O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I,CAAC,CAAC;IACxC,EAAE,CAAC;IACH,CAAC,GAAG,CAAC;AACL;IACA,CAAC,CAAC,OAAO,CAAC,SAAS,GAAG,CAAC,OAAO,KAAK,IAAI,SAAS,CAAC,OAAO,CAAC;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";!function(t,e){"function"==typeof define&&define.amd?define(["leaflet"],t):"object"==typeof exports&&(module.exports=t(require("leaflet"))),void 0!==e&&e.L&&t(e.L)}((function(t){return t.locales={},t.locale=null,t.registerLocale=function(e,i){t.locales[e]=t.Util.extend({},t.locales[e],i)},t.setLocale=function(e){t.locale=e},t.i18n=t._=function(e,i){t.locale&&t.locales[t.locale]&&t.locales[t.locale][e]&&(e=t.locales[t.locale][e]);try{e=t.Util.template(e,i)}catch(t){}return e}}),window);const t={lightblue:{area:"#3366CC",alpha:.45,stroke:"#3366CC"},magenta:{area:"#FF005E"},yellow:{area:"#FF0"},purple:{area:"#732C7B"},steelblue:{area:"#4682B4"},red:{area:"#F00"},lime:{area:"#9CC222",line:"#566B13"}},e=6e4,i=60*e,a=24*i;function o(t,e){let i=p("a","",{href:t,target:"_new",download:e||"",style:"display:none;"}),a=document.body;a.appendChild(i),i.click(),a.removeChild(i)}function s(t,e,i){return t&&(({props:a,point:o,id:s,isMulti:r})=>{if(a)for(const l of t)if(l in a){o.meta[e]=(i||n).call(this,r?a[l][r]:a[l],s);break}})}const n=(t,e)=>window.parseInt("object"==typeof t?t[e]:t),r=(t,e)=>t&&e.split(" ").every((e=>e&&L.DomUtil.addClass(t,e))),l=(t,e)=>t&&e.split(" ").every((e=>e&&L.DomUtil.removeClass(t,e))),h=(t,e,i)=>(i?r:l)(t,e),d=(t,e,i)=>e&&l(t,e)||i&&r(t,i),c=(t,e,i)=>void 0===i&&L.DomUtil.getStyle(t,e)||t.style.setProperty(e,i),_=(t,e)=>{for(let i in e)t.setAttribute(i,e[i])},m=(t,e,i,a)=>t[a?"on":"off"](e,i),p=(t,e,i,a)=>{let o=L.DomUtil.create(t,e||"");return i&&_(o,i),a&&u(a,o),o},u=(t,e)=>t.appendChild(e),f=(t,e,i)=>t.insertAdjacentElement(i,e),g=(t,e)=>(e||document).querySelector(t),y=(t,e)=>{for(let i in t)e(t[i],i)},k=()=>Math.random().toString(36).substr(2,9),{on:v,off:M}=L.DomEvent,{throttle:w,wrapNum:C}=L.Util,{hasClass:S}=L.DomUtil,x=L.Util.formatNum,b=(t,e)=>e?t<e[0]?e[0]:t>e[1]?e[1]:t:t,D=(t,e,i)=>Math.abs(t-e)>i?e+i*Math.sign(t-e):t;var E=Object.freeze({__proto__:null,Colors:t,formatTime:function(t){let o=Math.floor(t/a),s=Math.floor((t-o*a)/i),n=Math.floor((t-o*a-s*i)/e),r=Math.round((t-o*a-s*i-n*e)/1e3);return 60===r&&(n++,r=0),60===n&&(s++,n=0),24===s&&(o++,s=0),(o?o+"d ":"")+s.toString().padStart(2,0)+":"+n.toString().padStart(2,0)+"'"+r.toString().padStart(2,0)+'"'},formatDate:function(t){return t?"time"==t?t=>new Date(t).toLocaleTimeString():"date"==t?t=>new Date(t).toLocaleDateString():e=>t(e):t=>new Date(t).toLocaleString().replaceAll("/","-").replaceAll(","," ")},saveFile:o,drawCanvas:function(t,e){e.classed("canvas-path",!0),t.beginPath(),t.moveTo(0,0);let i=new Path2D(e.attr("d"));t.strokeStyle=e.attr("stroke"),t.fillStyle=e.attr("fill"),t.lineWidth=1.25,t.globalCompositeOperation="source-over",t.globalAlpha=e.attr("stroke-opacity")||.3,t.stroke(i),t.globalAlpha=e.attr("fill-opacity")||.45,t.fill(i),t.globalAlpha=1,t.closePath()},coordPropsToMeta:s,parseInt:n,parseDate:(t,e)=>new Date(Date.parse("object"==typeof t?t[e]:t)),addClass:r,removeClass:l,toggleClass:h,replaceClass:d,style:c,toggleStyle:(t,e,i,a)=>c(t,e,a?i:""),setAttributes:_,toggleEvent:m,create:p,append:u,insert:f,select:g,each:y,randomId:k,iMax:(t,e)=>(t>e?t:e)||-1/0,iMin:(t,e)=>(t<e?t:e)||1/0,iAvg:(t,e)=>(t+(e||0))/2,iSum:(t,e)=>t+(e||0),on:v,off:M,throttle:w,wrapNum:C,hasClass:S,round:x,clamp:b,wrapDelta:D}),N={autofitBounds:!0,autohide:!1,autohideMarker:!0,almostover:!0,altitude:!0,closeBtn:!0,collapsed:!1,detached:!0,distance:!0,distanceMarkers:{lazy:!0,distance:!0,direction:!0},dragging:!L.Browser.mobile,downloadLink:"link",elevationDiv:"#elevation-div",followMarker:!0,imperial:!1,legend:!0,handlers:[],marker:"elevation-line",markerIcon:L.divIcon({className:"elevation-position-marker",html:'<i class="elevation-position-icon"></i>',iconSize:[32,32],iconAnchor:[16,16]}),position:"topright",polyline:{className:"elevation-polyline",color:"#000",opacity:.75,weight:5,lineCap:"round"},polylineSegments:{className:"elevation-polyline-segments",color:"#F00",interactive:!1},preferCanvas:!1,reverseCoords:!1,ruler:!0,theme:"lightblue-theme",summary:"inline",slope:!1,speed:!1,time:!1,timeFactor:3600,timestamps:!1,trkStart:L.circleMarker([0,0],{className:"start-marker",radius:6,weight:2,color:"#fff",fillColor:"#00d800",fillOpacity:1,interactive:!1}),trkEnd:L.circleMarker([0,0],{className:"end-marker",radius:6,weight:2,color:"#fff",fillColor:"#ff0606",fillOpacity:1,interactive:!1}),waypoints:!0,wptIcons:{"":L.divIcon({className:"elevation-waypoint-marker",html:'<i class="elevation-waypoint-icon default"></i>',iconSize:[30,30],iconAnchor:[8,30]})},wptLabels:!0,xAttr:"dist",xLabel:"km",yAttr:"z",yLabel:"m",zFollow:!1,zooming:!L.Browser.Mobile,margins:{top:30,right:30,bottom:30,left:40},height:.3*screen.height||200,width:.6*screen.width||600,xTicks:void 0,yTicks:void 0,decimalsX:2,decimalsY:0,forceAxisBounds:!1,interpolation:"curveLinear",skipNullZCoords:!1,yAxisMax:void 0,yAxisMin:void 0};const A=L.Control.Elevation=L.Control.extend({includes:L.Evented?L.Evented.prototype:L.Mixin.Events,options:N,__mileFactor:.621371,__footFactor:3.28084,__D3:"https://unpkg.com/d3@6.5.0/dist/d3.min.js",__TOGEOJSON:"https://unpkg.com/@tmcw/togeojson@4.6.0/dist/togeojson.umd.js",__LGEOMUTIL:"https://unpkg.com/leaflet-geometryutil@0.9.3/src/leaflet.geometryutil.js",__LALMOSTOVER:"https://unpkg.com/leaflet-almostover@1.0.1/src/leaflet.almostover.js",__LDISTANCEM:"../libs/leaflet-distance-marker.min.js",__LCHART:"../src/components/chart.js",__LMARKER:"../src/components/marker.js",__LSUMMARY:"../src/components/summary.js",__modulesFolder:"../src/handlers/",addData:function(t,e){this.import(this.__D3).then((()=>{e=e??(t.on&&t),this._addData(t),this._addLayer(e),this._fireEvt("eledata_added",{data:t,layer:e,track_info:this.track_info})}))},addTo:function(t){if(this.options.detached){let e=g(this.options.elevationDiv),i=this.onAdd(t);e?u(e,i):f(t.getContainer(),i,"afterend")}else L.Control.prototype.addTo.call(this,t);return this},clear:function(){this._marker&&this._marker.remove(),this._chart&&this._clearChart(),this._layers&&this._clearLayers(this._layers),this._markers&&this._clearLayers(this._markers),this._circleMarkers&&this._clearLayers(this._circleMarkers),this._data=[],this.track_info={},this._fireEvt("eledata_clear"),this._updateChart()},_clearChart:function(){this._events&&this._events.elechart_updated&&this._events.elechart_updated.forEach((({fn:t,ctx:e})=>this.off("elechart_updated",t,e))),this._chart&&this._chart._container&&(this._chart._container.selectAll("g.point .point").remove(),this._chart.clear())},_clearLayers:function(t){(t=t||this._layers)&&t.eachLayer&&(t.eachLayer((t=>t.remove())),t.clearLayers())},disableBrush:function(){this._chart._brushEnabled=!1,this._resetDrag()},enableBrush:function(){this._chart._brushEnabled=!0},disableZoom:function(){this._chart._zoomEnabled=!1,this._chart._resetZoom()},enableZoom:function(){this._chart._zoomEnabled=!0},fitBounds:function(t){t=t||this.getBounds(),this._map&&t.isValid()&&this._map.fitBounds(t)},getBounds:function(t){return L.latLngBounds((t||this._data).map((t=>t.latlng)))},getZFollow:function(){return this.options.zFollow},hide:function(){c(this._container,"display","none")},initialize:function(e){e=L.setOptions(this,e),this._data=[],this._layers=L.featureGroup(),this._markers=L.featureGroup(),this._circleMarkers=L.featureGroup(),this._markedSegments=L.polyline([]),this._start=e.trkStart||N.trkStart,this._end=e.trkEnd||N.trkEnd,this._chartEnabled=!0,this._yCoordMax=-1/0,this.track_info={},e.followMarker&&(this._setMapView=w(this._setMapView,300,this)),e.legend&&(e.margins.bottom+=30),e.theme&&(e.polylineSegments.className+=" "+e.theme),!0===e.wptIcons&&(e.wptIcons=N.wptIcons),!0===e.distanceMarkers&&(e.distanceMarkers=N.distanceMarkers),e.trkStart&&this._start.addTo(this._circleMarkers),e.trkEnd&&this._end.addTo(this._circleMarkers),this._markedSegments.setStyle(e.polylineSegments),L.extend(t,e.colors||{}),this._fixCanvasPaths(),this._fixTooltipSize()},import:function(t,e){switch(t){case this.__D3:e="object"!=typeof d3;break;case this.__TOGEOJSON:e="object"!=typeof toGeoJSON;break;case this.__LGEOMUTIL:e="object"!=typeof L.GeometryUtil;break;case this.__LALMOSTOVER:e="function"!=typeof L.Handler.AlmostOver;break;case this.__LDISTANCEM:e="function"!=typeof L.DistanceMarkers}return!1!==e?import(t):Promise.resolve()},load:function(t){this._parseFromString(t).then((e=>e?this._loadLayer(e):this._loadFile(t)))},onAdd:function(t){this._map=t;let e=this._container=p("div","elevation-control "+this.options.theme+" "+(this.options.detached?"elevation-detached":"leaflet-control"),this.options.detached?{id:"elevation-"+k()}:{});this.eleDiv||(this.eleDiv=e);let i=["Distance","Time","Altitude","Slope","Speed","Acceleration",...this.options.handlers].filter((t=>!1!==this.options["string"==typeof t&&t.toLowerCase()]));return this._loadModules(i),this._initButton(e),this._initChart(e),this._initSummary(e),this._initMarker(t),this._initLayer(t),e},onRemove:function(t){this._container=null,t.off("zoom viewreset zoomanim",this._hideMarker,this).off("resize",this._resetView,this).off("resize",this._resizeChart,this).off("mousedown",this._resetDrag,this),M(t.getContainer(),"mousewheel",this._resetDrag,this),M(t.getContainer(),"touchstart",this._resetDrag,this),M(document,"keydown",this._onKeyDown,this),this.off("eledata_added eledata_loaded",this._updateChart,this).off("eledata_added eledata_loaded",this._updateSummary,this)},redraw:function(){this._resizeChart()},setZFollow:function(t){this.options.zFollow=t},show:function(){c(this._container,"display","block")},_addData:function(t){if(t){if("FeatureCollection"===t.type)return y(t.features,(t=>this._addData(t)));if("Feature"===t.type){let e=t.geometry;if(e)switch(e.type){case"LineString":return this._addGeoJSONData(e.coordinates,t.properties);case"MultiLineString":return y(e.coordinates,((e,i)=>this._addGeoJSONData(e,t.properties,i)));case"Point":default:return console.warn("Unsopperted GeoJSON feature geometry type:"+e.type)}}return t._latlngs?this._addGeoJSONData(t._latlngs,t.feature&&t.feature.properties):void 0}},_addGeoJSONData:function(t,e,i){let a=e&&e.coordinateProperties||e;t.forEach(((t,e)=>{t.meta=t.meta??{time:null,ele:null},t.prev=t=>t?this._data[e>0?e-1:0][t]:this._data[e>0?e-1:0],this.fire("elepoint_init",{point:t,props:a,id:e,isMulti:i}),this._addPoint(t.lat??t[1],t.lng??t[0],t.alt??t.meta.ele??t[2]),this.fire("elepoint_added",{point:t,index:this._data.length-1}),this._yCoordMax<this._data[this._data.length-1][this.options.yAttr]&&(this._yCoordMax=this._data[this._data.length-1][this.options.yAttr])})),this.fire("eletrack_added",{coords:t,index:this._data.length-1})},_addPoint:function(t,e,i){this.options.reverseCoords&&([t,e]=[e,t]),this._data.push({x:t,y:e,z:i,latlng:L.latLng(t,e,i)}),this.fire("eledata_updated",{index:this._data.length-1})},_addLayer:function(t){return t&&this._layers.addLayer(t),t&&this.options.distanceMarkers&&this.options.distanceMarkers.lazy&&t.on("add remove",(({target:t,type:e})=>L.DistanceMarkers&&t instanceof L.Polyline&&t[e+"DistanceMarkers"]())),t},_addMarker:function(t){return t&&this._markers.addLayer(t),t},_initAlmostOverHandler:function(t,e){t&&this.options.almostOver&&Promise.all([this.import(this.__LGEOMUTIL),this.import(this.__LALMOSTOVER)]).then((()=>{t.addHandler("almostOver",L.Handler.AlmostOver),L.GeometryUtil&&t.almostOver&&t.almostOver.enabled()&&(t.almostOver.addLayer(e),t.on("almost:move",(t=>this._onMouseMoveLayer(t))).on("almost:out",(t=>this._onMouseOut(t))))}))},_initDistanceMarkers:function(t,e){t&&(this.options.distanceMarkers?Promise.all([this.import(this.__LGEOMUTIL),this.import(this.__LDISTANCEM)]).then((()=>this.options.polyline&&e.addTo(t)&&this._circleMarkers.bringToFront())):this.options.polyline&&e.addTo(t))},_initMapIntegrations:function(t,e){let i=t._map;t._data.length&&(t._start.setLatLng(t._data[0].latlng),t._end.setLatLng(t._data[t._data.length-1].latlng)),i?(t._circleMarkers.addTo(i),i.once("layeradd",(i=>t.options.autofitBounds&&t.fitBounds(e.getBounds()))),L.Browser.mobile?t.options.polyline&&e.addTo(i):(t._initAlmostOverHandler(i,e),t._initDistanceMarkers(i,e)),i.invalidateSize()):console.warn("Undefined elevation map object")},_collapse:function(){d(this._container,"elevation-expanded","elevation-collapsed")},_expand:function(){d(this._container,"elevation-collapsed","elevation-expanded")},_fixCanvasPaths:function(){let e=L.Canvas.prototype._fillStroke,i=this,a=this.options.theme.split(" ")[0].replace("-theme",""),o=t[a]||{};L.Canvas.include({_fillStroke:function(t,s){if(i._layers.hasLayer(s)){let i=s.options;if(i.color=o.line||o.area||a,i.stroke=!!i.color,e.call(this,t,s),i.stroke&&0!==i.weight){let e=t.globalCompositeOperation||"source-over";t.globalCompositeOperation="destination-over",t.strokeStyle=o.outline||"#FFF",t.lineWidth=1.75*i.weight,t.stroke(),t.globalCompositeOperation=e}}else e.call(this,t,s)}})},_fixTooltipSize:function(){this.on("elechart_init",(()=>this.once("elechart_change elechart_hover",(({data:t,xCoord:e})=>{this._chartEnabled&&(this._chart._showDiagramIndicator(t,e),this._chart._showDiagramIndicator(t,e)),this._updateMarker(t)}))))},_findItemForLatLng:function(t){return this._data[this._chart._findIndexForLatLng(t)]},_findItemForX:function(t){return this._data[this._chart._findIndexForXCoord(t)]},_fireEvt:function(t,e,i){this.fire&&this.fire(t,e,i),this._map&&this._map.fire(t,e,i)},_hideMarker:function(){this.options.autohideMarker&&this._marker.remove()},_initChart:function(t){let e=this.options;if(e.detached){let{offsetWidth:t,offsetHeight:i}=this.eleDiv;t>0&&(e.width=t),i>20&&(e.height=i-20)}else{let{clientWidth:t}=this._map.getContainer();e._maxWidth=e._maxWidth>e.width?e._maxWidth:e.width,this._container.style.maxWidth=e._maxWidth+"px",e._maxWidth>t&&(e.width=t-30)}Promise.all([this.import(this.__D3),this.import(this.__LCHART)]).then((i=>{let a=this._chart=new(i[1]||A).Chart(e,this);this._x=this._chart._x,this._y=this._chart._y,d3.select(t).call(a.render()),a.on("reset_drag",this._hideMarker,this).on("mouse_enter",this._onMouseEnter,this).on("dragged",this._onDragEnd,this).on("mouse_move",this._onMouseMove,this).on("mouse_out",this._onMouseOut,this).on("ruler_filter",this._onRulerFilter,this).on("zoom",this._updateChart,this).on("elepath_toggle",this._onToggleChart,this).on("margins_updated",this._resizeChart,this),this.fire("elechart_init"),map.on("zoom viewreset zoomanim",this._hideMarker,this).on("resize",this._resetView,this).on("resize",this._resizeChart,this).on("rotate",this._rotateMarker,this).on("mousedown",this._resetDrag,this),v(map.getContainer(),"mousewheel",this._resetDrag,this),v(map.getContainer(),"touchstart",this._resetDrag,this),v(document,"keydown",this._onKeyDown,this),this.on("eledata_added eledata_loaded",this._updateChart,this).on("eledata_added eledata_loaded",this._updateSummary,this),this._updateChart(),this._updateSummary()}))},_initLayer:function(){this._layers.on("layeradd layerremove",(({layer:t,type:e})=>{let i=t.getElement&&t.getElement();h(i,this.options.polyline.className+" "+this.options.theme,"layeradd"==e),m(t,"mousemove",this._onMouseMoveLayer.bind(this),"layeradd"==e),m(t,"mouseout",this._onMouseOut.bind(this),"layeradd"==e)}))},_initMarker:function(t){let e=t.getPane("elevationPane");e||(e=this._pane=t.createPane("elevationPane",t.getPane("norotatePane")||t.getPane("mapPane")),e.style.zIndex=625,e.style.pointerEvents="none"),this._renderer&&this._renderer.remove(),this._renderer=L.svg({pane:"elevationPane"}).addTo(this._map),Promise.all([this.import(this.__D3),this.import(this.__LMARKER)]).then((t=>{this._marker=new(t[1]||A).Marker(this.options,this),this.fire("elechart_marker")}))},_initButton:function(t){if(!L.Browser.mobile&&this.options.detached||L.DomEvent.disableClickPropagation(t).disableScrollPropagation(t),this.options.collapsed?this._collapse():this._expand(),this.options.autohide&&(v(t,"mouseover",this._expand,this),v(t,"mouseout",this._collapse,this),this._map.on("click",this._collapse,this)),this.options.closeBtn){let e=this._button=p("a","elevation-toggle-icon",{href:"#",title:L._("Elevation")},t);v(e,"click",L.DomEvent.stop),v(e,"click",this._toggle,this),v(e,"focus",this._toggle,this)}},_initSummary:function(t){this.import(this.__LSUMMARY).then((e=>{this._summary=new(e||A).Summary({summary:this.options.summary},this),this.on("elechart_init",(()=>{d3.select(t).call(this._summary.render())}))}))},_loadFile:function(t){fetch(t).then((t=>t.text())).then((e=>{this._downloadURL=t,this._parseFromString(e).then((t=>t&&this._loadLayer(t)))})).catch((t=>console.warn(t)))},_loadModules:function(t){t=t.map((t=>"string"==typeof t&&void 0!==A[t]?A[t]:t)),Promise.all(t.filter((t=>"string"==typeof t||t instanceof Promise)).map((t=>t instanceof Promise?t:this.import(this.__modulesFolder+t.toLowerCase()+".js")))).then((e=>{y(e,(e=>{let i=Object.keys(e)[0];i&&void 0===A[i]&&(t[i]=A[i]=e[i])})),y(t,(t=>this._registerHandler(t)))}))},_loadLayer:function(t){let{polyline:e,theme:i,waypoints:a,wptIcons:o,wptLabels:s,distanceMarkers:n}=this.options,r=L.extend({},e);i&&(r.className+=" "+i),t.name&&(this.track_info.name=t.name);let l=L.geoJson(t,{distanceMarkers:n,style:r,pointToLayer:(t,e)=>{if(a){let{desc:i,name:n,sym:r}=t.properties;if(i=i||"",n=n||"",[!0,"dots"].includes(a)&&this._registerCheckPoint({latlng:e,label:[!0,"dots"].includes(s)?n:""}),[!0,"markers"].includes(a)&&0!=o)return this._registerMarker({latlng:e,sym:(r??n).replace(" ","-").replace('"',"").replace("'","").toLowerCase(),content:[!0,"markers"].includes(s)&&(n||i)&&decodeURI("<b>"+n+"</b>"+(i.length>0?"<br>"+i:""))})}},onEachFeature:(t,e)=>t.geometry&&"Point"!=t.geometry.type&&this.addData(t,e)});return this.import(this.__D3).then((()=>{this._initMapIntegrations(this,l),this._fireEvt("eledata_loaded",{data:t,layer:l,name:this.track_info.name,track_info:this.track_info})})),l},_onDragEnd:function({dragstart:t,dragend:e}){this._hideMarker(),this.fitBounds(L.latLngBounds([t.latlng,e.latlng])),this.fire("elechart_dragged")},_onKeyDown:function({key:t}){this.options.detached||"Escape"!==t||this._collapse()},_onMouseEnter:function(){this.fire("elechart_enter")},_onMouseMove:function({xCoord:t}){if(this._chartEnabled&&this._data.length){let e=this._findItemForX(t);e&&(this._chartEnabled&&this._chart._showDiagramIndicator(e,t),this._updateMarker(e),this._setMapView(e),this._map&&r(this._map.getContainer(),"elechart-hover"),this.fire("elechart_change",{data:e,xCoord:t}),this.fire("elechart_hover",{data:e,xCoord:t}))}},_onMouseMoveLayer:function({latlng:t}){if(this._data.length){let e=this._findItemForLatLng(t);if(e){let t=e.xDiagCoord;this._chartEnabled&&this._chart._showDiagramIndicator(e,t),this._updateMarker(e),this.fire("elechart_change",{data:e,xCoord:t})}}},_onMouseOut:function(){this.options.detached||(this._hideMarker(),this._chart._hideDiagramIndicator()),this._map&&l(this._map.getContainer(),"elechart-hover"),this.fire("elechart_leave")},_onRulerFilter:function({coords:t}){this._updateMapSegments(t)},_onToggleChart:function({name:t,enabled:e}){this._chartEnabled=this._chart._hasActiveLayers(),this._layers.eachLayer((t=>h(t.getElement&&t.getElement(),this.options.polyline.className+" "+this.options.theme,this._chartEnabled))),this.options[t]=e||"disabled"!=this.options[t]?"disabled":"enabled",this._chartEnabled||(this._chart._hideDiagramIndicator(),this._marker.remove())},_parseFromGeoJSONString:function(t){try{return JSON.parse(t)}catch(t){}},_parseFromString:function(t){return new Promise((e=>this.import(this.__TOGEOJSON).then((()=>{let i;try{i=this._parseFromXMLString(t.trim())}catch(e){i=this._parseFromGeoJSONString(t.toString())}i&&(i.name=i.name||(this._downloadURL||"").split("/").pop().split("#")[0].split("?")[0]),e(i)}))))},_parseFromXMLString:function(t){if(0!=t.indexOf("<"))throw"Invalid XML";let e=(new DOMParser).parseFromString(t,"text/xml"),i=e.documentElement.tagName.toLowerCase(),a=e.getElementsByTagName("name");if(e.getElementsByTagName("parsererror").length)throw"Invalid XML";i in toGeoJSON||(i="TrainingCenterDatabase"==e.documentElement.tagName?"tcx":"gpx");let o=toGeoJSON[i](e);return o.name=a.length>0?(Array.from(a).find((t=>"trk"==t.parentElement.tagName))??a[0]).textContent:"",o},_registerAreaPath:function(t){this.on("elechart_init",(()=>this._chart._registerAreaPath(t)))},_registerAxisGrid:function(t){this.on("elechart_axis",(()=>this._chart._registerAxisGrid(t)))},_registerAxisScale:function(t){this.on("elechart_axis",(()=>this._chart._registerAxisScale(t)))},_registerCheckPoint:function(t){this.on("elechart_updated",(()=>this._chart._registerCheckPoint(t)))},_registerDataAttribute:function(t){let e,i,a,o;t.coordPropsToMeta&&this.on("elepoint_init",(e=>t.coordPropsToMeta.call(this,e)));let s=null;this.on("elepoint_added",(({index:n,point:r})=>{if(e=n,a=i??this._data[e],i=this._data[e],o=t.attr||t.name,!1===t.skipNull){let t=this._data[e][o];if(e>0){let i=this._data[e-1][o];if(isNaN(i)){if(isNaN(s)||isNaN(t)?isNaN(s)?isNaN(t)||(i=t):i=s:i=(s+t)/2,!isNaN(i))return this._data.splice(e-1,1);this._data[e-1][o]=i}}isNaN(t)||(s=t)}if(i[o]=t.pointToAttr.call(this,r,e),t.stats)for(const e in t.stats){let a=(t.statsName||o)+(""!=e?"_":"");this.track_info[a+e]=t.stats[e].call(this,i[o],this.track_info[a+e])}t.deltaMax&&(i[o]=D(i[o],a[o],t.deltaMax)),t.clampRange&&(i[o]=b(i[o],t.clampRange)),isNaN(t.decimals)||(i[o]=x(i[o],t.decimals)),t.onPointAdded&&t.onPointAdded.call(this,i[o],e,r)}))},_registerHandler:function(t){if("function"==typeof t)return this._registerHandler(t.call(this));let{name:e,attr:i,required:a,skipNull:o,deltaMax:n,clampRange:r,decimals:l,meta:h,unit:d,coordinateProperties:c,coordPropsToMeta:_,pointToAttr:m,onPointAdded:p,stats:u,statsName:f,grid:g,scale:k,path:v,tooltip:M,summary:w}=t;(this.options[e]||a)&&(this._registerDataAttribute({name:e,attr:i,skipNull:o,deltaMax:n,clampRange:r,decimals:l,coordPropsToMeta:s(c,h||e,_),pointToAttr:m,onPointAdded:p,stats:u,statsName:f}),g&&this._registerAxisGrid(L.extend({name:e},g)),"summary"!==this.options[e]&&(k&&this._registerAxisScale(L.extend({name:e,label:d},k)),v&&this._registerAreaPath(L.extend({name:e},v))),(M||t.tooltips)&&y([M,...t.tooltips||[]],(t=>t&&this._registerTooltip(L.extend({name:e},t)))),w&&(y(w,((t,e)=>w[e]=L.extend({unit:d},t))),this._registerSummary(w)))},_registerMarker({latlng:t,sym:e,content:i}){let{wptIcons:a}=this.options;a.hasOwnProperty(e)||(a[e]=L.divIcon(L.extend({},a[""].options,{html:'<i class="elevation-waypoint-icon '+e+'"></i>'})));let o=L.marker(t,{icon:a[e]});return i&&(o.bindPopup(i,{className:"elevation-popup",keepInView:!0}).openPopup(),o.bindTooltip(i,{className:"elevation-tooltip",direction:"auto",sticky:!0,opacity:1}).openTooltip()),this._addMarker(o)},_registerTooltip:function(t){t.chart&&this.on("elechart_init",(()=>this._chart._registerTooltip(L.extend({},t,{value:t.chart})))),t.marker&&this.on("elechart_marker",(()=>this._marker._registerTooltip(L.extend({},t,{value:t.marker}))))},_registerSummary:function(t){this.on("elechart_summary",(()=>this._summary._registerSummary(t)))},_resetDrag:function(){this._chart._resetDrag(),this._hideMarker()},_resetView:function(){this._map&&this._map._isFullscreen||(this._resetDrag(),this._hideMarker(),this.options.autofitBounds&&this.fitBounds())},_resizeChart:function(){if(this._container&&"none"!=c(this._container,"display")){let t=this.options,e=t.detached?(this.eleDiv||this._container).offsetWidth:b(t._maxWidth,[0,this._map.getContainer().clientWidth-30]);e&&(t.width=e,this._chart&&this._chart._chart&&(this._chart._chart._resize(t),this._updateChart())),this._updateMapSegments()}},_toggle:function(){S(this._container,"elevation-expanded")?this._collapse():this._expand()},_setMapView:function(t){if(this._map&&this.options.followMarker){let e=this._map.getZoom(),i=this.options.zFollow;"number"==typeof i?this._map.setView(t.latlng,e<i?i:e,{animate:!0,duration:.25}):this._map.getBounds().contains(t.latlng)||this._map.setView(t.latlng,e,{animate:!0,duration:.25})}},_updateChart:function(){this._chart&&this._container&&(this.fire("elechart_axis"),this._chart.update({data:this._data,options:this.options}),this._x=this._chart._x,this._y=this._chart._y,this.fire("elechart_updated"))},_updateMarker:function(t){this._marker&&this._marker.update({map:this._map,item:t,yCoordMax:this._yCoordMax||0,options:this.options})},_rotateMarker:function(){this._marker&&this._marker.update()},_updateMapSegments:function(t){this._markedSegments.setLatLngs(t||[]),t&&this._map&&!this._map.hasLayer(this._markedSegments)&&this._markedSegments.addTo(this._map)},_updateSummary:function(){this._summary&&(this._summary.reset(),this.options.summary&&(this.fire("elechart_summary"),this._summary.update()),this.options.downloadLink&&this._downloadURL&&(this._summary._container.innerHTML+='<span class="download"><a href="#">'+L._("Download")+"</a></span>",g(".download a",this._summary._container).onclick=({preventDefault:t})=>{t();let e={downloadLink:this.options.downloadLink,confirm:o.bind(this,this._downloadURL)};"modal"==this.options.downloadLink&&"function"==typeof CustomEvent?document.dispatchEvent(new CustomEvent("eletrack_download",{detail:e})):"link"!=this.options.downloadLink&&!0!==this.options.downloadLink||e.confirm(),this.fire("eletrack_download",e)}))},_width:function(){if(this._chart)return this._chart._width();const{width:t,margins:e}=this.options;return t-e.left-e.right},_height:function(){if(this._chart)return this._chart._height();const{height:t,margins:e}=this.options;return t-e.top-e.bottom}});A.Utils=E,function(){let t=L.i18n.bind({});L.i18n=L._=(e,i)=>(L.locale&&L.locales[L.locale]&&""==L.locales[L.locale][e]&&(L.locales[L.locale][e]=""),t.call(null,e,i))}(),L.control.elevation=t=>new A(t)}));
|
|
1
|
+
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";!function(t,e){"function"==typeof define&&define.amd?define(["leaflet"],t):"object"==typeof exports&&(module.exports=t(require("leaflet"))),void 0!==e&&e.L&&t(e.L)}((function(t){return t.locales={},t.locale=null,t.registerLocale=function(e,i){t.locales[e]=t.Util.extend({},t.locales[e],i)},t.setLocale=function(e){t.locale=e},t.i18n=t._=function(e,i){t.locale&&t.locales[t.locale]&&t.locales[t.locale][e]&&(e=t.locales[t.locale][e]);try{e=t.Util.template(e,i)}catch(t){}return e}}),window);const t={lightblue:{area:"#3366CC",alpha:.45,stroke:"#3366CC"},magenta:{area:"#FF005E"},yellow:{area:"#FF0"},purple:{area:"#732C7B"},steelblue:{area:"#4682B4"},red:{area:"#F00"},lime:{area:"#9CC222",line:"#566B13"}},e=6e4,i=60*e,a=24*i;function o(t,e){let i=p("a","",{href:t,target:"_new",download:e||"",style:"display:none;"}),a=document.body;a.appendChild(i),i.click(),a.removeChild(i)}function s(t,e,i){return t&&(({props:a,point:o,id:s,isMulti:r})=>{if(a)for(const l of t)if(l in a){o.meta[e]=(i||n).call(this,r?a[l][r]:a[l],s);break}})}const n=(t,e)=>window.parseInt("object"==typeof t?t[e]:t),r=(t,e)=>t&&e.split(" ").every((e=>e&&L.DomUtil.addClass(t,e))),l=(t,e)=>t&&e.split(" ").every((e=>e&&L.DomUtil.removeClass(t,e))),h=(t,e,i)=>(i?r:l)(t,e),d=(t,e,i)=>e&&l(t,e)||i&&r(t,i),c=(t,e,i)=>void 0===i&&L.DomUtil.getStyle(t,e)||t.style.setProperty(e,i),_=(t,e)=>{for(let i in e)t.setAttribute(i,e[i])},m=(t,e,i,a)=>t[a?"on":"off"](e,i),p=(t,e,i,a)=>{let o=L.DomUtil.create(t,e||"");return i&&_(o,i),a&&u(a,o),o},u=(t,e)=>t.appendChild(e),f=(t,e,i)=>t.insertAdjacentElement(i,e),g=(t,e)=>(e||document).querySelector(t),y=(t,e)=>{for(let i in t)e(t[i],i)},k=()=>Math.random().toString(36).substr(2,9),{on:v,off:M}=L.DomEvent,{throttle:w,wrapNum:C}=L.Util,{hasClass:S}=L.DomUtil,x=L.Util.formatNum,b=(t,e)=>e?t<e[0]?e[0]:t>e[1]?e[1]:t:t,D=(t,e,i)=>Math.abs(t-e)>i?e+i*Math.sign(t-e):t;var E=Object.freeze({__proto__:null,Colors:t,formatTime:function(t){let o=Math.floor(t/a),s=Math.floor((t-o*a)/i),n=Math.floor((t-o*a-s*i)/e),r=Math.round((t-o*a-s*i-n*e)/1e3);return 60===r&&(n++,r=0),60===n&&(s++,n=0),24===s&&(o++,s=0),(o?o+"d ":"")+s.toString().padStart(2,0)+":"+n.toString().padStart(2,0)+"'"+r.toString().padStart(2,0)+'"'},formatDate:function(t){return t?"time"==t?t=>new Date(t).toLocaleTimeString():"date"==t?t=>new Date(t).toLocaleDateString():e=>t(e):t=>new Date(t).toLocaleString().replaceAll("/","-").replaceAll(","," ")},saveFile:o,drawCanvas:function(t,e){e.classed("canvas-path",!0),t.beginPath(),t.moveTo(0,0);let i=new Path2D(e.attr("d"));t.strokeStyle=e.attr("stroke"),t.fillStyle=e.attr("fill"),t.lineWidth=1.25,t.globalCompositeOperation="source-over",t.globalAlpha=e.attr("stroke-opacity")||.3,t.stroke(i),t.globalAlpha=e.attr("fill-opacity")||.45,t.fill(i),t.globalAlpha=1,t.closePath()},coordPropsToMeta:s,parseInt:n,parseDate:(t,e)=>new Date(Date.parse("object"==typeof t?t[e]:t)),addClass:r,removeClass:l,toggleClass:h,replaceClass:d,style:c,toggleStyle:(t,e,i,a)=>c(t,e,a?i:""),setAttributes:_,toggleEvent:m,create:p,append:u,insert:f,select:g,each:y,randomId:k,iMax:(t,e)=>(t>e?t:e)||-1/0,iMin:(t,e)=>(t<e?t:e)||1/0,iAvg:(t,e)=>(t+(e||0))/2,iSum:(t,e)=>t+(e||0),on:v,off:M,throttle:w,wrapNum:C,hasClass:S,round:x,clamp:b,wrapDelta:D}),N={autofitBounds:!0,autohide:!1,autohideMarker:!0,almostover:!0,altitude:!0,closeBtn:!0,collapsed:!1,detached:!0,distance:!0,distanceMarkers:{lazy:!0,distance:!0,direction:!0},dragging:!L.Browser.mobile,downloadLink:"link",elevationDiv:"#elevation-div",followMarker:!0,imperial:!1,legend:!0,handlers:[],marker:"elevation-line",markerIcon:L.divIcon({className:"elevation-position-marker",html:'<i class="elevation-position-icon"></i>',iconSize:[32,32],iconAnchor:[16,16]}),position:"topright",polyline:{className:"elevation-polyline",color:"#000",opacity:.75,weight:5,lineCap:"round"},polylineSegments:{className:"elevation-polyline-segments",color:"#F00",interactive:!1},preferCanvas:!1,reverseCoords:!1,ruler:!0,theme:"lightblue-theme",summary:"inline",slope:!1,speed:!1,time:!1,timeFactor:3600,timestamps:!1,trkStart:L.circleMarker([0,0],{className:"start-marker",radius:6,weight:2,color:"#fff",fillColor:"#00d800",fillOpacity:1,interactive:!1}),trkEnd:L.circleMarker([0,0],{className:"end-marker",radius:6,weight:2,color:"#fff",fillColor:"#ff0606",fillOpacity:1,interactive:!1}),waypoints:!0,wptIcons:{"":L.divIcon({className:"elevation-waypoint-marker",html:'<i class="elevation-waypoint-icon default"></i>',iconSize:[30,30],iconAnchor:[8,30]})},wptLabels:!0,xAttr:"dist",xLabel:"km",yAttr:"z",yLabel:"m",zFollow:!1,zooming:!L.Browser.Mobile,margins:{top:30,right:30,bottom:30,left:40},height:.3*screen.height||200,width:.6*screen.width||600,xTicks:void 0,yTicks:void 0,decimalsX:2,decimalsY:0,forceAxisBounds:!1,interpolation:"curveLinear",skipNullZCoords:!1,yAxisMax:void 0,yAxisMin:void 0};const A=L.Control.Elevation=L.Control.extend({includes:L.Evented?L.Evented.prototype:L.Mixin.Events,options:N,__mileFactor:.621371,__footFactor:3.28084,__D3:"https://unpkg.com/d3@6.5.0/dist/d3.min.js",__TOGEOJSON:"https://unpkg.com/@tmcw/togeojson@4.6.0/dist/togeojson.umd.js",__LGEOMUTIL:"https://unpkg.com/leaflet-geometryutil@0.9.3/src/leaflet.geometryutil.js",__LALMOSTOVER:"https://unpkg.com/leaflet-almostover@1.0.1/src/leaflet.almostover.js",__LDISTANCEM:"../libs/leaflet-distance-marker.min.js",__LCHART:"../src/components/chart.js",__LMARKER:"../src/components/marker.js",__LSUMMARY:"../src/components/summary.js",__modulesFolder:"../src/handlers/",addData:function(t,e){this.import(this.__D3).then((()=>{e=e??(t.on&&t),this._addData(t),this._addLayer(e),this._fireEvt("eledata_added",{data:t,layer:e,track_info:this.track_info})}))},addTo:function(t){if(this.options.detached){let e=g(this.options.elevationDiv),i=this.onAdd(t);e?u(e,i):f(t.getContainer(),i,"afterend")}else L.Control.prototype.addTo.call(this,t);return this},clear:function(){this._marker&&this._marker.remove(),this._chart&&this._clearChart(),this._layers&&this._clearLayers(this._layers),this._markers&&this._clearLayers(this._markers),this._circleMarkers&&this._clearLayers(this._circleMarkers),this._data=[],this.track_info={},this._fireEvt("eledata_clear"),this._updateChart()},_clearChart:function(){this._events&&this._events.elechart_updated&&this._events.elechart_updated.forEach((({fn:t,ctx:e})=>this.off("elechart_updated",t,e))),this._chart&&this._chart._container&&(this._chart._container.selectAll("g.point .point").remove(),this._chart.clear())},_clearLayers:function(t){(t=t||this._layers)&&t.eachLayer&&(t.eachLayer((t=>t.remove())),t.clearLayers())},disableBrush:function(){this._chart._brushEnabled=!1,this._resetDrag()},enableBrush:function(){this._chart._brushEnabled=!0},disableZoom:function(){this._chart._zoomEnabled=!1,this._chart._resetZoom()},enableZoom:function(){this._chart._zoomEnabled=!0},fitBounds:function(t){t=t||this.getBounds(),this._map&&t.isValid()&&this._map.fitBounds(t)},getBounds:function(t){return L.latLngBounds((t||this._data).map((t=>t.latlng)))},getZFollow:function(){return this.options.zFollow},hide:function(){c(this._container,"display","none")},initialize:function(e){e=L.setOptions(this,e),this._data=[],this._layers=L.featureGroup(),this._markers=L.featureGroup(),this._circleMarkers=L.featureGroup(),this._markedSegments=L.polyline([]),this._start=e.trkStart||N.trkStart,this._end=e.trkEnd||N.trkEnd,this._chartEnabled=!0,this._yCoordMax=-1/0,this.track_info={},e.followMarker&&(this._setMapView=w(this._setMapView,300,this)),e.legend&&(e.margins.bottom+=30),e.theme&&(e.polylineSegments.className+=" "+e.theme),!0===e.wptIcons&&(e.wptIcons=N.wptIcons),!0===e.distanceMarkers&&(e.distanceMarkers=N.distanceMarkers),e.trkStart&&this._start.addTo(this._circleMarkers),e.trkEnd&&this._end.addTo(this._circleMarkers),this._markedSegments.setStyle(e.polylineSegments),L.extend(t,e.colors||{}),this._fixCanvasPaths(),this._fixTooltipSize()},import:function(t,e){switch(t){case this.__D3:e="object"!=typeof d3;break;case this.__TOGEOJSON:e="object"!=typeof toGeoJSON;break;case this.__LGEOMUTIL:e="object"!=typeof L.GeometryUtil;break;case this.__LALMOSTOVER:e="function"!=typeof L.Handler.AlmostOver;break;case this.__LDISTANCEM:e="function"!=typeof L.DistanceMarkers}return!1!==e?import(t):Promise.resolve()},load:function(t){this._parseFromString(t).then((e=>e?this._loadLayer(e):this._loadFile(t)))},onAdd:function(t){this._map=t;let e=this._container=p("div","elevation-control "+this.options.theme+" "+(this.options.detached?"elevation-detached":"leaflet-control"),this.options.detached?{id:"elevation-"+k()}:{});this.eleDiv||(this.eleDiv=e);let i=["Distance","Time","Altitude","Slope","Speed","Acceleration",...this.options.handlers].filter((t=>!1!==this.options["string"==typeof t&&t.toLowerCase()]));return this._loadModules(i),this._initButton(e),this._initChart(e),this._initSummary(e),this._initMarker(t),this._initLayer(t),e},onRemove:function(t){this._container=null,t.off("zoom viewreset zoomanim",this._hideMarker,this).off("resize",this._resetView,this).off("resize",this._resizeChart,this).off("mousedown",this._resetDrag,this),M(t.getContainer(),"mousewheel",this._resetDrag,this),M(t.getContainer(),"touchstart",this._resetDrag,this),M(document,"keydown",this._onKeyDown,this),this.off("eledata_added eledata_loaded",this._updateChart,this).off("eledata_added eledata_loaded",this._updateSummary,this)},redraw:function(){this._resizeChart()},setZFollow:function(t){this.options.zFollow=t},show:function(){c(this._container,"display","block")},_addData:function(t){if(t){if("FeatureCollection"===t.type)return y(t.features,(t=>this._addData(t)));if("Feature"===t.type){let e=t.geometry;if(e)switch(e.type){case"LineString":return this._addGeoJSONData(e.coordinates,t.properties);case"MultiLineString":return y(e.coordinates,((e,i)=>this._addGeoJSONData(e,t.properties,i)));case"Point":default:return console.warn("Unsopperted GeoJSON feature geometry type:"+e.type)}}return t._latlngs?this._addGeoJSONData(t._latlngs,t.feature&&t.feature.properties):void 0}},_addGeoJSONData:function(t,e,i){let a=e&&e.coordinateProperties||e;t.forEach(((t,e)=>{t.meta=t.meta??{time:null,ele:null},t.prev=t=>t?this._data[e>0?e-1:0][t]:this._data[e>0?e-1:0],this.fire("elepoint_init",{point:t,props:a,id:e,isMulti:i}),this._addPoint(t.lat??t[1],t.lng??t[0],t.alt??t.meta.ele??t[2]),this.fire("elepoint_added",{point:t,index:this._data.length-1}),this._yCoordMax<this._data[this._data.length-1][this.options.yAttr]&&(this._yCoordMax=this._data[this._data.length-1][this.options.yAttr])})),this.fire("eletrack_added",{coords:t,index:this._data.length-1})},_addPoint:function(t,e,i){this.options.reverseCoords&&([t,e]=[e,t]),this._data.push({x:t,y:e,z:i,latlng:L.latLng(t,e,i)}),this.fire("eledata_updated",{index:this._data.length-1})},_addLayer:function(t){return t&&this._layers.addLayer(t),t&&this.options.distanceMarkers&&this.options.distanceMarkers.lazy&&t.on("add remove",(({target:t,type:e})=>L.DistanceMarkers&&t instanceof L.Polyline&&t[e+"DistanceMarkers"]())),t},_addMarker:function(t){return t&&this._markers.addLayer(t),t},_initAlmostOverHandler:function(t,e){t&&this.options.almostOver&&Promise.all([this.import(this.__LGEOMUTIL),this.import(this.__LALMOSTOVER)]).then((()=>{t.addHandler("almostOver",L.Handler.AlmostOver),L.GeometryUtil&&t.almostOver&&t.almostOver.enabled()&&(t.almostOver.addLayer(e),t.on("almost:move",(t=>this._onMouseMoveLayer(t))).on("almost:out",(t=>this._onMouseOut(t))))}))},_initDistanceMarkers:function(t,e){t&&(this.options.distanceMarkers?Promise.all([this.import(this.__LGEOMUTIL),this.import(this.__LDISTANCEM)]).then((()=>this.options.polyline&&e.addTo(t)&&this._circleMarkers.bringToFront())):this.options.polyline&&e.addTo(t))},_initMapIntegrations:function(t,e){let i=t._map;t._data.length&&(t._start.setLatLng(t._data[0].latlng),t._end.setLatLng(t._data[t._data.length-1].latlng)),i?(t._circleMarkers.addTo(i),i.once("layeradd",(i=>t.options.autofitBounds&&t.fitBounds(e.getBounds()))),L.Browser.mobile?t.options.polyline&&e.addTo(i):(t._initAlmostOverHandler(i,e),t._initDistanceMarkers(i,e)),i.invalidateSize()):console.warn("Undefined elevation map object")},_collapse:function(){d(this._container,"elevation-expanded","elevation-collapsed")},_expand:function(){d(this._container,"elevation-collapsed","elevation-expanded")},_fixCanvasPaths:function(){let e=L.Canvas.prototype._fillStroke,i=this,a=this.options.theme.split(" ")[0].replace("-theme",""),o=t[a]||{};L.Canvas.include({_fillStroke:function(t,s){if(i._layers.hasLayer(s)){let i=s.options;if(i.color=o.line||o.area||a,i.stroke=!!i.color,e.call(this,t,s),i.stroke&&0!==i.weight){let e=t.globalCompositeOperation||"source-over";t.globalCompositeOperation="destination-over",t.strokeStyle=o.outline||"#FFF",t.lineWidth=1.75*i.weight,t.stroke(),t.globalCompositeOperation=e}}else e.call(this,t,s)}})},_fixTooltipSize:function(){this.on("elechart_init",(()=>this.once("elechart_change elechart_hover",(({data:t,xCoord:e})=>{this._chartEnabled&&(this._chart._showDiagramIndicator(t,e),this._chart._showDiagramIndicator(t,e)),this._updateMarker(t)}))))},_findItemForLatLng:function(t){return this._data[this._chart._findIndexForLatLng(t)]},_findItemForX:function(t){return this._data[this._chart._findIndexForXCoord(t)]},_fireEvt:function(t,e,i){this.fire&&this.fire(t,e,i),this._map&&this._map.fire(t,e,i)},_hideMarker:function(){this.options.autohideMarker&&this._marker.remove()},_initChart:function(t){let e=this.options;if(e.detached){let{offsetWidth:t,offsetHeight:i}=this.eleDiv;t>0&&(e.width=t),i>20&&(e.height=i-20)}else{let{clientWidth:t}=this._map.getContainer();e._maxWidth=e._maxWidth>e.width?e._maxWidth:e.width,this._container.style.maxWidth=e._maxWidth+"px",e._maxWidth>t&&(e.width=t-30)}Promise.all([this.import(this.__D3),this.import(this.__LCHART)]).then((i=>{let a=this._chart=new(i[1]||A).Chart(e,this);this._x=this._chart._x,this._y=this._chart._y,d3.select(t).call(a.render()),a.on("reset_drag",this._hideMarker,this).on("mouse_enter",this._onMouseEnter,this).on("dragged",this._onDragEnd,this).on("mouse_move",this._onMouseMove,this).on("mouse_out",this._onMouseOut,this).on("ruler_filter",this._onRulerFilter,this).on("zoom",this._updateChart,this).on("elepath_toggle",this._onToggleChart,this).on("margins_updated",this._resizeChart,this),this.fire("elechart_init"),map.on("zoom viewreset zoomanim",this._hideMarker,this).on("resize",this._resetView,this).on("resize",this._resizeChart,this).on("rotate",this._rotateMarker,this).on("mousedown",this._resetDrag,this),v(map.getContainer(),"mousewheel",this._resetDrag,this),v(map.getContainer(),"touchstart",this._resetDrag,this),v(document,"keydown",this._onKeyDown,this),this.on("eledata_added eledata_loaded",this._updateChart,this).on("eledata_added eledata_loaded",this._updateSummary,this),this._updateChart(),this._updateSummary()}))},_initLayer:function(){this._layers.on("layeradd layerremove",(({layer:t,type:e})=>{let i=t.getElement&&t.getElement();h(i,this.options.polyline.className+" "+this.options.theme,"layeradd"==e),m(t,"mousemove",this._onMouseMoveLayer.bind(this),"layeradd"==e),m(t,"mouseout",this._onMouseOut.bind(this),"layeradd"==e)}))},_initMarker:function(t){let e=t.getPane("elevationPane");e||(e=this._pane=t.createPane("elevationPane",t.getPane("norotatePane")||t.getPane("mapPane")),e.style.zIndex=625,e.style.pointerEvents="none"),this._renderer&&this._renderer.remove(),this._renderer=L.svg({pane:"elevationPane"}).addTo(this._map),Promise.all([this.import(this.__D3),this.import(this.__LMARKER)]).then((t=>{this._marker=new(t[1]||A).Marker(this.options,this),this.fire("elechart_marker")}))},_initButton:function(t){if(!L.Browser.mobile&&this.options.detached||L.DomEvent.disableClickPropagation(t).disableScrollPropagation(t),this.options.collapsed?this._collapse():this._expand(),this.options.autohide&&(v(t,"mouseover",this._expand,this),v(t,"mouseout",this._collapse,this),this._map.on("click",this._collapse,this)),this.options.closeBtn){let e=this._button=p("a","elevation-toggle-icon",{href:"#",title:L._("Elevation")},t);v(e,"click",L.DomEvent.stop),v(e,"click",this._toggle,this),v(e,"focus",this._toggle,this)}},_initSummary:function(t){this.import(this.__LSUMMARY).then((e=>{this._summary=new(e||A).Summary({summary:this.options.summary},this),this.on("elechart_init",(()=>{d3.select(t).call(this._summary.render())}))}))},_loadFile:function(t){fetch(t).then((t=>t.text())).then((e=>{this._downloadURL=t,this._parseFromString(e).then((t=>t&&this._loadLayer(t)))})).catch((t=>console.warn(t)))},_loadModules:function(t){t=t.map((t=>"string"==typeof t&&void 0!==A[t]?A[t]:t)),Promise.all(t.filter((t=>"string"==typeof t||t instanceof Promise)).map((t=>t instanceof Promise?t:this.import(this.__modulesFolder+t.toLowerCase()+".js")))).then((e=>{y(e,(e=>{let i=Object.keys(e)[0];i&&void 0===A[i]&&(t[i]=A[i]=e[i])})),y(t,(t=>this._registerHandler(t)))}))},_loadLayer:function(t){let{polyline:e,theme:i,waypoints:a,wptIcons:o,wptLabels:s,distanceMarkers:n}=this.options,r=L.extend({},e);i&&(r.className+=" "+i),t.name&&(this.track_info.name=t.name);let l=L.geoJson(t,{distanceMarkers:n,style:r,pointToLayer:(t,e)=>{if(a){let{desc:i,name:n,sym:r}=t.properties;if(i=i||"",n=n||"",[!0,"dots"].includes(a)&&this._registerCheckPoint({latlng:e,label:[!0,"dots"].includes(s)?n:""}),[!0,"markers"].includes(a)&&0!=o)return this._registerMarker({latlng:e,sym:(r??n).replace(" ","-").replace('"',"").replace("'","").toLowerCase(),content:[!0,"markers"].includes(s)&&(n||i)&&decodeURI("<b>"+n+"</b>"+(i.length>0?"<br>"+i:""))})}},onEachFeature:(t,e)=>t.geometry&&"Point"!=t.geometry.type&&this.addData(t,e)});return this.import(this.__D3).then((()=>{this._initMapIntegrations(this,l),this._fireEvt("eledata_loaded",{data:t,layer:l,name:this.track_info.name,track_info:this.track_info})})),l},_onDragEnd:function({dragstart:t,dragend:e}){this._hideMarker(),this.fitBounds(L.latLngBounds([t.latlng,e.latlng])),this.fire("elechart_dragged")},_onKeyDown:function({key:t}){this.options.detached||"Escape"!==t||this._collapse()},_onMouseEnter:function(){this.fire("elechart_enter")},_onMouseMove:function({xCoord:t}){if(this._chartEnabled&&this._data.length){let e=this._findItemForX(t);e&&(this._chartEnabled&&this._chart._showDiagramIndicator(e,t),this._updateMarker(e),this._setMapView(e),this._map&&r(this._map.getContainer(),"elechart-hover"),this.fire("elechart_change",{data:e,xCoord:t}),this.fire("elechart_hover",{data:e,xCoord:t}))}},_onMouseMoveLayer:function({latlng:t}){if(this._data.length){let e=this._findItemForLatLng(t);if(e){let t=e.xDiagCoord;this._chartEnabled&&this._chart._showDiagramIndicator(e,t),this._updateMarker(e),this.fire("elechart_change",{data:e,xCoord:t})}}},_onMouseOut:function(){this.options.detached||(this._hideMarker(),this._chart._hideDiagramIndicator()),this._map&&l(this._map.getContainer(),"elechart-hover"),this.fire("elechart_leave")},_onRulerFilter:function({coords:t}){this._updateMapSegments(t)},_onToggleChart:function({name:t,enabled:e}){this._chartEnabled=this._chart._hasActiveLayers(),this._layers.eachLayer((t=>h(t.getElement&&t.getElement(),this.options.polyline.className+" "+this.options.theme,this._chartEnabled))),this.options[t]=e||"disabled"!=this.options[t]?"disabled":"enabled",this._chartEnabled||(this._chart._hideDiagramIndicator(),this._marker.remove())},_parseFromGeoJSONString:function(t){try{return JSON.parse(t)}catch(t){}},_parseFromString:function(t){return new Promise((e=>this.import(this.__TOGEOJSON).then((()=>{let i;try{i=this._parseFromXMLString(t.trim())}catch(e){i=this._parseFromGeoJSONString(t.toString())}i&&(i.name=i.name||(this._downloadURL||"").split("/").pop().split("#")[0].split("?")[0]),e(i)}))))},_parseFromXMLString:function(t){if(0!=t.indexOf("<"))throw"Invalid XML";let e=(new DOMParser).parseFromString(t,"text/xml"),i=e.documentElement.tagName.toLowerCase(),a=e.getElementsByTagName("name");if(e.getElementsByTagName("parsererror").length)throw"Invalid XML";i in toGeoJSON||(i="TrainingCenterDatabase"==e.documentElement.tagName?"tcx":"gpx");let o=toGeoJSON[i](e);return o.name=a.length>0?(Array.from(a).find((t=>"trk"==t.parentElement.tagName))??a[0]).textContent:"",o},_registerAreaPath:function(t){this.on("elechart_init",(()=>this._chart._registerAreaPath(t)))},_registerAxisGrid:function(t){this.on("elechart_axis",(()=>this._chart._registerAxisGrid(t)))},_registerAxisScale:function(t){this.on("elechart_axis",(()=>this._chart._registerAxisScale(t)))},_registerCheckPoint:function(t){this.on("elechart_updated",(()=>this._chart._registerCheckPoint(t)))},_registerDataAttribute:function(t){let e,i,a,o;t.coordPropsToMeta&&this.on("elepoint_init",(e=>t.coordPropsToMeta.call(this,e)));let s=null;this.on("elepoint_added",(({index:n,point:r})=>{if(e=n,a=i??this._data[e],i=this._data[e],o=t.attr||t.name,!1===t.skipNull){let t=this._data[e][o];if(e>0){let i=this._data[e-1][o];if(isNaN(i)){if(isNaN(s)||isNaN(t)?isNaN(s)?isNaN(t)||(i=t):i=s:i=(s+t)/2,!isNaN(i))return this._data.splice(e-1,1);this._data[e-1][o]=i}}isNaN(t)||(s=t)}if(i[o]=t.pointToAttr.call(this,r,e),t.stats)for(const e in t.stats){let a=(t.statsName||o)+(""!=e?"_":"");this.track_info[a+e]=t.stats[e].call(this,i[o],this.track_info[a+e])}t.deltaMax&&(i[o]=D(i[o],a[o],t.deltaMax)),t.clampRange&&(i[o]=b(i[o],t.clampRange)),isNaN(t.decimals)||(i[o]=x(i[o],t.decimals)),t.onPointAdded&&t.onPointAdded.call(this,i[o],e,r)}))},_registerHandler:function(t){if("function"==typeof t)return this._registerHandler(t.call(this));let{name:e,attr:i,required:a,skipNull:o,deltaMax:n,clampRange:r,decimals:l,meta:h,unit:d,coordinateProperties:c,coordPropsToMeta:_,pointToAttr:m,onPointAdded:p,stats:u,statsName:f,grid:g,scale:k,path:v,tooltip:M,summary:w}=t;(this.options[e]||a)&&(this._registerDataAttribute({name:e,attr:i,skipNull:o,deltaMax:n,clampRange:r,decimals:l,coordPropsToMeta:s(c,h||e,_),pointToAttr:m,onPointAdded:p,stats:u,statsName:f}),g&&this._registerAxisGrid(L.extend({name:e},g)),"summary"!==this.options[e]&&(k&&this._registerAxisScale(L.extend({name:e,label:d},k)),v&&this._registerAreaPath(L.extend({name:e},v))),(M||t.tooltips)&&y([M,...t.tooltips||[]],(t=>t&&this._registerTooltip(L.extend({name:e},t)))),w&&(y(w,((t,e)=>w[e]=L.extend({unit:d},t))),this._registerSummary(w)))},_registerMarker({latlng:t,sym:e,content:i}){let{wptIcons:a}=this.options;a.hasOwnProperty(e)||(a[e]=L.divIcon(L.extend({},a[""].options,{html:'<i class="elevation-waypoint-icon '+e+'"></i>'})));let o=L.marker(t,{icon:a[e]});return i&&(o.bindPopup(i,{className:"elevation-popup",keepInView:!0}).openPopup(),o.bindTooltip(i,{className:"elevation-tooltip",direction:"auto",sticky:!0,opacity:1}).openTooltip()),this._addMarker(o)},_registerTooltip:function(t){t.chart&&this.on("elechart_init",(()=>this._chart._registerTooltip(L.extend({},t,{value:t.chart})))),t.marker&&this.on("elechart_marker",(()=>this._marker._registerTooltip(L.extend({},t,{value:t.marker}))))},_registerSummary:function(t){this.on("elechart_summary",(()=>this._summary._registerSummary(t)))},_resetDrag:function(){this._chart._resetDrag(),this._hideMarker()},_resetView:function(){this._map&&this._map._isFullscreen||(this._resetDrag(),this._hideMarker(),this.options.autofitBounds&&this.fitBounds())},_resizeChart:function(){if(this._container&&"none"!=c(this._container,"display")){let t=this.options,e=t.detached?(this.eleDiv||this._container).offsetWidth:b(t._maxWidth,[0,this._map.getContainer().clientWidth-30]);e&&(t.width=e,this._chart&&this._chart._chart&&(this._chart._chart._resize(t),this._updateChart())),this._updateMapSegments()}},_toggle:function(){S(this._container,"elevation-expanded")?this._collapse():this._expand()},_setMapView:function(t){if(this._map&&this.options.followMarker){let e=this._map.getZoom(),i=this.options.zFollow;"number"==typeof i?this._map.setView(t.latlng,e<i?i:e,{animate:!0,duration:.25}):this._map.getBounds().contains(t.latlng)||this._map.setView(t.latlng,e,{animate:!0,duration:.25})}},_updateChart:function(){this._chart&&this._container&&(this.fire("elechart_axis"),this._chart.update({data:this._data,options:this.options}),this._x=this._chart._x,this._y=this._chart._y,this.fire("elechart_updated"))},_updateMarker:function(t){this._marker&&this._marker.update({map:this._map,item:t,yCoordMax:this._yCoordMax||0,options:this.options})},_rotateMarker:function(){this._marker&&this._marker.update()},_updateMapSegments:function(t){this._markedSegments.setLatLngs(t||[]),t&&this._map&&!this._map.hasLayer(this._markedSegments)&&this._markedSegments.addTo(this._map)},_updateSummary:function(){this._summary&&(this._summary.reset(),this.options.summary&&(this.fire("elechart_summary"),this._summary.update()),this.options.downloadLink&&this._downloadURL&&(this._summary._container.innerHTML+='<span class="download"><a href="#">'+L._("Download")+"</a></span>",g(".download a",this._summary._container).onclick=t=>{t.preventDefault();let e={downloadLink:this.options.downloadLink,confirm:o.bind(this,this._downloadURL)};"modal"==this.options.downloadLink&&"function"==typeof CustomEvent?document.dispatchEvent(new CustomEvent("eletrack_download",{detail:e})):"link"!=this.options.downloadLink&&!0!==this.options.downloadLink||e.confirm(),this.fire("eletrack_download",e)}))},_width:function(){if(this._chart)return this._chart._width();const{width:t,margins:e}=this.options;return t-e.left-e.right},_height:function(){if(this._chart)return this._chart._height();const{height:t,margins:e}=this.options;return t-e.top-e.bottom}});A.Utils=E,function(){let t=L.i18n.bind({});L.i18n=L._=(e,i)=>(L.locale&&L.locales[L.locale]&&""==L.locales[L.locale][e]&&(L.locales[L.locale][e]=""),t.call(null,e,i))}(),L.control.elevation=t=>new A(t)}));
|
|
2
2
|
//# sourceMappingURL=leaflet-elevation.min.js.map
|
|
@@ -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\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__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/**\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._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},\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},\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 = ({preventDefault}) => {\n\t\t\t\t\tpreventDefault();\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","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","__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","_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","_renderer","svg","Marker","disableClickPropagation","disableScrollPropagation","link","_button","title","stop","_toggle","_summary","Summary","url","fetch","response","text","_downloadURL","catch","file","exported","Object","keys","_registerHandler","geoJson","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","parentElement","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,EAAEQ,KAAOR,EAAES,EAAI,SAAmBC,EAAQC,GACzCX,EAAEE,QAAUF,EAAEC,QAAQD,EAAEE,SAAWF,EAAEC,QAAQD,EA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Q,KAC1DV,EAAEC,QAAQD,EAAEE,QAAQQ,GAAU,KAExBmjB,EAAMrgB,KAAK,KAAM9C,EAAQC,IANlC,GAUAX,EAAEiZ,QAAQ6K,UAAa/U,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\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__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/**\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._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},\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},\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","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","__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","_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","_renderer","svg","Marker","disableClickPropagation","disableScrollPropagation","link","_button","title","stop","_toggle","_summary","Summary","url","fetch","response","text","_downloadURL","catch","file","exported","Object","keys","_registerHandler","geoJson","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","parentElement","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,EAAEQ,KAAOR,EAAES,EAAI,SAAmBC,EAAQC,GACzCX,EAAEE,QAAUF,EAAEC,QAAQD,EAAEE,SAAWF,EAAEC,QAAQD,EAAEE,QAAQQ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EC,QAAQD,EAAEE,QAAQQ,GAAU,KAExBmjB,EAAMrgB,KAAK,KAAM9C,EAAQC,IANlC,GAUAX,EAAEiZ,QAAQ6K,UAAa/U,GAAY,IAAIP,EAAUO"}
|
package/package.json
CHANGED
package/src/control.js
CHANGED
|
@@ -1240,8 +1240,8 @@ export const Elevation = L.Control.Elevation = L.Control.extend({
|
|
|
1240
1240
|
}
|
|
1241
1241
|
if (this.options.downloadLink && this._downloadURL) { // TODO: generate dynamically file content instead of using static file urls.
|
|
1242
1242
|
this._summary._container.innerHTML += '<span class="download"><a href="#">' + L._('Download') + '</a></span>'
|
|
1243
|
-
_.select('.download a', this._summary._container).onclick = (
|
|
1244
|
-
preventDefault();
|
|
1243
|
+
_.select('.download a', this._summary._container).onclick = (e) => {
|
|
1244
|
+
e.preventDefault();
|
|
1245
1245
|
let event = { downloadLink: this.options.downloadLink, confirm: _.saveFile.bind(this, this._downloadURL) };
|
|
1246
1246
|
if (this.options.downloadLink == 'modal' && typeof CustomEvent === "function") {
|
|
1247
1247
|
document.dispatchEvent(new CustomEvent("eletrack_download", { detail: event }));
|