Zug-Symbole: kein Quadrat mehr beim Rauszoomen, kleiner bei kleinem Zoom
Der Icon-Rand war breiter als das SDF-Feld und füllte bei kleinem Zoom das ganze Bild. Rand skaliert jetzt mit der Symbolgrösse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X48pE4bzjHej8w9HyZXCjb
This commit is contained in:
+3
-2
@@ -65,12 +65,13 @@ const map = new maplibregl.Map({
|
|||||||
"icon-image": ["case", ["has", "bearing"], "tp-arrow", "tp-dot"],
|
"icon-image": ["case", ["has", "bearing"], "tp-arrow", "tp-dot"],
|
||||||
"icon-rotate": ["coalesce", ["get", "bearing"], 0],
|
"icon-rotate": ["coalesce", ["get", "bearing"], 0],
|
||||||
"icon-rotation-alignment": "map",
|
"icon-rotation-alignment": "map",
|
||||||
"icon-size": ["interpolate", ["linear"], ["zoom"], 6, 0.6, 10, 0.9, 14, 1.3],
|
"icon-size": ["interpolate", ["linear"], ["zoom"], 6, 0.3, 9, 0.5, 12, 0.9, 14, 1.3],
|
||||||
"icon-allow-overlap": true, "icon-ignore-placement": true,
|
"icon-allow-overlap": true, "icon-ignore-placement": true,
|
||||||
},
|
},
|
||||||
paint: {
|
paint: {
|
||||||
"icon-color": delayColor, "icon-halo-color": "#fff",
|
"icon-color": delayColor, "icon-halo-color": "#fff",
|
||||||
"icon-halo-width": 6,
|
// Rand muss mit der Symbolgrösse skalieren, sonst füllt er bei kleinem Zoom das ganze Quadrat
|
||||||
|
"icon-halo-width": ["interpolate", ["linear"], ["zoom"], 6, 0.8, 9, 1.4, 12, 2.4, 14, 3.4],
|
||||||
} },
|
} },
|
||||||
{ id: "train-labels", type: "symbol", source: "trains", minzoom: 10,
|
{ id: "train-labels", type: "symbol", source: "trains", minzoom: 10,
|
||||||
layout: {
|
layout: {
|
||||||
|
|||||||
Reference in New Issue
Block a user