From 3b906b8bb7b6610601bc0e29edfb737851e8e210 Mon Sep 17 00:00:00 2001 From: eMerzh Date: Sat, 13 Jul 2024 22:44:31 +0200 Subject: [PATCH] chore: help TS recognise BBOX --- src/compute.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compute.ts b/src/compute.ts index de82830..7a2872b 100644 --- a/src/compute.ts +++ b/src/compute.ts @@ -315,7 +315,7 @@ export function getScoreGrid( turf.point([primarySchool.geo.lon, primarySchool.geo.lat]), ]), ) - const newbox = [...box] + const newbox = [...box] as [number, number, number, number, number, number] // just copy the thing newbox[0] = box[0] - (box[2] - box[0]) // / 2; newbox[1] = box[1] - (box[3] - box[1]) // / 2; newbox[2] = box[2] + (box[2] - box[0]) // / 2; @@ -349,7 +349,7 @@ export function getScoreGrid( const steps = (max - min) / 10 const breaks = Array.from({ length: 11 }, (_, i) => min + i * steps) - const lines : GeoJSON.GeoJSON= turf.isobands(grid, breaks, { + const lines: GeoJSON.GeoJSON = turf.isobands(grid, breaks, { zProperty: "score", commonProperties: { "fill-opacity": 0.6,