diff --git a/src/OpenLayers/Controls/ElevationPath.js b/src/OpenLayers/Controls/ElevationPath.js index 386e872b..d859ea3b 100644 --- a/src/OpenLayers/Controls/ElevationPath.js +++ b/src/OpenLayers/Controls/ElevationPath.js @@ -1384,8 +1384,10 @@ var ElevationPath = (function (Control) { // Calcul de la distance au départ pour chaque point + arrondi des lat/lon _data[0].dist = 0; _data[0].slope = 0; - _data[0].lat = Math.round(_data[0].lat * 10000) / 10000; - _data[0].lon = Math.round(_data[0].lon * 10000) / 10000; + _data[0].oldlat = _data[0].lat; + _data[0].oldlon = _data[0].lon; + _data[0].lat = Math.round(_data[0].lat * 100000) / 100000; + _data[0].lon = Math.round(_data[0].lon * 100000) / 100000; var _distanceMinus = 0; var _distancePlus = 0; @@ -1398,7 +1400,7 @@ var ElevationPath = (function (Control) { for (var i = 1; i < _data.length; i++) { var a = [_data[i].lon, _data[i].lat]; - var distanceToPrevious = olGetDistanceSphere(a, [_data[i-1].lon, _data[i-1].lat]); + var distanceToPrevious = olGetDistanceSphere(a, [_data[i-1].oldlon, _data[i-1].oldlat]); var dist = distanceToPrevious + _distance; var za = _data[i].z; @@ -1439,8 +1441,10 @@ var ElevationPath = (function (Control) { _data[i].color = "#00B798"; } - _data[i].lat = Math.round(_data[i].lat * 10000) / 10000; - _data[i].lon = Math.round(_data[i].lon * 10000) / 10000; + _data[i].oldlat = _data[i].lat; + _data[i].oldlon = _data[i].lon; + _data[i].lat = Math.round(_data[i].lat * 100000) / 100000; + _data[i].lon = Math.round(_data[i].lon * 100000) / 100000; } // check distance totale