diff --git a/import/sql/functions.sql b/import/sql/functions.sql index 865e0a46..7962ea8e 100644 --- a/import/sql/functions.sql +++ b/import/sql/functions.sql @@ -49,7 +49,7 @@ $$ LANGUAGE plpgsql LEAKPROOF PARALLEL SAFE; -CREATE OR REPLACE FUNCTION railway_pos_round(km_pos TEXT) RETURNS NUMERIC AS $$ +CREATE OR REPLACE FUNCTION railway_pos_round(km_pos TEXT, decimals int) RETURNS NUMERIC AS $$ DECLARE pos_part1 TEXT; km_float NUMERIC(8, 3); @@ -59,8 +59,8 @@ BEGIN RETURN NULL; END IF; km_float := pos_part1::NUMERIC(8, 3); - km_float := round(km_float, 1); - RETURN trunc(km_float, 1); + km_float := round(km_float, decimals); + RETURN trunc(km_float, decimals); END; $$ LANGUAGE plpgsql IMMUTABLE diff --git a/import/sql/tile_views.sql b/import/sql/tile_views.sql index 77eafff9..6e0264ad 100644 --- a/import/sql/tile_views.sql +++ b/import/sql/tile_views.sql @@ -248,13 +248,13 @@ CREATE OR REPLACE VIEW railway_text_km AS railway, pos, (railway_pos_decimal(pos) = '0') as zero, - left(pos, -2) as pos_int + railway_pos_round(pos, 0)::text as pos_int FROM (SELECT id, way, railway, - COALESCE(railway_position, railway_pos_round(railway_position_exact)::text) AS pos + COALESCE(railway_position, railway_pos_round(railway_position_exact, 1)::text) AS pos FROM railway_positions ) AS r WHERE pos IS NOT NULL diff --git a/martin/fonts/FiraCode-Bold.ttf b/martin/fonts/FiraCode-Bold.ttf new file mode 100644 index 00000000..f891bde4 Binary files /dev/null and b/martin/fonts/FiraCode-Bold.ttf differ diff --git a/martin/fonts/FiraCode-Regular.ttf b/martin/fonts/FiraCode-Regular.ttf new file mode 100644 index 00000000..bd736851 Binary files /dev/null and b/martin/fonts/FiraCode-Regular.ttf differ diff --git a/proxy/js/styles.mjs b/proxy/js/styles.mjs index 1eb7c721..210b3a8c 100644 --- a/proxy/js/styles.mjs +++ b/proxy/js/styles.mjs @@ -1078,7 +1078,7 @@ const railwayKmText = { true, ], paint: { - 'text-color': 'black', + 'text-color': 'hsl(268, 100%, 40%)', 'text-halo-color': ['case', ['boolean', ['feature-state', 'hover'], false], colors.hover.textHalo, 'white', @@ -1092,7 +1092,7 @@ const railwayKmText = { 13, ['get', 'pos'], ], - 'text-font': ['Noto Sans Bold'], + 'text-font': ['Fira Code Bold'], 'text-size': 11, }, }; @@ -3945,6 +3945,7 @@ const legendData = { type: 'point', properties: { zero: true, + pos_int: '47', pos: '47.0', }, }, @@ -4039,6 +4040,17 @@ const legendData = { }, }, ], + "high-railway_text_km": [ + { + legend: 'Milestone', + type: 'point', + properties: { + zero: true, + pos_int: '47', + pos: '47.0', + }, + }, + ], 'openrailwaymap_speed-speed_railway_signals': [ // TODO filter per country polygon ...speed_railway_signals.features.map(feature => ({ @@ -4197,6 +4209,17 @@ const legendData = { ], }, ], + "high-railway_text_km": [ + { + legend: 'Milestone', + type: 'point', + properties: { + zero: true, + pos_int: '47', + pos: '47.0', + }, + }, + ], 'openrailwaymap_signals-signals_railway_signals': [ ...signals_railway_signals.features.map(feature => ({ legend: `${feature.country ? `(${feature.country}) ` : ''}${feature.description}`, @@ -4447,6 +4470,17 @@ const legendData = { }, }, ], + "high-railway_text_km": [ + { + legend: 'Milestone', + type: 'point', + properties: { + zero: true, + pos_int: '47', + pos: '47.0', + }, + }, + ], 'openrailwaymap_electrification-electrification_signals': [ ...electrification_signals.features.map(feature => ({ legend: `(${feature.country}) ${feature.description}`, @@ -4802,6 +4836,17 @@ const legendData = { }, }, ], + "high-railway_text_km": [ + { + legend: 'Milestone', + type: 'point', + properties: { + zero: true, + pos_int: '47', + pos: '47.0', + }, + }, + ], }, loading_gauge: { 'openrailwaymap_low-railway_line_low': [ @@ -4876,6 +4921,17 @@ const legendData = { }, }, ], + "high-railway_text_km": [ + { + legend: 'Milestone', + type: 'point', + properties: { + zero: true, + pos_int: '47', + pos: '47.0', + }, + }, + ], }, }