diff --git a/index.html b/index.html index 1e92fa6..018e7a7 100644 --- a/index.html +++ b/index.html @@ -113,6 +113,12 @@ + + + + + + diff --git a/index.js b/index.js index 47c2c7e..d962362 100644 --- a/index.js +++ b/index.js @@ -621,6 +621,7 @@ function drawMarkers(){ markerImg.classList.add('fixedScale', 'sign'); // Grade signs if(markerData.type == 'grade'){ + markerImg.classList.add('gradeArrow'); markerImg.setAttribute('href', '#gradeArrow'); markerImg.setAttribute('fill', Config.gradeColors['grade_'+markerData.gradeClass]); const tanLen = Math.sqrt(markerData.tangent.x*markerData.tangent.x + markerData.tangent.z*markerData.tangent.z) * Math.sign(markerData.tangent.y); diff --git a/legend.js b/legend.js index 5f1cb08..24862b3 100644 --- a/legend.js +++ b/legend.js @@ -75,6 +75,21 @@ let settingEntries = [ }, ] }, + { + label: 'Grade Arrow Direction', + id: 'dropdown_gradeArrowDirection', + options: [ + 'Uphill', + 'Downhill', + ], + default: 'Uphill', + func: state =>{ + let newHref = state == 'Uphill' ? '#gradeArrow' : '#gradeArrowDownhill'; + for(let arrow of document.getElementsByClassName('gradeArrow')){ + arrow.setAttribute('href', newHref); + } + } + }, ]; const legendKey = document.getElementById('legendKey'); @@ -194,7 +209,6 @@ async function setLastUpdateData(){ } function populateKey(){ - addKeyEntry(null, '(Grade arrows point uphill)'); const getGradeValue = gradeIndex => {return Math.round(Utils.gradeIncrements[Utils.gradeIncrements.length-gradeIndex-1]*10000)/100}; for(let i=-1; i', ' Landmark'); addKeyEntry('', ' Garage'); //Add empty entries to make entries align right in the columns. - for(let i=0; i<4; i++){ + for(let i=0; i<3; i++){ addKeyEntry(); } }