From 6fb5ecb7b7bb36e0344d07975783c5a91a2a8ab5 Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Mon, 29 Jul 2024 20:31:40 +0200 Subject: [PATCH] render more properties, add TODOs --- martin/configuration.yml | 1 + proxy/js/ui.js | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/martin/configuration.yml b/martin/configuration.yml index 3d7e2537..8ec5ec49 100644 --- a/martin/configuration.yml +++ b/martin/configuration.yml @@ -146,6 +146,7 @@ postgres: properties: railway: string ref: string + # TODO: rename local_operated railway_local_operated: boolean # --- Speed --- # diff --git a/proxy/js/ui.js b/proxy/js/ui.js index 8536146b..6e4aecf3 100644 --- a/proxy/js/ui.js +++ b/proxy/js/ui.js @@ -580,10 +580,16 @@ const onStylesheetChange = styleSheet => { } function popupContent(properties) { + // TODO move icon SVGs to proxy + // TODO reuse icons from map features for these features + // TODO lookup train protection name + // TODO format voltage + // TODO format gauge(s) + const label = properties.label ?? properties.name ?? properties.ref; return `
${properties.icon ? `${properties.icon}` : ''} - ${properties.label ? `${properties.osm_id ? `` : ''}${properties.label}${properties.osm_id ? `` : ''}` : ''} + ${label ? `${properties.osm_id ? `` : ''}${label}${properties.osm_id ? `` : ''}` : ''} ${properties.osm_id ? `${icons.edit}` : ''}
@@ -591,8 +597,26 @@ function popupContent(properties) { ${properties.ref ? `reference: ${properties.ref}` : ''} ${properties.uic_ref ? `UIC reference: ${properties.uic_ref}` : ''} ${properties.position ? `position: ${properties.position}` : ''} + ${properties.pos ? `position: ${properties.pos}` : ''} ${properties.operator ? `operator: ${properties.operator}` : ''} ${properties.track_ref ? `track: ${properties.track_ref}` : ''} + ${properties.highspeed === true ? `high speed` : ''} + ${properties.usage ? `usage: ${properties.usage}` : ''} + ${properties.service ? `service: ${properties.service}` : ''} + ${properties.tunnel === true ? `tunnel` : ''} + ${properties.bridge === true ? `bridge` : ''} + ${properties.railway_local_operated === true ? `operated locally` : ''} + ${properties.maxspeed ? `maximum speed: ${properties.maxspeed} km/h` : ''} + ${properties.direction_both ? `both directions` : ''} + ${properties.train_protection ? `train protection: ${properties.train_protection}` : ''} + ${properties.deactivated === true ? `deactivated` : ''} + ${properties.type === 'line' ? `line signal` : ''} + ${properties.electrification_state ? `line electrification: ${properties.electrification_state}` : ''} + ${properties.voltage ? `voltage: ${properties.voltage} V` : ''} + ${properties.frequency ? `frequency: ${properties.frequency} Hz` : ''} + ${properties.gauge0 ? `gauge: ${properties.gauge0}` : ''} + ${properties.gauge1 ? `gauge: ${properties.gauge1}` : ''} + ${properties.gauge2 ? `gauge: ${properties.gauge2}` : ''}
`; }