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);
68 strokeColor: "#75ADFF",
74 var proj_EPSG4326 = new OpenLayers.Projection("EPSG:4326");
75 var proj_map = map.getProjectionObject();
78 if (isset($aPolyPoints))
80 foreach($aPolyPoints as $aPolyPoint)
82 echo " pointList.push(new OpenLayers.Geometry.Point(".$aPolyPoint[1].",".$aPolyPoint[2]."));\n";
86 var linearRing = new OpenLayers.Geometry.LinearRing(pointList).transform(proj_EPSG4326, proj_map);;
87 var polygonFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing]),null,style);
88 vectorLayer.addFeatures([polygonFeature]);
90 map.zoomToExtent(new OpenLayers.Bounds(<?php echo $aPointPolygon['minlon']?>, <?php echo $aPointPolygon['minlat']?>, <?php echo $aPointPolygon['maxlon']?>, <?php echo $aPointPolygon['maxlat']?>).transform(proj_EPSG4326, proj_map));
95 <body onload="init();">
99 if ($aPointDetails['icon'])
101 echo '<img style="float:right;margin-right:40px;" src="'.CONST_Website_BaseURL.'images/mapicons/'.$aPointDetails['icon'].'.n.32.png'.'">';
103 echo $aPointDetails['localname'].'</h1>';
104 echo '<div class="locationdetails">';
106 foreach($aPointDetails['aNames'] as $sKey => $sValue)
108 echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
111 echo ' <div>Type: <span class="type">'.$aPointDetails['class'].':'.$aPointDetails['type'].'</span></div>';
112 echo ' <div>Admin Level: <span class="adminlevel">'.$aPointDetails['admin_level'].'</span></div>';
113 echo ' <div>Rank: <span class="rankaddress">'.$aPointDetails['rank_search_label'].'</span></div>';
114 if ($aPointDetails['importance']) echo ' <div>Importance: <span class="rankaddress">'.$aPointDetails['importance'].'</span></div>';
115 echo ' <div>Coverage: <span class="area">'.($aPointDetails['isarea']=='t'?'Polygon':'Point').'</span></div>';
116 $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
117 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>';
118 if ($aPointDetails['wikipedia'])
120 list($sWikipediaLanguage,$sWikipediaArticle) = explode(':',$aPointDetails['wikipedia']);
121 echo ' <div>Wikipedia Calculated: <span class="wikipedia"><a href="http://'.$sWikipediaLanguage.'.wikipedia.org/wiki/'.urlencode($sWikipediaArticle).'">'.$aPointDetails['wikipedia'].'</a></span></div>';
123 echo ' <div>Extra Tags: ';
124 foreach($aPointDetails['aExtraTags'] as $sKey => $sValue)
126 echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
131 echo '<h2>Address</h2>';
132 echo '<div class=\"address\">';
133 $iPrevRank = 1000000;
134 $sPrevLocalName = '';
135 foreach($aAddressLines as $aAddressLine)
137 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
139 echo '<div class="line'.($aAddressLine['isaddress']=='f'?' notused':'').'">';
140 if (!($iPrevRank<=$aAddressLine['rank_address'] || $sPrevLocalName == $aAddressLine['localname']))
142 $iPrevRank = $aAddressLine['rank_address'];
143 $sPrevLocalName = $aAddressLine['localname'];
145 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
147 echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
148 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>';
149 echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
150 echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
151 // echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
152 echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
153 echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
161 echo '<h2>Linked Places</h2>';
162 echo '<div class=\"linked\">';
163 foreach($aLinkedLines as $aAddressLine)
165 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
167 echo '<div class="line">';
168 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
170 echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
171 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>';
172 echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
173 echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
174 // echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
175 echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
176 echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
183 if ($aPlaceSearchNameKeywords)
185 echo '<h2>Name Keywords</h2>';
186 foreach($aPlaceSearchNameKeywords as $aRow)
188 echo '<div>'.$aRow['word_token'].'</div>';
192 if ($aPlaceSearchAddressKeywords)
194 echo '<h2>Address Keywords</h2>';
195 foreach($aPlaceSearchAddressKeywords as $aRow)
197 echo '<div>'.($aRow['word_token'][0]==' '?'*':'').$aRow['word_token'].'('.$aRow['word_id'].')'.'</div>';
201 if (sizeof($aParentOfLines))
203 echo '<h2>Parent Of (named features only):</h2>';
205 $aGroupedAddressLines = array();
206 foreach($aParentOfLines as $aAddressLine)
208 if (!isset($aGroupedAddressLines[$aAddressLine['type']])) $aGroupedAddressLines[$aAddressLine['type']] = array();
209 $aGroupedAddressLines[$aAddressLine['type']][] = $aAddressLine;
211 foreach($aGroupedAddressLines as $sGroupHeading => $aParentOfLines)
213 $sGroupHeading = ucwords($sGroupHeading);
214 echo "<h3>$sGroupHeading</h3>";
215 foreach($aParentOfLines as $aAddressLine)
217 $aAddressLine['localname'] = $aAddressLine['localname']?$aAddressLine['localname']:$aAddressLine['housenumber'];
218 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
220 echo '<div class="line">';
221 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
223 // echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
224 // echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
225 // echo ', <span class="rankaddress">'.$aAddressLine['rank_address'].'</span>';
226 echo '<span class="area">'.($aAddressLine['isarea']=='t'?'Polygon':'Point').'</span>';
227 echo ', <span class="distance">~'.(round($aAddressLine['distance']*69,1)).' miles</span>';
228 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>';
229 echo ', <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
237 // echo '<h2>Other Parts:</h2>';
238 // echo '<h2>Linked To:</h2>';