Refactoring: fix metatagging

This commit is contained in:
Pieter Vander Vennet 2023-05-16 03:27:49 +02:00
parent 177697fe0a
commit 8fd3fbc0b7
34 changed files with 378 additions and 265 deletions

View file

@ -1,6 +1,8 @@
import { ExtraFuncParams, ExtraFunctions } from "../../Logic/ExtraFunctions"
import { OsmFeature } from "../../Models/OsmFeature"
import { describe, expect, it } from "vitest"
import {GeoJSONFeature} from "maplibre-gl";
import {Feature} from "geojson";
describe("OverlapFunc", () => {
it("should give doors on the edge", () => {
@ -21,7 +23,7 @@ describe("OverlapFunc", () => {
},
}
const hermanTeirlinck = {
const hermanTeirlinck: Feature = {
type: "Feature",
id: "way/444059131",
properties: {
@ -104,21 +106,15 @@ describe("OverlapFunc", () => {
],
],
},
bbox: {
maxLat: 50.8668593,
maxLon: 4.3509055,
minLat: 50.8655878,
minLon: 4.3493369,
},
}
const params: ExtraFuncParams = {
getFeatureById: () => undefined,
getFeaturesWithin: () => [[door]],
getFeaturesWithin: () => [door],
}
const helpers = ExtraFunctions.constructHelpers(params)
ExtraFunctions.FullPatchFeature(params, hermanTeirlinck)
const overlap = (<any>hermanTeirlinck).overlapWith("*")
const overlap = helpers.overlapWith(hermanTeirlinck)("*")
console.log(JSON.stringify(overlap))
expect(overlap[0].feat == door).toBe(true)
})