Add OsmFeature type

This commit is contained in:
Pieter Vander Vennet 2022-07-13 17:56:10 +02:00
parent 284951f5f7
commit 24f090c92f
7 changed files with 26 additions and 20 deletions

View file

@ -3,7 +3,7 @@ import {BBox} from "./BBox";
import togpx from "togpx"
import Constants from "../Models/Constants";
import LayerConfig from "../Models/ThemeConfig/LayerConfig";
import {booleanWithin, Coord, Feature, Geometry, MultiPolygon, Polygon, Properties} from "@turf/turf";
import {AllGeoJSON, booleanWithin, Coord, Feature, Geometry, MultiPolygon, Polygon, Properties} from "@turf/turf";
export class GeoOperations {
@ -29,7 +29,7 @@ export class GeoOperations {
* Returns [lon,lat] coordinates
* @param feature
*/
static centerpointCoordinates(feature: any): [number, number] {
static centerpointCoordinates(feature: AllGeoJSON): [number, number] {
return <[number, number]>turf.center(feature).geometry.coordinates;
}