2 header("content-type: text/html; charset=UTF-8");
4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5 <html xmlns="http://www.w3.org/1999/xhtml">
7 <title>OpenStreetMap Nominatim: <?php echo $aPointDetails['localname'];?></title>
8 <link href="css/details.css" rel="stylesheet" type="text/css" />
9 <script src="js/OpenLayers.js" type="text/javascript"></script>
10 <script src="js/tiles.js" type="text/javascript"></script>
11 <script type="text/javascript">
16 map = new OpenLayers.Map ("map", {
18 new OpenLayers.Control.Permalink(),
19 new OpenLayers.Control.Navigation(),
20 new OpenLayers.Control.PanZoomBar(),
21 new OpenLayers.Control.MouseDefaults(),
22 new OpenLayers.Control.MousePosition(),
23 new OpenLayers.Control.Attribution()],
24 maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
25 maxResolution: 156543.0399,
28 projection: new OpenLayers.Projection("EPSG:900913"),
29 displayProjection: new OpenLayers.Projection("EPSG:4326")
31 map.addLayer(new OpenLayers.Layer.OSM.<?php echo CONST_Tile_Default;?>("Default"));
33 var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
34 layer_style.fillOpacity = 0.2;
35 layer_style.graphicOpacity = 0.2;
37 vectorLayer = new OpenLayers.Layer.Vector("Points", {style: layer_style});
38 map.addLayer(vectorLayer);
40 var proj_EPSG4326 = new OpenLayers.Projection("EPSG:4326");
41 var proj_map = map.getProjectionObject();
43 freader = new OpenLayers.Format.WKT({
44 'internalProjection': proj_map,
45 'externalProjection': proj_EPSG4326
48 var feature = freader.read('<?php echo $aPointDetails['outlinestring'];?>');
50 map.zoomToExtent(feature.geometry.getBounds());
53 strokeColor: "#75ADFF",
55 strokeWidth: <?php echo ($aPointDetails['isarea']=='t'?'2':'5');?>,
60 vectorLayer.addFeatures([feature]);
65 <body onload="init();">
69 if ($aPointDetails['icon'])
71 echo '<img style="float:right;margin-right:40px;" src="'.CONST_Website_BaseURL.'images/mapicons/'.$aPointDetails['icon'].'.n.32.png'.'">';
73 echo $aPointDetails['localname'].'</h1>';
74 echo '<div class="locationdetails">';
76 foreach($aPointDetails['aNames'] as $sKey => $sValue)
78 echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
81 echo ' <div>Type: <span class="type">'.$aPointDetails['class'].':'.$aPointDetails['type'].'</span></div>';
82 echo ' <div>Last Updated: <span class="type">'.$aPointDetails['indexed_date'].'</span></div>';
83 echo ' <div>Admin Level: <span class="adminlevel">'.$aPointDetails['admin_level'].'</span></div>';
84 echo ' <div>Rank: <span class="rankaddress">'.$aPointDetails['rank_search_label'].'</span></div>';
85 if ($aPointDetails['importance']) echo ' <div>Importance: <span class="rankaddress">'.$aPointDetails['importance'].'</span></div>';
86 echo ' <div>Coverage: <span class="area">'.($aPointDetails['isarea']=='t'?'Polygon':'Point').'</span></div>';
87 $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
88 if ($sOSMType) echo ' <div>OSM: <span class="osm">'.$sOSMType.' <a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aPointDetails['osm_id'].'">'.$aPointDetails['osm_id'].'</a></span></div>';
89 if ($aPointDetails['wikipedia'])
91 list($sWikipediaLanguage,$sWikipediaArticle) = explode(':',$aPointDetails['wikipedia']);
92 echo ' <div>Wikipedia Calculated: <span class="wikipedia"><a href="http://'.$sWikipediaLanguage.'.wikipedia.org/wiki/'.urlencode($sWikipediaArticle).'">'.$aPointDetails['wikipedia'].'</a></span></div>';
94 echo ' <div>Extra Tags: ';
95 foreach($aPointDetails['aExtraTags'] as $sKey => $sValue)
97 echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
102 echo '<h2>Address</h2>';
103 echo '<div class="address">';
104 $iPrevRank = 1000000;
105 $sPrevLocalName = '';
106 foreach($aAddressLines as $aAddressLine)
108 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
110 echo '<div class="line'.($aAddressLine['isaddress']=='f'?' notused':'').'">';
111 if (!($iPrevRank<=$aAddressLine['rank_address'] || $sPrevLocalName == $aAddressLine['localname']))
113 $iPrevRank = $aAddressLine['rank_address'];
114 $sPrevLocalName = $aAddressLine['localname'];
116 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
118 echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
119 if ($sOSMType) echo ', <span class="osm">'.$sOSMType.' <a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aAddressLine['osm_id'].'">'.$aAddressLine['osm_id'].'</a></span>';
120 if (isset($aAddressLine['admin_level'])) echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
121 if (isset($aAddressLine['rank_search_label'])) echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
122 // echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
123 echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
124 echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
132 echo '<h2>Linked Places</h2>';
133 echo '<div class=\"linked\">';
134 foreach($aLinkedLines as $aAddressLine)
136 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
138 echo '<div class="line">';
139 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
141 echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
142 if ($sOSMType) echo ', <span class="osm"><span class="label"></span>'.$sOSMType.' <a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aAddressLine['osm_id'].'">'.$aAddressLine['osm_id'].'</a></span>';
143 echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
144 echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
145 // echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
146 echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
147 echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
154 if ($aPlaceSearchNameKeywords)
156 echo '<h2>Name Keywords</h2>';
157 foreach($aPlaceSearchNameKeywords as $aRow)
159 echo '<div>'.$aRow['word_token'].'</div>';
163 if ($aPlaceSearchAddressKeywords)
165 echo '<h2>Address Keywords</h2>';
166 foreach($aPlaceSearchAddressKeywords as $aRow)
168 echo '<div>'.($aRow['word_token'][0]==' '?'*':'').$aRow['word_token'].'('.$aRow['word_id'].')'.'</div>';
172 if (sizeof($aParentOfLines))
174 echo '<h2>Parent Of:</h2>';
176 $aGroupedAddressLines = array();
177 foreach($aParentOfLines as $aAddressLine)
179 if (!isset($aGroupedAddressLines[$aAddressLine['type']])) $aGroupedAddressLines[$aAddressLine['type']] = array();
180 $aGroupedAddressLines[$aAddressLine['type']][] = $aAddressLine;
182 foreach($aGroupedAddressLines as $sGroupHeading => $aParentOfLines)
184 $sGroupHeading = ucwords($sGroupHeading);
185 echo "<h3>$sGroupHeading</h3>";
186 foreach($aParentOfLines as $aAddressLine)
188 $aAddressLine['localname'] = $aAddressLine['localname']?$aAddressLine['localname']:$aAddressLine['housenumber'];
189 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
191 echo '<div class="line">';
192 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
194 // echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
195 // echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
196 // echo ', <span class="rankaddress">'.$aAddressLine['rank_address'].'</span>';
197 echo '<span class="area">'.($aAddressLine['isarea']=='t'?'Polygon':'Point').'</span>';
198 echo ', <span class="distance">~'.(round($aAddressLine['distance']*69,1)).' miles</span>';
199 if ($sOSMType) echo ', <span class="osm"><span class="label"></span>'.$sOSMType.' <a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aAddressLine['osm_id'].'">'.$aAddressLine['osm_id'].'</a></span>';
200 echo ', <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
205 if (sizeof($aParentOfLines) >= 500) {
206 echo '<p>There are more child objects which are not shown.</p>';
211 // echo '<h2>Other Parts:</h2>';
212 // echo '<h2>Linked To:</h2>';