2 header("content-type: text/html; charset=UTF-8");
6 <title>OpenStreetMap Nominatim: <?php echo $aPointDetails['localname'];?></title>
13 font: normal 12px/15px arial,sans-serif;
30 border: 2px solid #666;
34 <script src="js/OpenLayers.js"></script>
35 <script src="js/tiles.js"></script>
36 <script type="text/javascript">
41 map = new OpenLayers.Map ("map", {
43 new OpenLayers.Control.Permalink(),
44 new OpenLayers.Control.Navigation(),
45 new OpenLayers.Control.PanZoomBar(),
46 new OpenLayers.Control.MouseDefaults(),
47 new OpenLayers.Control.MousePosition(),
48 new OpenLayers.Control.Attribution()],
49 maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
50 maxResolution: 156543.0399,
53 projection: new OpenLayers.Projection("EPSG:900913"),
54 displayProjection: new OpenLayers.Projection("EPSG:4326")
56 map.addLayer(new OpenLayers.Layer.OSM.<?php echo CONST_Tile_Default;?>("Default",
57 { attribution : '© <a target="_parent" href="http://www.openstreetmap.org">OpenStreetMap</a> and contributors, under an <a target="_parent" href="http://www.openstreetmap.org/copyright">open license</a>'}));
59 var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
60 layer_style.fillOpacity = 0.2;
61 layer_style.graphicOpacity = 0.2;
63 vectorLayer = new OpenLayers.Layer.Vector("Points", {style: layer_style});
64 map.addLayer(vectorLayer);
66 var proj_EPSG4326 = new OpenLayers.Projection("EPSG:4326");
67 var proj_map = map.getProjectionObject();
69 freader = new OpenLayers.Format.WKT({
70 'internalProjection': proj_map,
71 'externalProjection': proj_EPSG4326
74 var feature = freader.read('<?php echo $aPointDetails['outlinestring'];?>');
76 map.zoomToExtent(feature.geometry.getBounds());
79 strokeColor: "#75ADFF",
81 strokeWidth: <?php echo ($aPointDetails['isarea']=='t'?'2':'5');?>,
86 vectorLayer.addFeatures([feature]);
91 <body onload="init();">
95 if ($aPointDetails['icon'])
97 echo '<img style="float:right;margin-right:40px;" src="'.CONST_Website_BaseURL.'images/mapicons/'.$aPointDetails['icon'].'.n.32.png'.'">';
99 echo $aPointDetails['localname'].'</h1>';
100 echo '<div class="locationdetails">';
102 foreach($aPointDetails['aNames'] as $sKey => $sValue)
104 echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
107 echo ' <div>Type: <span class="type">'.$aPointDetails['class'].':'.$aPointDetails['type'].'</span></div>';
108 echo ' <div>Admin Level: <span class="adminlevel">'.$aPointDetails['admin_level'].'</span></div>';
109 echo ' <div>Rank: <span class="rankaddress">'.$aPointDetails['rank_search_label'].'</span></div>';
110 if ($aPointDetails['importance']) echo ' <div>Importance: <span class="rankaddress">'.$aPointDetails['importance'].'</span></div>';
111 echo ' <div>Coverage: <span class="area">'.($aPointDetails['isarea']=='t'?'Polygon':'Point').'</span></div>';
112 $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
113 if ($sOSMType) echo ' <div>OSM: <span class="osm"><span class="label"></span>'.$sOSMType.' <a href="http://www.openstreetmap.org/browse/'.$sOSMType.'/'.$aPointDetails['osm_id'].'">'.$aPointDetails['osm_id'].'</a></span></div>';
114 if ($aPointDetails['wikipedia'])
116 list($sWikipediaLanguage,$sWikipediaArticle) = explode(':',$aPointDetails['wikipedia']);
117 echo ' <div>Wikipedia Calculated: <span class="wikipedia"><a href="http://'.$sWikipediaLanguage.'.wikipedia.org/wiki/'.urlencode($sWikipediaArticle).'">'.$aPointDetails['wikipedia'].'</a></span></div>';
119 echo ' <div>Extra Tags: ';
120 foreach($aPointDetails['aExtraTags'] as $sKey => $sValue)
122 echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
127 echo '<h2>Address</h2>';
128 echo '<div class=\"address\">';
129 $iPrevRank = 1000000;
130 $sPrevLocalName = '';
131 foreach($aAddressLines as $aAddressLine)
133 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
135 echo '<div class="line'.($aAddressLine['isaddress']=='f'?' notused':'').'">';
136 if (!($iPrevRank<=$aAddressLine['rank_address'] || $sPrevLocalName == $aAddressLine['localname']))
138 $iPrevRank = $aAddressLine['rank_address'];
139 $sPrevLocalName = $aAddressLine['localname'];
141 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
143 echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
144 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>';
145 echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
146 if (isset($aAddressLine['rank_search_label'])) echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
147 // echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
148 echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
149 echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
157 echo '<h2>Linked Places</h2>';
158 echo '<div class=\"linked\">';
159 foreach($aLinkedLines as $aAddressLine)
161 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
163 echo '<div class="line">';
164 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
166 echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
167 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>';
168 echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
169 echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
170 // echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
171 echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
172 echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
179 if ($aPlaceSearchNameKeywords)
181 echo '<h2>Name Keywords</h2>';
182 foreach($aPlaceSearchNameKeywords as $aRow)
184 echo '<div>'.$aRow['word_token'].'</div>';
188 if ($aPlaceSearchAddressKeywords)
190 echo '<h2>Address Keywords</h2>';
191 foreach($aPlaceSearchAddressKeywords as $aRow)
193 echo '<div>'.($aRow['word_token'][0]==' '?'*':'').$aRow['word_token'].'('.$aRow['word_id'].')'.'</div>';
197 if (sizeof($aParentOfLines))
199 echo '<h2>Parent Of:</h2>';
201 $aGroupedAddressLines = array();
202 foreach($aParentOfLines as $aAddressLine)
204 if (!isset($aGroupedAddressLines[$aAddressLine['type']])) $aGroupedAddressLines[$aAddressLine['type']] = array();
205 $aGroupedAddressLines[$aAddressLine['type']][] = $aAddressLine;
207 foreach($aGroupedAddressLines as $sGroupHeading => $aParentOfLines)
209 $sGroupHeading = ucwords($sGroupHeading);
210 echo "<h3>$sGroupHeading</h3>";
211 foreach($aParentOfLines as $aAddressLine)
213 $aAddressLine['localname'] = $aAddressLine['localname']?$aAddressLine['localname']:$aAddressLine['housenumber'];
214 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
216 echo '<div class="line">';
217 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
219 // echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
220 // echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
221 // echo ', <span class="rankaddress">'.$aAddressLine['rank_address'].'</span>';
222 echo '<span class="area">'.($aAddressLine['isarea']=='t'?'Polygon':'Point').'</span>';
223 echo ', <span class="distance">~'.(round($aAddressLine['distance']*69,1)).' miles</span>';
224 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>';
225 echo ', <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
230 if (sizeof($aParentOfLines) >= 500) {
231 echo '<p>There are more child objects which are not shown.</p>';
236 // echo '<h2>Other Parts:</h2>';
237 // echo '<h2>Linked To:</h2>';