Skip to content

Open Infrastructure Map, a view of infrastructure data in OpenStreetMap

Fix invisible labels

Russ Garrettd534d4b777b9
diff --git a/web/src/style/protomaps_language.ts b/web/src/style/protomaps_language.ts
index 4eecd8b..1b5b437 100644
--- a/web/src/style/protomaps_language.ts
+++ b/web/src/style/protomaps_language.ts
@@ -76,7 +76,7 @@ export function get_country_name(lang: string, script?: string) {
}
return [
'format',
- ['coalesce', ['get', `${name_prefix}name:${lang}`], ['get', 'name:en']],
+ ['coalesce', ['get', `${name_prefix}name:${lang}`], ['get', 'name:en'], ['get', 'name']],
get_font_formatting(_script)
]
}
diff --git a/web/src/style/style_base.ts b/web/src/style/style_base.ts
index 9d863bd..a42f0b6 100644
--- a/web/src/style/style_base.ts
+++ b/web/src/style/style_base.ts
@@ -529,19 +529,7 @@ const layers: LayerSpecificationWithZIndex[] = [
filter: ['all', ['!has', 'is_tunnel'], ['==', 'kind', 'major_road']],
paint: {
'line-color': colours['road_major'],
- 'line-width': [
- 'interpolate',
- ['exponential', 1.6],
- ['zoom'],
- 6,
- 0,
- 12,
- 1.6,
- 15,
- 3,
- 18,
- road_base_size * 1.6
- ]
+ 'line-width': ['interpolate', ['exponential', 1.6], ['zoom'], 6, 0, 18, road_base_size * 1.6]
}
},
{
@@ -552,21 +540,7 @@ const layers: LayerSpecificationWithZIndex[] = [
filter: ['all', ['!has', 'is_tunnel'], ['==', 'kind', 'highway'], ['!has', 'is_link']],
paint: {
'line-color': colours['road_major'],
- 'line-width': [
- 'interpolate',
- ['exponential', 1.6],
- ['zoom'],
- 3,
- 0,
- 6,
- 1.1,
- 12,
- 1.6,
- 15,
- 5,
- 18,
- road_base_size * 2
- ]
+ 'line-width': ['interpolate', ['exponential', 1.6], ['zoom'], 3, 0, 6, 1.1, 18, road_base_size * 2]
}
},
{
diff --git a/web/src/style/style_labels.ts b/web/src/style/style_labels.ts
index 0d2c8a1..6f42098 100644
--- a/web/src/style/style_labels.ts
+++ b/web/src/style/style_labels.ts
@@ -181,6 +181,7 @@ export default function layers(lang: string): LayerSpecificationWithZIndex[] {
source: 'basemap',
'source-layer': 'places',
minzoom: 2,
+ maxzoom: 8,
filter: ['==', 'kind', 'country'],
layout: {
'symbol-sort-key': ['get', 'min_zoom'],