X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/40588482a245902c844631a50befeffa95c03dcb..797c2d1e74a14d8d52d963f1efad9be53fca5f5f:/lib/template/details-html.php
diff --git a/lib/template/details-html.php b/lib/template/details-html.php
index ec4a2108..71fcc7b3 100644
--- a/lib/template/details-html.php
+++ b/lib/template/details-html.php
@@ -7,38 +7,18 @@
-
".$sTitle."\n";
+ echo "
".$sTitle." |
\n";
}
- function osm_link($aFeature)
+ function headline3($sTitle)
{
- $sOSMType = ($aFeature['osm_type'] == 'N'?'node':($aFeature['osm_type'] == 'W'?'way':($aFeature['osm_type'] == 'R'?'relation':'')));
- if ($sOSMType)
- {
- return ''.$sOSMType.' '.$aFeature['osm_id'].'';
- }
- return '';
+ echo "".$sTitle." |
\n";
}
- function wikipedia_link($aFeature)
- {
- if ($aFeature['wikipedia'])
- {
- list($sWikipediaLanguage,$sWikipediaArticle) = explode(':',$aFeature['wikipedia']);
- return ''.$aFeature['wikipedia'].'';
- }
- return '';
- }
-
- function nominatim_link($aFeature, $sTitle)
- {
- return ''.$sTitle.'';
- }
function format_distance($fDistance)
{
@@ -73,18 +53,6 @@
return $sHTML;
}
- // function hash_to_subtable($aAssociatedList)
- // {
- // $sHTML = '';
- // foreach($aAssociatedList as $sKey => $sValue)
- // {
- // $sHTML = $sHTML . ''.$sKey.' | '.$sValue.' |
'."\n";
- // }
- // $sHTML = $sHTML . '
';
- // return $sHTML;
- // }
-
-
function map_icon($sIcon)
{
if ($sIcon){
@@ -96,18 +64,29 @@
function _one_row($aAddressLine){
$bNotUsed = (isset($aAddressLine['isaddress']) && $aAddressLine['isaddress'] == 'f');
- echo '';
- echo ' '.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'No Name').' | ';
- echo ' ' . $aAddressLine['class'].':'.$aAddressLine['type'] . ' | ';
- echo ' ' . osm_link($aAddressLine) . ' | ';
- echo ' ' . (isset($aAddressLine['admin_level']) ? $aAddressLine['admin_level'] : '') . ' | ';
- // echo '' . (isset($aAddressLine['rank_search_label']) ? $aAddressLine['rank_search_label'] : '') .' | ';
- // echo ', '.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'';
- echo ' ' . format_distance($aAddressLine['distance']).' | ';;
- echo ' ' . nominatim_link($aAddressLine,'details >') . ' | ';;
+ echo '
'."\n";
+ echo ' '.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'No Name')." | \n";
+ echo ' ' . $aAddressLine['class'].':'.$aAddressLine['type'] . " | \n";
+ echo ' ' . osmLink($aAddressLine) . " | \n";
+ echo ' ' . (isset($aAddressLine['admin_level']) ? $aAddressLine['admin_level'] : '') . " | \n";
+ echo ' ' . format_distance($aAddressLine['distance'])." | \n";
+ echo ' ' . detailsLink($aAddressLine,'details >') . " | \n";
echo "
\n";
}
+ function _one_keyword_row($keyword_token,$word_id){
+ echo "\n";
+ echo '';
+ // mark partial tokens (those starting with a space) with a star for readability
+ echo ($keyword_token[0]==' '?'*':'');
+ echo $keyword_token;
+ if (isset($word_id))
+ {
+ echo ' | word id: '.$word_id;
+ }
+ echo " |
\n";
+ }
+
?>
@@ -139,10 +118,10 @@
}
kv('Coverage' , ($aPointDetails['isarea']=='t'?'Polygon':'Point') );
kv('Centre Point' , $aPointDetails['lat'].','.$aPointDetails['lon'] );
- kv('OSM' , osm_link($aPointDetails) );
+ kv('OSM' , osmLink($aPointDetails) );
if ($aPointDetails['wikipedia'])
{
- kv('Wikipedia Calculated' , wikipedia_link($aPointDetails) );
+ kv('Wikipedia Calculated' , wikipediaLink($aPointDetails) );
}
kv('Extra Tags' , hash_to_subtable($aPointDetails['aExtraTags']) );
@@ -169,7 +148,6 @@
Type |
OSM |
Admin level |
-
Distance |
|
@@ -184,8 +162,6 @@
}
?>
-
-
';
foreach($aLinkedLines as $aAddressLine)
{
_one_row($aAddressLine);
}
- echo '';
}
@@ -208,7 +182,7 @@
headline('Name Keywords');
foreach($aPlaceSearchNameKeywords as $aRow)
{
- echo ''.$aRow['word_token']."
\n";
+ _one_keyword_row($aRow['word_token'], $aRow['word_id']);
}
}
@@ -217,10 +191,10 @@
headline('Address Keywords');
foreach($aPlaceSearchAddressKeywords as $aRow)
{
- echo ''.($aRow['word_token'][0]==' '?'*':'').$aRow['word_token'].'('.$aRow['word_id'].')'."
\n";
+ _one_keyword_row($aRow['word_token'], $aRow['word_id']);
}
}
-
+
if (sizeof($aParentOfLines))
{
headline('Parent Of');
@@ -238,22 +212,19 @@
foreach($aGroupedAddressLines as $sGroupHeading => $aParentOfLines)
{
$sGroupHeading = ucwords($sGroupHeading);
- echo "$sGroupHeading
\n";
+ headline3($sGroupHeading);
- echo '';
foreach($aParentOfLines as $aAddressLine)
{
_one_row($aAddressLine);
}
- echo '
';
}
if (sizeof($aParentOfLines) >= 500) {
echo 'There are more child objects which are not shown.
';
}
}
- // headline('Other Parts');
- // headline('Linked To');
+ echo "\n";
?>
@@ -263,21 +234,21 @@