detect and ignore duplicate POIs when merging

This commit is contained in:
vcoppe
2024-12-28 16:14:36 +01:00
parent 7a80e9e104
commit dc404706c5
2 changed files with 22 additions and 1 deletions

View File

@@ -1235,6 +1235,23 @@ export class Waypoint {
});
}
equals(other: Waypoint): boolean {
if (this.attributes.lat !== other.attributes.lat || this.attributes.lon !== other.attributes.lon || this.ele !== other.ele ||
this.name !== other.name || this.cmt !== other.cmt || this.desc !== other.desc || this.sym !== other.sym || this.type !== other.type) {
return false;
}
if (this.time === undefined && other.time !== undefined || this.time !== undefined && other.time === undefined || this.time !== undefined && other.time !== undefined && this.time.getTime() !== other.time.getTime()) {
return false;
}
if (JSON.stringify(this.link) !== JSON.stringify(other.link)) {
return false;
}
return true;
}
// Producers
setHidden(hidden: boolean) {
this._data.hidden = hidden;