Return to a previous structure of getDistText
Undoes part of a3c45f6ed6
to make getDistText similar to formatDistance.
This commit is contained in:
parent
0925d30b5c
commit
35581deab4
1 changed files with 11 additions and 5 deletions
|
@ -81,11 +81,17 @@ OSM.Directions = function (map) {
|
|||
}
|
||||
|
||||
function getDistText(dist) {
|
||||
if (dist < 5) return "";
|
||||
if (dist < 200) return String(Math.round(dist / 10) * 10) + "m";
|
||||
if (dist < 1500) return String(Math.round(dist / 100) * 100) + "m";
|
||||
if (dist < 5000) return String(Math.round(dist / 100) / 10) + "km";
|
||||
return String(Math.round(dist / 1000)) + "km";
|
||||
if (dist < 5) {
|
||||
return "";
|
||||
} else if (dist < 200) {
|
||||
return String(Math.round(dist / 10) * 10) + "m";
|
||||
} else if (dist < 1500) {
|
||||
return String(Math.round(dist / 100) * 100) + "m";
|
||||
} else if (dist < 5000) {
|
||||
return String(Math.round(dist / 100) / 10) + "km";
|
||||
} else {
|
||||
return String(Math.round(dist / 1000)) + "km";
|
||||
}
|
||||
}
|
||||
|
||||
function formatHeight(m) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue