Small cleanups
This commit is contained in:
parent
09c7418911
commit
bdd9ed4c22
1 changed files with 5 additions and 9 deletions
|
@ -169,21 +169,17 @@ export class Changes {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const leastDistance = Math.min(...changedObjectCoordinates.map(coor =>
|
return Math.min(...changedObjectCoordinates.map(coor =>
|
||||||
Math.min(...recentLocationPoints.map(gpsPoint => {
|
Math.min(...recentLocationPoints.map(gpsPoint => {
|
||||||
const otherCoor = GeoOperations.centerpointCoordinates(gpsPoint)
|
const otherCoor = GeoOperations.centerpointCoordinates(gpsPoint)
|
||||||
const dist = GeoOperations.distanceBetween(coor, otherCoor) * 1000;
|
return GeoOperations.distanceBetween(coor, otherCoor) * 1000
|
||||||
console.log("Comparing ", coor, "and ", otherCoor, " --> ", dist)
|
|
||||||
return dist
|
|
||||||
}))
|
}))
|
||||||
))
|
))
|
||||||
return leastDistance
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async applyAction(action: OsmChangeAction): Promise<void> {
|
public async applyAction(action: OsmChangeAction): Promise<void> {
|
||||||
const changeDescriptions = await action.Perform(this)
|
const changeDescriptions = await action.Perform(this)
|
||||||
const distanceToObject = this.calculateDistanceToChanges(action, changeDescriptions)
|
changeDescriptions[0].meta.distanceToObject = this.calculateDistanceToChanges(action, changeDescriptions)
|
||||||
changeDescriptions[0].meta.distanceToObject = distanceToObject
|
|
||||||
this.applyChanges(changeDescriptions)
|
this.applyChanges(changeDescriptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,7 +309,7 @@ export class Changes {
|
||||||
pendingPerTheme.get(theme).push(changeDescription)
|
pendingPerTheme.get(theme).push(changeDescription)
|
||||||
}
|
}
|
||||||
|
|
||||||
const successes = await Promise.all(Array.from(pendingPerTheme, ([key, value]) => value)
|
const successes = await Promise.all(Array.from(pendingPerTheme, ([_, value]) => value)
|
||||||
.map(async pendingChanges => {
|
.map(async pendingChanges => {
|
||||||
try {
|
try {
|
||||||
return await self.flushSelectChanges(pendingChanges);
|
return await self.flushSelectChanges(pendingChanges);
|
||||||
|
|
Loading…
Reference in a new issue