Adding a community index view with Svelte (WIP)

This commit is contained in:
Pieter Vander Vennet 2023-01-29 13:10:57 +01:00
parent ad13444883
commit d30ed22673
10 changed files with 487 additions and 101 deletions

View file

@ -209,7 +209,7 @@ export class GeoOperations {
* GeoOperations.inside([1.42822265625, 48.61838518688487], multiPolygon) // => false
* GeoOperations.inside([4.02099609375, 47.81315451752768], multiPolygon) // => false
*/
public static inside(pointCoordinate, feature): boolean {
public static inside(pointCoordinate: [number, number] | Feature<Point>, feature): boolean {
// ray-casting algorithm based on
// http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
@ -217,8 +217,8 @@ export class GeoOperations {
return false
}
if (pointCoordinate.geometry !== undefined) {
pointCoordinate = pointCoordinate.geometry.coordinates
if (pointCoordinate["geometry"] !== undefined) {
pointCoordinate = pointCoordinate["geometry"].coordinates
}
const x: number = pointCoordinate[0]