diff --git a/css/stylesheet.css b/css/stylesheet.css index bc5d372..3c1974c 100644 --- a/css/stylesheet.css +++ b/css/stylesheet.css @@ -184,7 +184,7 @@ background-color: #F6F1EC; vertical-align: middle; padding-right: 1rem; - color: grey; + color: black; a { margin: 2em; diff --git a/index.html b/index.html index 3e7f8fe..686430b 100644 --- a/index.html +++ b/index.html @@ -25,7 +25,6 @@
-
diff --git a/js/gpx.js b/js/gpx.js index 43359df..e797ef1 100644 --- a/js/gpx.js +++ b/js/gpx.js @@ -9,6 +9,8 @@ var map = L.map('map') L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { + minZoom: 6, // avoid zooming outside track range, roughly, to prevent extra tile requests + maxZoom: 15, attribution: 'Map data © OpenStreetMap' }).addTo(map) @@ -52,7 +54,16 @@ /* create side information */ t.onclick = function() { map.fitBounds(bounds) - var bt = document.getElementById('bottomtext') + + // clear previous descriptions + var oldDesc = document.getElementById("bottomtext") + if(oldDesc) { + document.body.removeChild(oldDesc) + } + + var description = document.createElement('div') + description.className = "bottomtext" + description.id = "bottomtext" /* download button */ const button = document.createElement('button') @@ -78,9 +89,11 @@ Avg speed: ${track.totalAvgSpeed.toFixed(2)} km/h
Avg moving speed: ${track.movingSpeed.toFixed(2)} km/h

` - bt.replaceChildren(txt) - bt.appendChild(button) - bt.appendChild(cb) + description.appendChild(txt) + description.appendChild(button) + description.appendChild(cb) + + document.body.appendChild(description) } tracklist.appendChild(t) })