diff options
| author | Dennis Fink | 2026-07-23 00:18:21 +0200 |
|---|---|---|
| committer | Dennis Fink | 2026-07-23 00:18:21 +0200 |
| commit | 1fe1d13c600b7dfe421b3b99b833b7d5d1232724 (patch) | |
| tree | 2e8636160cc1719c907be56f5ef8cbc7e0f10a53 /assets/static/vendor/leaflet-elevation/src/options.js | |
| parent | ca77de06be474dfd712402c327dc436864d233a3 (diff) | |
| download | dennisfink.me-1fe1d13c600b7dfe421b3b99b833b7d5d1232724.tar.gz dennisfink.me-1fe1d13c600b7dfe421b3b99b833b7d5d1232724.zip | |
Add GPX trail maps to blog posts
This adds a trail flow block so posts can include attached GPX files as
interactive maps with route display, elevation charts, activity
summaries, and start/finish markers.
The trail assets are loaded only when needed, keeping the shared
templates clean while vendoring the Leaflet dependencies required for
offline, self-hosted map rendering.
Diffstat (limited to '')
| -rw-r--r-- | assets/static/vendor/leaflet-elevation/src/options.js | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/assets/static/vendor/leaflet-elevation/src/options.js b/assets/static/vendor/leaflet-elevation/src/options.js new file mode 100644 index 0000000..5923163 --- /dev/null +++ b/assets/static/vendor/leaflet-elevation/src/options.js @@ -0,0 +1,88 @@ +import * as _ from './utils'; + +export var Options = { + autofitBounds: true, + autohide: false, + autohideMarker: true, + almostover: true, + altitude: true, + closeBtn: true, + collapsed: false, + detached: true, + distance: true, + distanceMarkers: { lazy: true, distance: true, direction: true }, + dragging: !L.Browser.mobile, + downloadLink: 'link', + elevationDiv: "#elevation-div", + edgeScale: { bar: true, icon: false, coords: false }, + followMarker: true, + imperial: false, + legend: true, + handlers: ["Distance", "Time", "Altitude", "Slope", "Speed", "Acceleration"], + hotline: 'elevation', + 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: 0.75, + weight: 5, + lineCap: 'round' + }, + polylineSegments: { + className: 'elevation-polyline-segments', + color: '#F00', + interactive: false, + }, + preferCanvas: false, + reverseCoords: false, + ruler: true, + theme: "lightblue-theme", + summary: 'inline', + slope: false, + speed: false, + time: true, + timeFactor: 3600, + timestamps: false, + trkStart: { className: 'start-marker', radius: 6, weight: 2, color: '#fff', fillColor: '#00d800', fillOpacity: 1, interactive: false }, + trkEnd: { className: 'end-marker', radius: 6, weight: 2, color: '#fff', fillColor: '#ff0606', fillOpacity: 1, interactive: false }, + waypoints: true, + wptIcons: { + '': L.divIcon({ + className: 'elevation-waypoint-marker', + html: '<i class="elevation-waypoint-icon default"></i>', + iconSize: [30, 30], + iconAnchor: [8, 30], + }), + }, + wptLabels: true, + xAttr: "dist", + xLabel: "km", + yAttr: "z", + yLabel: "m", + zFollow: false, + zooming: !L.Browser.Mobile, + + // Quite uncommon and undocumented options + margins: { top: 30, right: 30, bottom: 30, left: 40 }, + height: (screen.height * 0.3) || 200, + width: (screen.width * 0.6) || 600, + xTicks: undefined, + yTicks: undefined, + + decimalsX: 2, + decimalsY: 0, + forceAxisBounds: false, + interpolation: "curveLinear", + yAxisMax: undefined, + yAxisMin: undefined, + + // Prevent CORS issues for relative locations (dynamic import) + srcFolder: ((document.currentScript && document.currentScript.src) || (import.meta && import.meta.url)).split("/").slice(0,-1).join("/") + '/', +}; |
