Keep ele when removing duplicates on concat

This commit is contained in:
Norbert Renner 2021-06-11 12:01:10 +02:00
parent cafb87cc6e
commit c3db03d1e3

View file

@ -284,9 +284,16 @@ BR.Export._concatTotalTrack = function (segments) {
let featureCoordinates = feature.geometry.coordinates;
if (segmentIndex > 0) {
// remove first segment coordinate, same as previous last
// remove duplicate coordinate: first segment coordinate same as previous last,
// remove the one without ele value (e.g. beeline)
const prevLast = coordinates[coordinates.length - 1];
const first = featureCoordinates[0];
if (prevLast.length < first.length) {
coordinates.pop();
} else {
featureCoordinates = featureCoordinates.slice(1);
}
}
coordinates = coordinates.concat(featureCoordinates);
}