diff --git a/import/sql/tile_views.sql b/import/sql/tile_views.sql index 08c16494..c7c6a7ed 100644 --- a/import/sql/tile_views.sql +++ b/import/sql/tile_views.sql @@ -247,7 +247,8 @@ CREATE OR REPLACE VIEW railway_text_km AS way, railway, pos, - (railway_pos_decimal(pos) = '0') as zero + (railway_pos_decimal(pos) = '0') as zero, + left(pos, -2) as pos_int FROM (SELECT id, diff --git a/martin/configuration.yml b/martin/configuration.yml index ad6ba899..49ab6682 100644 --- a/martin/configuration.yml +++ b/martin/configuration.yml @@ -212,6 +212,7 @@ postgres: id: integer railway: string pos: string + pos_int: string zero: boolean standard_railway_switch_ref: diff --git a/proxy/js/styles.mjs b/proxy/js/styles.mjs index 9fca9bd6..e85e478d 100644 --- a/proxy/js/styles.mjs +++ b/proxy/js/styles.mjs @@ -1087,7 +1087,11 @@ const railwayKmText = { }, layout: { 'symbol-z-order': 'source', - 'text-field': '{pos}', + 'text-field': ['step', ['zoom'], + ['get', 'pos_int'], + 13, + ['get', 'pos'], + ], 'text-font': ['Noto Sans Bold'], 'text-size': 11, },