Skip to content

Commit

Permalink
chore: help TS recognise BBOX
Browse files Browse the repository at this point in the history
  • Loading branch information
eMerzh committed Jul 13, 2024
1 parent 6806e88 commit 3b906b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3b906b8

Please sign in to comment.