2 header("content-type: text/html; charset=UTF-8");
4 <?php include(CONST_BasePath.'/lib/template/includes/html-header.php'); ?>
5 <link href="css/common.css" rel="stylesheet" type="text/css" />
6 <link href="css/details.css" rel="stylesheet" type="text/css" />
12 function headline($sTitle)
14 echo "<tr class='all-columns'><td colspan='6'><h2>".$sTitle."</h2></td></tr>\n";
17 function headline3($sTitle)
19 echo "<tr class='all-columns'><td colspan='6'><h3>".$sTitle."</h3></td></tr>\n";
23 function format_distance($fDistance)
25 // $fDistance is in meters
30 elseif ($fDistance < 1000)
32 return'<abbr class="distance" title="'.$fDistance.'">~'.(round($fDistance,0)).' m</abbr>';
36 return'<abbr class="distance" title="'.$fDistance.'">~'.(round($fDistance/1000,1)).' km</abbr>';
40 function kv($sKey,$sValue)
42 echo ' <tr><td>' . $sKey . '</td><td>'.$sValue.'</td></tr>'. "\n";
46 function hash_to_subtable($aAssociatedList)
49 foreach ($aAssociatedList as $sKey => $sValue) {
50 $sHTML = $sHTML.' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>'."\n";
55 function map_icon($sIcon)
58 echo '<img id="mapicon" src="'.CONST_Website_BaseURL.'images/mapicons/'.$sIcon.'.n.32.png'.'" alt="'.$sIcon.'" />';
63 function _one_row($aAddressLine){
64 $bNotUsed = (isset($aAddressLine['isaddress']) && $aAddressLine['isaddress'] == 'f');
66 echo '<tr class="' . ($bNotUsed?'notused':'') . '">'."\n";
67 echo ' <td class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>')."</td>\n";
68 echo ' <td>' . $aAddressLine['class'].':'.$aAddressLine['type'] . "</td>\n";
69 echo ' <td>' . osmLink($aAddressLine) . "</td>\n";
70 echo ' <td>' . (isset($aAddressLine['rank_address']) ? $aAddressLine['rank_address'] : '') . "</td>\n";
71 echo ' <td>' . ($aAddressLine['admin_level'] < 15 ? $aAddressLine['admin_level'] : '') . "</td>\n";
72 echo ' <td>' . format_distance($aAddressLine['distance'])."</td>\n";
73 echo ' <td>' . detailsLink($aAddressLine,'details >') . "</td>\n";
77 function _one_keyword_row($keyword_token,$word_id){
80 // mark partial tokens (those starting with a space) with a star for readability
81 echo ($keyword_token[0]==' '?'*':'');
85 echo '</td><td>word id: '.$word_id;
94 <body id="details-page">
95 <?php include(CONST_BasePath.'/lib/template/includes/html-top-navigation.php'); ?>
96 <div class="container">
98 <div class="col-sm-10">
100 <?php echo $aPointDetails['localname'] ?>
101 <small><?php echo detailsPermaLink($aPointDetails, 'link to this page') ?></small>
104 <div class="col-sm-2 text-right">
105 <?php map_icon($aPointDetails['icon']) ?>
109 <div class="col-md-6">
110 <table id="locationdetails" class="table table-striped">
114 kv('Name' , hash_to_subtable($aPointDetails['aNames']) );
115 kv('Type' , $aPointDetails['class'].':'.$aPointDetails['type'] );
116 kv('Last Updated' , (new DateTime('@'.$aPointDetails['indexed_epoch']))->format(DateTime::RFC822) );
117 kv('Admin Level' , $aPointDetails['admin_level'] );
118 kv('Rank' , $aPointDetails['rank_search_label'] );
119 if ($aPointDetails['calculated_importance']) {
120 kv('Importance' , $aPointDetails['calculated_importance'].($aPointDetails['importance']?'':' (estimated)') );
122 kv('Coverage' , ($aPointDetails['isarea']=='t'?'Polygon':'Point') );
123 kv('Centre Point' , $aPointDetails['lat'].','.$aPointDetails['lon'] );
124 kv('OSM' , osmLink($aPointDetails) );
125 if ($aPointDetails['wikipedia'])
127 kv('Wikipedia Calculated' , wikipediaLink($aPointDetails) );
130 kv('Computed Postcode', $aPointDetails['postcode']);
131 kv('Address Tags' , hash_to_subtable($aPointDetails['aAddressTags']) );
132 kv('Extra Tags' , hash_to_subtable($aPointDetails['aExtraTags']) );
139 <div class="col-md-6">
145 <div class="col-md-12">
149 <table id="address" class="table table-striped table-responsive">
155 <td>Address rank</td>
164 foreach ($aAddressLines as $aAddressLine) {
165 _one_row($aAddressLine);
174 headline('Linked Places');
175 foreach ($aLinkedLines as $aAddressLine) {
176 _one_row($aAddressLine);
182 if ($bIncludeKeywords)
184 headline('Name Keywords');
185 foreach ($aPlaceSearchNameKeywords as $aRow) {
186 _one_keyword_row($aRow['word_token'], $aRow['word_id']);
189 headline('Address Keywords');
190 foreach ($aPlaceSearchAddressKeywords as $aRow) {
191 _one_keyword_row($aRow['word_token'], $aRow['word_id']);
195 if (!empty($aHierarchyLines))
197 headline('Parent Of');
199 $aGroupedAddressLines = array();
200 foreach ($aHierarchyLines as $aAddressLine) {
201 if ($aAddressLine['type'] == 'yes') $sType = $aAddressLine['class'];
202 else $sType = $aAddressLine['type'];
204 if (!isset($aGroupedAddressLines[$sType]))
205 $aGroupedAddressLines[$sType] = array();
206 $aGroupedAddressLines[$sType][] = $aAddressLine;
208 foreach ($aGroupedAddressLines as $sGroupHeading => $aHierarchyLines) {
209 $sGroupHeading = ucwords($sGroupHeading);
210 headline3($sGroupHeading);
212 foreach ($aHierarchyLines as $aAddressLine) {
213 _one_row($aAddressLine);
216 if (count($aHierarchyLines) >= 500) {
217 echo '<p>There are more child objects which are not shown.</p>';
228 <script type="text/javascript">
231 $aNominatimMapInit = array(
232 'tile_url' => $sTileURL,
233 'tile_attribution' => $sTileAttribution
235 echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
238 'asgeojson' => $aPointDetails['asgeojson'],
239 'lon' => $aPointDetails['lon'],
240 'lat' => $aPointDetails['lat'],
242 echo 'var nominatim_result = ' . json_encode($aPlace, JSON_PRETTY_PRINT) . ';';
250 <?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>