Add the possibility to snap onto another layer with imports, add location confirm on input, add metalayer exporting all nodes, various fixes

This commit is contained in:
Pieter Vander Vennet 2021-10-31 02:08:39 +01:00
parent f5d6441b70
commit 23ae9d39c8
24 changed files with 807 additions and 390 deletions

View file

@ -96,6 +96,8 @@ export default class LocationInput extends InputElement<Loc> implements MinimapO
let min = undefined;
let matchedWay = undefined;
for (const feature of self._snapTo.data ?? []) {
try{
const nearestPointOnLine = GeoOperations.nearestPoint(feature.feature, [loc.lon, loc.lat])
if (min === undefined) {
min = nearestPointOnLine
@ -108,6 +110,9 @@ export default class LocationInput extends InputElement<Loc> implements MinimapO
matchedWay = feature.feature;
}
}catch(e){
console.log("Snapping to a nearest point failed for ", feature.feature,"due to ", e)
}
}
if (min === undefined || min.properties.dist * 1000 > self._maxSnapDistance) {