1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

Replaced getMapPoints() and getMapPath() with getMapCoordinates()

Passing 'trkpt' or 'wpt' to getMapCoordinates() to handle both paths and waypoints from GPX files.
This commit is contained in:
zigmhount 2022-03-09 16:34:57 +01:00 committed by GitHub
parent 7928a07230
commit ffa5ed687d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -386,8 +386,8 @@ export class GalleryMapLightboxComponent implements OnChanges {
// tslint:disable-next-line:prefer-for-of
for (let i = 0; i < this.gpxFiles.length; i++) {
const file = this.gpxFiles[i];
const path = await this.mapService.getMapPath(file);
const wpoints = await this.mapService.getMapPoints(file);
const path = await this.mapService.getMapCoordinates(file,'trkpt');
const wpoints = await this.mapService.getMapCoordinates(file,'wpt');
if (file !== this.gpxFiles[i]) { // check race condition
return;
}
@ -395,10 +395,8 @@ export class GalleryMapLightboxComponent implements OnChanges {
this.mapLayersControlOption.overlays.Paths.addLayer(marker(path[0] as LatLng));
this.mapLayersControlOption.overlays.Paths.addLayer(polyline(path as LatLng[]));
// console.log('Trk path is not empty, in file ' + i + ', path[0]=' + JSON.stringify(path[0]));
// continue;
} else {
// console.log('No trk path in file ' + i);
// continue;
}
if (wpoints.length !== 0) {
// console.log('Wpt exist in file ' + i + ', wpoints[0]=' + JSON.stringify(wpoints[0]) +', wpoints.length=' + wpoints.length);