Solicitation map: one invalid zone geoJson aborts the rest of the layer #1054

Closed
opened 2026-08-13 05:42:01 +00:00 by spikerj · 1 comment
Owner

In SolicitationMapComponent.renderZones, each zone's geoJson is passed to JSON.parse with no try/catch. The loop then builds a Leaflet layer.

If any one zone has invalid JSON (empty string, truncated payload, legacy non-JSON notes stuffed into the field), JSON.parse throws and the rest of the array is never painted — zoneLayer stays empty after clearLayers().

Expected: skip the bad zone (and maybe console.warn), then still render the remaining valid polygons.

Pinned as a characterization test in solicitation-map.component.logic.spec.ts (wave 7). No MapLibre / L.map involved.

In `SolicitationMapComponent.renderZones`, each zone's `geoJson` is passed to `JSON.parse` with no try/catch. The loop then builds a Leaflet layer. If any one zone has invalid JSON (empty string, truncated payload, legacy non-JSON notes stuffed into the field), `JSON.parse` throws and the rest of the array is never painted — `zoneLayer` stays empty after `clearLayers()`. Expected: skip the bad zone (and maybe `console.warn`), then still render the remaining valid polygons. Pinned as a characterization test in `solicitation-map.component.logic.spec.ts` (wave 7). No MapLibre / `L.map` involved.
Author
Owner

Resolved in spikersoft-angular PR #819 (merged to master). One invalid zone geoJson no longer aborts the rest of the solicitation layer. Closing.

Resolved in spikersoft-angular [PR #819](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/819) (merged to `master`). One invalid zone geoJson no longer aborts the rest of the solicitation layer. Closing.
Sign in to join this conversation.