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

Use SDF sprites to render icon halos #128

Merged
merged 9 commits into from
Oct 26, 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
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ services:
- OSM2PGSQL_DATAFILE

martin-cp:
image: ghcr.io/maplibre/martin
image: ghcr.io/maplibre/martin:main
depends_on:
db:
condition: service_healthy
Expand Down
15 changes: 12 additions & 3 deletions features/signals_railway_signals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -826,9 +826,18 @@ signals_railway_signals:

- description: Blockkennzeichen
country: DE
# TODO match width and height
# WHEN ref_width <= 4 AND ref_height <= 2 THEN CONCAT('de/blockkennzeichen-', ref_width, 'x', ref_height)
icon: { default: 'de/blockkennzeichen' }
icon:
match: 'ref_multiline'
cases:
- { regex: '^([^\n]{4}\n[^\n]{1,4})|([^\n]{1,4}\n[^\n]{4})$', value: 'de/blockkennzeichen-4x2' }
- { regex: '^[^\n]{4}$', value: 'de/blockkennzeichen-4x1' }
- { regex: '^([^\n]{3}\n[^\n]{1,3})|([^\n]{1,3}\n[^\n]{3})$', value: 'de/blockkennzeichen-3x2' }
- { regex: '^[^\n]{3}$', value: 'de/blockkennzeichen-3x1' }
- { regex: '^([^\n]{2}\n[^\n]{1,2})|([^\n]{1,2}\n[^\n]{2})$', value: 'de/blockkennzeichen-2x2' }
- { regex: '^[^\n]{2}$', value: 'de/blockkennzeichen-2x1' }
- { regex: '^[^\n]\n[^\n]$', value: 'de/blockkennzeichen-1x2' }
- { regex: '^[^\n]$', value: 'de/blockkennzeichen-1x1' }
default: 'de/blockkennzeichen'
tags:
- { tag: 'railway:signal:train_protection', value: 'DE-ESO:blockkennzeichen' }

Expand Down
9 changes: 0 additions & 9 deletions import/openrailwaymap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ local signals = osm2pgsql.define_table({
{ column = 'deactivated', type = 'boolean' },
{ column = 'ref', type = 'text' },
{ column = 'ref_multiline', type = 'text' },
{ column = 'ref_width', type = 'smallint' },
{ column = 'ref_height', type = 'smallint' },
{ column = 'signal_direction', type = 'text' },
{% for tag in signals_railway_signals.tags %}
{ column = '{% tag %}', type = 'text' },
Expand Down Expand Up @@ -429,11 +427,6 @@ function osm2pgsql.process_node(object)
tags['railway:signal:speed_limit:deactivated']
) == 'yes'
local ref_multiline, newline_count = (tags.ref or ''):gsub(' ', '\n')
local ref_height = newline_count + 1
local ref_width = 0
for part in string.gmatch(tags.ref or '', '[^ ]+') do
ref_width = math.max(ref_width, part:len())
end

signals:insert({
way = object:as_point(),
Expand All @@ -442,8 +435,6 @@ function osm2pgsql.process_node(object)
deactivated = deactivated,
ref = tags.ref,
ref_multiline = ref_multiline ~= '' and ref_multiline or nil,
ref_height = ref_multiline ~= '' and ref_height or nil,
ref_width = ref_multiline ~= '' and ref_width or nil,
signal_direction = tags['railway:signal:direction'],
{% for tag in signals_railway_signals.tags %}
["{% tag %}"] = tags['{% tag %}'],
Expand Down
4 changes: 2 additions & 2 deletions martin-static.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ghcr.io/maplibre/martin
FROM ghcr.io/maplibre/martin:main

COPY martin /config
COPY symbols /symbols
COPY tiles /tiles

CMD ["/tiles", "--listen-addresses", "[::]:3000", "--sprite", "/symbols", "--font", "/config/fonts"]
CMD ["/tiles", "--listen-addresses", "[::]:3000", "--sprite", "/symbols", "--font", "/config/fonts"]
4 changes: 2 additions & 2 deletions martin.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ghcr.io/maplibre/martin
FROM ghcr.io/maplibre/martin:main

COPY martin /config
COPY symbols /symbols

CMD ["--config", "/config/configuration.yml", "--sprite", "/symbols", "--font", "/config/fonts"]
CMD ["--config", "/config/configuration.yml", "--sprite", "/symbols", "--font", "/config/fonts"]
918 changes: 514 additions & 404 deletions proxy/js/styles.mjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions symbols/general/aei.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions symbols/general/buffer_stop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions symbols/general/coaling_facility.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading