From eadca8790ad20602c32df5e06bf5f835b65d7ac2 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Wed, 23 Oct 2024 14:21:56 -0700 Subject: [PATCH] styles 4.2; add initial set of lapis and slategray icons. [#238] (#327) * * add initial set of lapis and slategray icons. [#238] * adjust light earth color * adjust POI text scaling at z17+ --- CHANGELOG.md | 6 +++ styles/src/base_layers.ts | 82 ++++++++++++++++++++++++++++++++++++--- styles/src/themes.ts | 2 +- 3 files changed, 83 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74bed370..233bdf32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Styles v4.2.0 +------ +* add icons for a few lapis and slategray POIs [#238, #163] +* adjust light theme earth color +* add fonts and landcover as optional properties of `Theme` interface + Tiles v4.0.2 ------ - fix buildings `min_height` via @JfrAziz [#323] diff --git a/styles/src/base_layers.ts b/styles/src/base_layers.ts index e7f4afa2..c9c895f7 100644 --- a/styles/src/base_layers.ts +++ b/styles/src/base_layers.ts @@ -1506,22 +1506,57 @@ export function labels_layers( ["get", "kind"], [ "literal", - ["beach", "forest", "marina", "park", "peak", "zoo"], + [ + "beach", + "forest", + "marina", + "park", + "peak", + "zoo", + "garden", + "bench", + "aerodrome", + "station", + "bus_stop", + "ferry_terminal", + "stadium", + "university", + "library", + "school", + "animal", + "toilets", + "drinking_water", + ], ], ], - [">=", ["zoom"], ["get", "min_zoom"]], + [">=", ["zoom"], ["+", ["get", "min_zoom"], 0]], ], layout: { - "icon-image": ["get", "kind"], + "icon-image": [ + "match", + ["get", "kind"], + "station", + "train_station", + ["get", "kind"], + ], "text-font": [t.regular || "Noto Sans Regular"], "text-justify": "auto", "text-field": get_multiline_name( lang, script, + t.regular, ) as DataDrivenPropertyValueSpecification, - "text-size": 10, + "text-size": [ + "interpolate", + ["linear"], + ["zoom"], + 17, + 10, + 19, + 16, + ], "text-max-width": 8, - "text-offset": [1, 0], + "text-offset": [1.1, 0], "text-variable-anchor": ["left", "right"], }, paint: { @@ -1532,10 +1567,45 @@ export function labels_layers( ["get", "kind"], [ "literal", - ["beach", "forest", "marina", "park", "peak", "zoo"], + [ + "beach", + "forest", + "marina", + "park", + "peak", + "zoo", + "garden", + "bench", + ], ], ], t.pois.green, + [ + "in", + ["get", "kind"], + [ + "literal", + ["aerodrome", "station", "bus_stop", "ferry_terminal"], + ], + ], + t.pois.lapis, + [ + "in", + ["get", "kind"], + [ + "literal", + [ + "stadium", + "university", + "library", + "school", + "animal", + "toilets", + "drinking_water", + ], + ], + ], + t.pois.slategray, t.earth, ], }, diff --git a/styles/src/themes.ts b/styles/src/themes.ts index 50d79784..61ae3fac 100644 --- a/styles/src/themes.ts +++ b/styles/src/themes.ts @@ -192,7 +192,7 @@ export const CONTRAST: Theme = { export const LIGHT: Theme = { background: "#cccccc", - earth: "#e0e0e0", + earth: "#e2dfda", park_a: "#cfddd5", park_b: "#9cd3b4", hospital: "#e4dad9",