- // $fDistance is in meters
- if ($fDistance < 1)
- {
- return '0';
- }
- elseif ($fDistance < 1000)
- {
- return'<abbr class="distance" title="'.$fDistance.'">~'.(round($fDistance,0)).' m</abbr>';
- }
- else
- {
- return'<abbr class="distance" title="'.$fDistance.'">~'.(round($fDistance/1000,1)).' km</abbr>';
+ if ($bInMeters) {
+ // $fDistance is in meters
+ if ($fDistance < 1) {
+ return '0';
+ }
+ elseif ($fDistance < 1000) {
+ return '<abbr class="distance" title="'.$fDistance.' meters">~'.(round($fDistance,0)).' m</abbr>';
+ }
+ else {
+ return '<abbr class="distance" title="'.$fDistance.' meters">~'.(round($fDistance/1000,1)).' km</abbr>';
+ }
+ } else {
+ if ($fDistance == 0) {
+ return '0';
+ } else {
+ return '<abbr class="distance" title="spheric distance '.$fDistance.'">'.(round($fDistance,4)).'</abbr>';
+ }