Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render railway positions for low zooms without decimal #139

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion import/sql/tile_views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions martin/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ postgres:
id: integer
railway: string
pos: string
pos_int: string
zero: boolean

standard_railway_switch_ref:
Expand Down
6 changes: 5 additions & 1 deletion proxy/js/styles.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down