Skip to content

Commit

Permalink
Fixed a corner case with snaking
Browse files Browse the repository at this point in the history
  • Loading branch information
tmuguet committed Apr 16, 2018
1 parent bb0934b commit 5315afa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/js/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ L.Layer.include({
console.log('Could not find altitude for coordinates', coords);
deferred.rejectWith({ error: 'Impossible d\'obtenir les données d\'altitude' });
}

if (!$.Cache.hasSlope(coords)) {
console.log('Could not find slope for coordinates', coords);
deferred.rejectWith({ error: 'Impossible d\'obtenir les données de pente' });
Expand Down
8 changes: 7 additions & 1 deletion src/js/track.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,13 @@
});
});

geojson.snakeIn();
try {
geojson.snakeIn();
} catch (e) {
// With some weird tracks, snakeIn can fail (don't know why)
geojson._snakeEnd();
}

_this.setOpacity(1);
to.setOpacity(1);
});
Expand Down

0 comments on commit 5315afa

Please sign in to comment.