Fix map breakage: zoom expr can't be nested in a case (circle-stroke-width)
The low_accuracy ring nested a zoom interpolate inside a case, which MapLibre rejects at addLayer — the vehicles-circle/arrow/label layers never loaded, so no markers and no trip clicks. Move interpolate to top level with case in the output stops. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
84e9421b4d
commit
0724dd017f
1 changed files with 7 additions and 7 deletions
|
|
@ -206,14 +206,14 @@ export function initMap(elementId, opts = {}) {
|
|||
['==', ['get', 'low_accuracy'], true], '#f59e0b',
|
||||
'#0b1220',
|
||||
],
|
||||
// zoom must stay the top-level interpolate input; the low-accuracy
|
||||
// widening goes in the per-stop output (a `case`), since MapLibre
|
||||
// forbids a zoom expression nested inside a `case`.
|
||||
'circle-stroke-width': [
|
||||
'case',
|
||||
['==', ['get', 'low_accuracy'], true], 2.5,
|
||||
['interpolate', ['linear'], ['zoom'],
|
||||
5, 0.5,
|
||||
12, 1.5,
|
||||
16, 2,
|
||||
],
|
||||
'interpolate', ['linear'], ['zoom'],
|
||||
5, ['case', ['==', ['get', 'low_accuracy'], true], 2.5, 0.5],
|
||||
12, ['case', ['==', ['get', 'low_accuracy'], true], 2.5, 1.5],
|
||||
16, ['case', ['==', ['get', 'low_accuracy'], true], 2.5, 2],
|
||||
],
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue