diff --git a/frontend/app/gallery/map/lightbox/lightbox.map.gallery.component.html b/frontend/app/gallery/map/lightbox/lightbox.map.gallery.component.html index 8f9ddd69..f11dfe99 100644 --- a/frontend/app/gallery/map/lightbox/lightbox.map.gallery.component.html +++ b/frontend/app/gallery/map/lightbox/lightbox.map.gallery.component.html @@ -7,22 +7,37 @@ [style.left.px]="lightboxDimension.left" [style.opacity]="opacity"> - - - - + + + + + + + + + + + + 1) { + dist = 1; + } + dist = Math.acos(dist); + dist = dist * 180 / Math.PI; + dist = dist * 60 * 1.1515; + return dist * 1.609344; + } + + + private gpxFilter(list: MapPath[]) { + let last = list[0]; + const out = []; + for (let i = 1; i < list.length; i++) { + if (this.calcDistance(list[i], last) > 0.5) { + out.push(list[i]); + last = list[i]; + } + } + if (out.length < 2) { + out.push(list[list.length - 1]); + } + return out; + } + private async loadGPXFiles(): Promise { this.paths = []; for (let i = 0; i < this.gpxFiles.length; i++) { @@ -161,7 +193,11 @@ export class GalleryMapLightboxComponent implements OnChanges, AfterViewInit { if (file !== this.gpxFiles[i]) { // check race condition return; } + if (path.length === 0) { + continue; + } this.paths.push(path); + this.pathOutlines.push(this.gpxFilter(path)); } }