From 205e3fe1ad8cb8c8079b38277199a71727d9b49d Mon Sep 17 00:00:00 2001 From: Chris Dickinson Date: Thu, 11 Dec 2025 16:49:50 +0100 Subject: [PATCH 1/3] feat(journey-maps): support new field name 'didokCode' in addition to 'sbb_id' refs: ROKAS-2565 --- .../services/map/map-station-service.ts | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/journey-maps/angular/services/map/map-station-service.ts b/src/journey-maps/angular/services/map/map-station-service.ts index 982deb6091..cb4f59d440 100644 --- a/src/journey-maps/angular/services/map/map-station-service.ts +++ b/src/journey-maps/angular/services/map/map-station-service.ts @@ -17,6 +17,7 @@ const MAP_ENDPOINT_LAYERS_V1 = ['rokas-walk-from', 'rokas-walk-to']; const MAP_ENDPOINT_LAYERS_V2 = ['rokas-route-transfer-ending', 'rokas-route-stopover-circle']; const MAP_SOURCE_LAYER_OSM_POINTS = 'osm_points'; const FEATURE_SBB_ID_FIELD_NAME = 'sbb_id'; +const FEATURE_DIDOK_CODE_FIELD_NAME = 'didokCode'; @Injectable({ providedIn: 'root' }) export class SbbMapStationService { @@ -62,7 +63,9 @@ export class SbbMapStationService { layers: isV1Style(map) ? MAP_ENDPOINT_LAYERS_V1 : MAP_ENDPOINT_LAYERS_V2, }) .filter((f) => { - return FEATURE_SBB_ID_FIELD_NAME in f.properties; + return ( + FEATURE_SBB_ID_FIELD_NAME in f.properties || FEATURE_DIDOK_CODE_FIELD_NAME in f.properties + ); }) .map(this._mapToFeature); @@ -71,23 +74,26 @@ export class SbbMapStationService { } return endpoints - .map( - (p) => - map - .querySourceFeatures('base', { - sourceLayer: MAP_SOURCE_LAYER_OSM_POINTS, - filter: [ - 'in', - FEATURE_SBB_ID_FIELD_NAME, - String(p.properties[FEATURE_SBB_ID_FIELD_NAME]), - ], - }) - .map((sourceFeature) => ({ - ...this._mapToFeature(sourceFeature), - geometry: p.geometry, // get endpoint location not the tile source - })) - .pop(), // There might be multiple stations in the tile source - ) + .map((p) => { + // Get the ID value from either sbb_id or didokCode field + const idValue = + p.properties[FEATURE_SBB_ID_FIELD_NAME] || p.properties[FEATURE_DIDOK_CODE_FIELD_NAME]; + + return map + .querySourceFeatures('base', { + sourceLayer: MAP_SOURCE_LAYER_OSM_POINTS, + filter: [ + 'any', + ['in', FEATURE_SBB_ID_FIELD_NAME, String(idValue)], + ['in', FEATURE_DIDOK_CODE_FIELD_NAME, String(idValue)], + ], + }) + .map((sourceFeature) => ({ + ...this._mapToFeature(sourceFeature), + geometry: p.geometry, // get endpoint location not the tile source + })) + .pop(); // There might be multiple stations in the tile source + }) .filter((s) => s!!) as Feature[]; } From 91725258d62415bf7cb30999fe7bcb69829f1f77 Mon Sep 17 00:00:00 2001 From: Chris Dickinson Date: Thu, 11 Dec 2025 16:59:09 +0100 Subject: [PATCH 2/3] feat(journey-maps): support new field name 'didokCode' in addition to 'sbb_id' refs: ROKAS-2565 --- .../journey-maps-feature-types-example.html | 4 +++- .../journey-maps/angular/shared/routes/biel-lyss.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components-examples/journey-maps/angular/journey-maps-feature-types/journey-maps-feature-types-example.html b/src/components-examples/journey-maps/angular/journey-maps-feature-types/journey-maps-feature-types-example.html index 93f628be9a..ae66cbf19b 100644 --- a/src/components-examples/journey-maps/angular/journey-maps-feature-types/journey-maps-feature-types-example.html +++ b/src/components-examples/journey-maps/angular/journey-maps-feature-types/journey-maps-feature-types-example.html @@ -27,7 +27,9 @@
{{ station.properties.name }}
-
{{ station.properties.sbb_id }}
+
+ {{ station.properties.sbb_id || station.properties.didokCode }} +
{{ route.properties.routeId }}
diff --git a/src/components-examples/journey-maps/angular/shared/routes/biel-lyss.ts b/src/components-examples/journey-maps/angular/shared/routes/biel-lyss.ts index 14943e8f60..28432df72e 100644 --- a/src/components-examples/journey-maps/angular/shared/routes/biel-lyss.ts +++ b/src/components-examples/journey-maps/angular/shared/routes/biel-lyss.ts @@ -265,7 +265,7 @@ export const bielLyssRoutes: SbbSelectableFeatureCollection[] = [ transportType: 'rail', type: 'endpoint', endpointType: 'to', - sbb_id: 8504300, + didokCode: 8504300, }, geometry: { type: 'Point', From cb26842f43db2d29b0887117dea4ece8b37e6be1 Mon Sep 17 00:00:00 2001 From: Chris Dickinson Date: Thu, 11 Dec 2025 17:29:10 +0100 Subject: [PATCH 3/3] feat(journey-maps): support new field name 'didokCode' in addition to 'sbb_id' refs: ROKAS-2565 --- src/journey-maps/angular/services/map/map-station-service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/journey-maps/angular/services/map/map-station-service.ts b/src/journey-maps/angular/services/map/map-station-service.ts index cb4f59d440..48ab9279c2 100644 --- a/src/journey-maps/angular/services/map/map-station-service.ts +++ b/src/journey-maps/angular/services/map/map-station-service.ts @@ -16,8 +16,8 @@ export const SBB_STATION_LAYER = 'rokas-station-hover'; const MAP_ENDPOINT_LAYERS_V1 = ['rokas-walk-from', 'rokas-walk-to']; const MAP_ENDPOINT_LAYERS_V2 = ['rokas-route-transfer-ending', 'rokas-route-stopover-circle']; const MAP_SOURCE_LAYER_OSM_POINTS = 'osm_points'; -const FEATURE_SBB_ID_FIELD_NAME = 'sbb_id'; -const FEATURE_DIDOK_CODE_FIELD_NAME = 'didokCode'; +const FEATURE_SBB_ID_FIELD_NAME = 'sbb_id'; // old name in journey-maps response (v1) +const FEATURE_DIDOK_CODE_FIELD_NAME = 'didokCode'; // new name in journey-routes response (v2) @Injectable({ providedIn: 'root' }) export class SbbMapStationService {