From 0724dd017f5c27ea4ac785649a4bfcdc50993a92 Mon Sep 17 00:00:00 2001 From: kianiadee Date: Fri, 29 May 2026 10:07:42 +0300 Subject: [PATCH] Fix map breakage: zoom expr can't be nested in a case (circle-stroke-width) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- web/fleet-core.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/web/fleet-core.js b/web/fleet-core.js index edcce4e..a8e344a 100644 --- a/web/fleet-core.js +++ b/web/fleet-core.js @@ -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], ], }, });