GeoOperations.distanceBetween now uses meters, fix GPS tracking

This commit is contained in:
Pieter Vander Vennet 2021-11-12 18:39:38 +01:00
parent 79012c42ab
commit 680e56397d
10 changed files with 40 additions and 40 deletions

View file

@ -225,7 +225,7 @@ export default class CreateWayWithPointReuseAction extends OsmChangeAction {
const coor = coordinates[i]
// Check closeby (and probably identical) point further in the coordinate list, mark them as duplicate
for (let j = i + 1; j < coordinates.length; j++) {
if (1000 * GeoOperations.distanceBetween(coor, coordinates[j]) < 0.1) {
if (GeoOperations.distanceBetween(coor, coordinates[j]) < 0.1) {
coordinateInfo[j] = {
lngLat: coor,
identicalTo: i
@ -244,7 +244,7 @@ export default class CreateWayWithPointReuseAction extends OsmChangeAction {
}[] = []
for (const node of allNodes) {
const center = node.geometry.coordinates
const d = 1000 * GeoOperations.distanceBetween(coor, center)
const d = GeoOperations.distanceBetween(coor, center)
if (d > maxDistance) {
continue
}