+ if (!osmJson.hasOwnProperty('elements')) return;
+
+ for (const elevator of elevatorNodes) {
+ const tagContainer = elevator.querySelector('.osmTags');
+ const nodeId = elevator.querySelector('.osm').dataset.nodeid;
+
+ const nodes = osmJson.elements.filter(node => node.id === parseInt(nodeId))
+ if (!nodes.length) {
+ tagContainer.innerHTML = 'keine Daten';
+ continue;
+ }
+ const nodeInfo = nodes[0];
+
+ if (!nodeInfo.hasOwnProperty('tags')) {
+ tagContainer.innerHTML = 'keine Daten';
+ continue;
+ }
+ const tags = nodeInfo['tags'];
+
+ if (tags['highway'] === 'elevator') {
+ let osmTemplate = '';
+ osmTemplate += ``;
- if (tags.hasOwnProperty('description')) {
- osmTemplate += `Beschreibung${tags['description']}`;
- }
- if (tags.hasOwnProperty('level')) {
- osmTemplate += `Ebenen${tags['level'].split(';').sort().join(', ')}`;
- }
- if (tags.hasOwnProperty('wheelchair')) {
- osmTemplate += `Rollstühle${tags['wheelchair'] === 'yes' ? 'Ja' : 'Nein'}`;
- }
- if (tags.hasOwnProperty('bicycle')) {
- osmTemplate += `Fahrräder${tags['bicycle'] === 'yes' ? 'Ja' : 'Nein'}`;
- }
- osmContainer.innerHTML = ''; // clear loading state
- osmContainer.insertAdjacentHTML('beforeend', osmTemplate);
+ if (tags.hasOwnProperty('description')) {
+ osmTemplate += `Beschreibung${tags['description']}`;
}
-
+ if (tags.hasOwnProperty('level')) {
+ osmTemplate += `Ebenen${tags['level'].split(';').sort().join(', ')}`;
+ }
+ if (tags.hasOwnProperty('wheelchair')) {
+ osmTemplate += `Rollstühle${tags['wheelchair'] === 'yes' ? 'Ja' : 'Nein'}`;
+ }
+ if (tags.hasOwnProperty('bicycle')) {
+ osmTemplate += `Fahrräder${tags['bicycle'] === 'yes' ? 'Ja' : 'Nein'}`;
+ }
+ tagContainer.innerHTML = ''; // clear loading state
+ tagContainer.insertAdjacentHTML('beforeend', osmTemplate);
}
}
}
@@ -174,6 +189,9 @@ function renderData() {
dateContainer.innerHTML = dateTimeStyle.format(date);
let stationIndex = 0;
+
+ //clear list before update
+ listContainer.innerHTML = '';
for (const station of stations) {
const stationName = station.mainSubStation.stationName;
const lines = new Set();
@@ -345,6 +363,11 @@ document.querySelector('#loadElevators')
loadElevators().then(() => renderData());
})
+document.querySelector('#loadOSM')
+ .addEventListener('click', (e) => {
+ loadOsmData();
+ })
+
renderData();
diff --git a/index.html b/index.html
index 5df658a..183742c 100644
--- a/index.html
+++ b/index.html
@@ -29,6 +29,7 @@
Last Updated:
+
diff --git a/style.css b/style.css
index e308c41..25e49c9 100644
--- a/style.css
+++ b/style.css
@@ -133,7 +133,7 @@ button, input {
button {
cursor: pointer;
- display: flex;
+ display: inline-flex;
align-items: center;
gap: var(--space-m);
}
diff --git a/style.scss b/style.scss
index aa5694a..a731775 100644
--- a/style.scss
+++ b/style.scss
@@ -150,7 +150,7 @@ button, input {
button {
cursor: pointer;
- display: flex;
+ display: inline-flex;
align-items: center;
gap: var(--space-m);