Select point on minimap where to split

This commit is contained in:
Arno Deceuninck 2021-07-13 16:11:57 +02:00
parent ae5325d4d1
commit 159e4d3350
6 changed files with 146 additions and 140 deletions

View file

@ -273,6 +273,15 @@ export class GeoOperations {
}
return undefined;
}
/**
* Generates the closest point on a way from a given point
* @param way The road on which you want to find a point
* @param point Point defined as [lon, lat]
*/
public static nearestPoint(way, point: [number, number]){
return turf.nearestPointOnLine(way, point);
}
}