improve english distance display : feet and miles

merge-requests/3/head
Julien Veyssier 2017-08-31 16:05:14 +02:00
parent 3b27b2160d
commit 62f20971e4
2 changed files with 7 additions and 2 deletions

View File

@ -376,7 +376,6 @@
metric = (unit === 'metric') ? true : false; metric = (unit === 'metric') ? true : false;
feet = (unit === 'feet') ? true : false; feet = (unit === 'feet') ? true : false;
nautic = (unit === 'nautic') ? true : false; nautic = (unit === 'nautic') ? true : false;
console.log(metric + ' ' + feet + ' ' + nautic);
var options = { var options = {
position: 'bottomleft', position: 'bottomleft',

View File

@ -2944,7 +2944,13 @@ L.GeometryUtil = L.extend(L.GeometryUtil || {}, {
break; break;
case 'feet': case 'feet':
distance *= 1.09361 * 3; distance *= 1.09361 * 3;
if (distance > 1000) {
distance *= 0.00018939;
distanceStr = distance.toFixed(2) + ' mi';
}
else {
distanceStr = Math.ceil(distance) + ' ft'; distanceStr = Math.ceil(distance) + ' ft';
}
break; break;
case 'nauticalMile': case 'nauticalMile':