X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/97c572b92f5e09d646ce045a949e40d53f87243a..f2a2c29815768171406587b7bc528f5033ec9b8f:/lib/template/details-html.php?ds=inline diff --git a/lib/template/details-html.php b/lib/template/details-html.php index da36167c..548cee7a 100644 --- a/lib/template/details-html.php +++ b/lib/template/details-html.php @@ -2,9 +2,11 @@ header("content-type: text/html; charset=UTF-8"); ?> + + '.$sOSMType.' '.$aFeature['osm_id'].''; } return ''; @@ -28,7 +31,7 @@ if ($aFeature['wikipedia']) { list($sWikipediaLanguage,$sWikipediaArticle) = explode(':',$aFeature['wikipedia']); - return ''.$aFeature['wikipedia'].''; + return ''.$aFeature['wikipedia'].''; } return ''; } @@ -40,7 +43,19 @@ function format_distance($fDistance) { - return'~'.(round($fDistance,1)).' km'; + // $fDistance is in meters + if ($fDistance < 1) + { + return '0'; + } + elseif ($fDistance < 1000) + { + return'~'.(round($fDistance,0)).' m'; + } + else + { + return'~'.(round($fDistance/1000,1)).' km'; + } } function kv($sKey,$sValue) @@ -245,13 +260,6 @@ - - -