forked from MapComplete/MapComplete
Automatically move the map onto the feature, add arguments to helpers
This commit is contained in:
parent
4fa9159da1
commit
aa9045fd13
5 changed files with 58 additions and 22 deletions
|
@ -273,6 +273,14 @@ 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, {units: "kilometers"});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue