Skip to content

Commit

Permalink
toilets
Browse files Browse the repository at this point in the history
  • Loading branch information
strukturart committed Aug 29, 2024
1 parent 553592c commit ca35171
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 52 deletions.
26 changes: 0 additions & 26 deletions application/assets/js/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,32 +761,6 @@ const module = (() => {
function calculateGainAndLoss(altitudes) {
let gain = 0;
let loss = 0;
/*
let previousValidAltitude = null;
for (let i = 0; i < altitudes.length; i++) {
const currentAltitude = altitudes[i];
// Skip null or inaccurate altitude values
if (currentAltitude === null || isNaN(currentAltitude)) {
continue;
}
if (previousValidAltitude !== null) {
const altitudeDifference = currentAltitude - previousValidAltitude;
if (Math.abs(altitudeDifference) <= threshold) {
if (altitudeDifference > 0) {
gain += altitudeDifference;
} else {
loss += Math.abs(altitudeDifference);
}
}
}
previousValidAltitude = currentAltitude;
}
*/

const highestAltitude = Math.max(...altitudes);
const lowestAltitude = Math.min(...altitudes);
Expand Down
7 changes: 7 additions & 0 deletions application/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,13 @@ document.addEventListener("DOMContentLoaded", function () {
'<div class="item" data-type="overpass" data-url="amenity=bar">Bar</div>'
);

document
.querySelector("div#overpass")
.insertAdjacentHTML(
"afterend",
'<div class="item" data-type="overpass" data-url="amenity=toilets">Toilets</div>'
);

document
.querySelector("div#overpass")
.insertAdjacentHTML(
Expand Down
26 changes: 0 additions & 26 deletions docs/assets/js/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,32 +761,6 @@ const module = (() => {
function calculateGainAndLoss(altitudes) {
let gain = 0;
let loss = 0;
/*
let previousValidAltitude = null;
for (let i = 0; i < altitudes.length; i++) {
const currentAltitude = altitudes[i];
// Skip null or inaccurate altitude values
if (currentAltitude === null || isNaN(currentAltitude)) {
continue;
}
if (previousValidAltitude !== null) {
const altitudeDifference = currentAltitude - previousValidAltitude;
if (Math.abs(altitudeDifference) <= threshold) {
if (altitudeDifference > 0) {
gain += altitudeDifference;
} else {
loss += Math.abs(altitudeDifference);
}
}
}
previousValidAltitude = currentAltitude;
}
*/

const highestAltitude = Math.max(...altitudes);
const lowestAltitude = Math.min(...altitudes);
Expand Down
7 changes: 7 additions & 0 deletions docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,13 @@ document.addEventListener("DOMContentLoaded", function () {
'<div class="item" data-type="overpass" data-url="amenity=bar">Bar</div>'
);

document
.querySelector("div#overpass")
.insertAdjacentHTML(
"afterend",
'<div class="item" data-type="wc" data-url="amenity=toilets">Toilets</div>'
);

document
.querySelector("div#overpass")
.insertAdjacentHTML(
Expand Down

0 comments on commit ca35171

Please sign in to comment.