From 3f6eef63fc9620251c5e4715df383f93183df309 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Thu, 10 Oct 2024 18:42:00 +0800 Subject: [PATCH] add main sprites layer [#238] limit to 4 kinds of green icons for now --- styles/src/base_layers.ts | 47 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/styles/src/base_layers.ts b/styles/src/base_layers.ts index db694c8f..004725bf 100644 --- a/styles/src/base_layers.ts +++ b/styles/src/base_layers.ts @@ -1485,9 +1485,54 @@ export function labels_layers( paint: { "text-color": t.roads_label_major, "text-halo-color": t.roads_label_major_halo, - "text-halo-width": 2, + "text-halo-width": 1, + "text-halo-blur": 1, }, }, + ...(t.pois + ? [ + { + id: "pois", + type: "symbol", + source: source, + "source-layer": "pois", + filter: [ + "all", + [ + "in", + ["get", "kind"], + ["literal", ["forest", "park", "peak", "marina"]], + ], + [">=", ["zoom"], ["get", "min_zoom"]], + ], + layout: { + "icon-image": ["get", "kind"], + "text-font": ["Noto Sans Regular"], + "text-justify": "auto", + "text-field": get_multiline_name( + lang, + script, + ) as DataDrivenPropertyValueSpecification, + "text-size": 10, + "text-max-width": 8, + "text-offset": [1, 0], + "text-variable-anchor": ["left", "right"], + }, + paint: { + "text-color": [ + "case", + [ + "in", + ["get", "kind"], + ["literal", ["park", "peak", "forest", "marina"]], + ], + t.pois.green, + t.earth, + ], + }, + }, + ] + : []), { id: "places_subplace", type: "symbol",