From 2cd99e92cd567c81bf7dc66a46dc533a50cdf3e8 Mon Sep 17 00:00:00 2001 From: Yorick de Wid Date: Thu, 6 Aug 2026 13:53:58 +0000 Subject: [PATCH] feat(map): serve facade_scan and incident layers from the tileserver Adds the five remaining static sources to dynamicSources so they are added via their TileJSON endpoint on tiles.fundermaps.com instead of the raw Spaces bucket. Backed by the new maplayer function sources in FunderMapsWorker (create_facade_scan_tiles.sql, create_incident_tiles.sql). No layer config changes: the MVT layer names match the old tileset names, and every config already uses source == source-layer == tileset name. This is now every source the configs reference, so the static branch is only reachable as a rollback. Keeping it (and the sourceZoomLevels overrides it needs) means a rollback is one name off the list rather than a logic redeploy; it can be removed once the cutover has held. Note: the incident sources now carry municipality_id/district_id/ neighborhood_id, so the existing geofence starts applying to them. On 'Schiedam publiek' (public, fenced to GM0606) that takes the incident layer from all 2,728 Dutch incidents down to Schiedam's 216. Co-Authored-By: Claude Opus 5 (1M context) --- src/components/Mapbox/useMapSources.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/Mapbox/useMapSources.ts b/src/components/Mapbox/useMapSources.ts index 2c4bbd1..8e5c0eb 100644 --- a/src/components/Mapbox/useMapSources.ts +++ b/src/components/Mapbox/useMapSources.ts @@ -35,7 +35,21 @@ export const useMapSources = function useMapSources( // (VITE_FUNDERMAPS_TILESERVER_URL) instead of the static tileset bucket. // These are added via their TileJSON endpoint, so tile URLs, zoom range // and bounds come from the server instead of being duplicated here. - const dynamicSources = ['buildings', 'building_cluster'] + // + // This is now every source the layer configs reference, so the static + // branch below is only reachable as a rollback (drop a name from this + // list and it goes back to Spaces). Once the cutover has held, the + // static path and VITE_FUNDERMAPS_TILES_URL can be removed outright — + // deliberately kept for now so a rollback needs no redeploy of logic. + const dynamicSources = [ + 'buildings', + 'building_cluster', + 'facade_scan', + 'incident', + 'incident_district', + 'incident_municipality', + 'incident_neighborhood', + ] /** * TileJSON endpoint for a dynamic source. Accepts both a bare base