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

@ -136,7 +136,7 @@ export default class LengthInput extends InputElement<string> {
if (leaflet) {
const first = leaflet.layerPointToLatLng(firstClickXY)
const last = leaflet.layerPointToLatLng([dx, dy])
const geoDist = Math.floor(GeoOperations.distanceBetween([first.lng, first.lat], [last.lng, last.lat]) * 10000) / 10
const geoDist = Math.floor(GeoOperations.distanceBetween([first.lng, first.lat], [last.lng, last.lat]) * 10) / 10
self.value.setData("" + geoDist)
}