From 8dd4a085119549ae657caf808a43a611c478ee91 Mon Sep 17 00:00:00 2001 From: Yorick de Wid Date: Thu, 6 Aug 2026 13:54:07 +0000 Subject: [PATCH] feat(print): read incident_district from the Martin tileserver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switches the incidents chapter from the static Spaces tileset to the dynamic incident_district source on tiles.fundermaps.com, added via its TileJSON endpoint — same pattern ConstructionYearChapter already uses for 'buildings'. Backed by FunderMapsWorker sql/model/create_incident_tiles.sql. The layer config is unchanged: the MVT layer name matches the old tileset. VITE_FUNDERMAPS_TILES_URL now has no remaining reference in this repo; it can be dropped from report-prod once the cutover has held (kept for now so a rollback is a one-line revert). Co-Authored-By: Claude Opus 5 (1M context) --- src/components/Print/Chapters/IncidentsChapter.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/Print/Chapters/IncidentsChapter.vue b/src/components/Print/Chapters/IncidentsChapter.vue index 5351d43..a7db1f6 100644 --- a/src/components/Print/Chapters/IncidentsChapter.vue +++ b/src/components/Print/Chapters/IncidentsChapter.vue @@ -44,17 +44,20 @@ const mapOptions = computed(() => { }) const onLoad = async function onLoad({ map }: { map: Map }) { - // Add incident source - const sourcePath = (import.meta.env.VITE_FUNDERMAPS_TILES_URL + '' || '') + // Incident counts per district come from the Martin tileserver's dynamic + // 'incident_district' source (the static tippecanoe tileset is retired). + // Added via its TileJSON endpoint: tile URLs, zoom range and bounds come + // from the server. The env var may hold either a bare base template or + // the tile-URL form with a /{z}/{x}/{y} suffix. + const tileJsonPath = (import.meta.env.VITE_FUNDERMAPS_TILESERVER_URL + '' || '') + .replace('/{z}/{x}/{y}', '') .replace('{SOURCE}', 'incident_district') map.addSource( "incident_district", { type: 'vector', - tiles: [sourcePath], - // minzoom: 10, - maxzoom: 16 + url: tileJsonPath } )