Commit 8ceb57bd authored by Clouard Regis's avatar Clouard Regis
Browse files

Revised course dispolay.

parent 2314d53c
......@@ -9,7 +9,7 @@ function addTrack(event, map, track) {
},
polyline_options: {
color: color,
weight: 8,
weight: 6,
lineCap: 'round'
}
});
......
......@@ -735,17 +735,23 @@ function addColorLegend(map) {
legend = L.control({position: 'bottomleft'});
legend.onAdd = function (map) {
var div = L.DomUtil.create('div', 'info legend');
let speeds = ['≤ 30 min/km (jardinage)', '≤ 10 min/km (marche)', '≤ 6 min/km (mixte)', '≤ 4.61 min/km (course)', '> 4.61 min/km (vitesse)'],
let speeds = ['30', '10', '6', '4.5', '>  '],
colors = ['red', 'orange', 'yellow', 'greenyellow', 'green'];
div.style.backgroundColor = "white";
div.style.lineHeight = "18px";
div.style.color = "#555";
div.style.padding = "5px";
div.style.borderRadius = "5px";
let legendText ="<table><tbody><tr>";
for (let i = 0; i < speeds.length; i++) {
legendText += '<td style="text-align: right">' + speeds[i] + '</td>';
}
legendText += "<td>min/km</td></tr><tr>";
for (let i = 0; i < speeds.length; i++) {
div.innerHTML += '<p style="margin: 0.1em"><i style="width: 18px; height: 18px; float: left; margin-right: 8px; opacity:0.7; background:' + colors[i] + '"></i> ' + speeds[i] + '</p>';
legendText += '<td><i style="width: 25px; height: 18px; float: left; align-self: center; opacity:0.7; background:' + colors[i] + '"></i></td>';
}
legendText += "</td></tr></table>";
div.innerHTML =legendText;
return div;
};
legend.addTo(map);
......
......@@ -185,7 +185,7 @@
<div class="tab">
<button class="tablinks" onclick="openTab('tab1', 'MapTab')" id="tab1">Carte</button>
<button class="tablinks" onclick="openTab('tab2', 'TimesTab')" id="tab2">Temps</button>
<button class="tablinks" onclick="openTab('tab3', 'FilesTab')" id="tab3">Téléchargement</button>
<button class="tablinks" onclick="openTab('tab3', 'FilesTab')" id="tab3">Fichiers</button>
</div>
<!-- Tab content -->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment