From e9797fbd39cb3b3c735871e5ec19609a0164338b Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sat, 11 Mar 2023 02:35:11 +0100 Subject: [PATCH] docs: improve typing --- Logic/GeoOperations.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Logic/GeoOperations.ts b/Logic/GeoOperations.ts index 409911f8e..2ceb9b2d4 100644 --- a/Logic/GeoOperations.ts +++ b/Logic/GeoOperations.ts @@ -234,10 +234,11 @@ export class GeoOperations { }) } - static bbox(feature: any) { + static bbox(feature: any): Feature { const [lon, lat, lon0, lat0] = turf.bbox(feature) return { type: "Feature", + properties: {}, geometry: { type: "LineString", coordinates: [ @@ -652,7 +653,7 @@ export class GeoOperations { public static clipWith(toSplit: Feature, boundary: Feature): Feature[] { if (toSplit.geometry.type === "Point") { const p = >toSplit - if (GeoOperations.inside(p.geometry.coordinates, boundary)) { + if (GeoOperations.inside(<[number, number]>p.geometry.coordinates, boundary)) { return [p] } else { return [] @@ -687,7 +688,7 @@ export class GeoOperations { x: number, y: number, coordinates: [number, number][][] - ) { + ): boolean { const inside = GeoOperations.pointWithinRing( x, y,