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="OpenLayers.js"></script>
35 <script src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script>
36 <script src="prototype-1.6.0.3.js"></script>
37 <script type="text/javascript">
42 map = new OpenLayers.Map ("map", {
44 new OpenLayers.Control.Permalink(),
45 new OpenLayers.Control.Navigation(),
46 new OpenLayers.Control.PanZoomBar(),
47 new OpenLayers.Control.MouseDefaults(),
48 new OpenLayers.Control.MousePosition(),
49 new OpenLayers.Control.Attribution()],
50 maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
51 maxResolution: 156543.0399,
54 projection: new OpenLayers.Projection("EPSG:900913"),
55 displayProjection: new OpenLayers.Projection("EPSG:4326"),
57 map.addLayer(new OpenLayers.Layer.OSM.Mapnik("Mapnik"));
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 foreach($aPolyPoints as $aPolyPoint)
80 echo " pointList.push(new OpenLayers.Geometry.Point(".$aPolyPoint[1].",".$aPolyPoint[2]."));\n";
83 var linearRing = new OpenLayers.Geometry.LinearRing(pointList).transform(proj_EPSG4326, proj_map);;
84 var polygonFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing]),null,style);
85 vectorLayer.addFeatures([polygonFeature]);
87 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));
92 <body onload="init();">
96 if ($aPointDetails['icon'])
98 echo '<img style="float:right;margin-right:40px;" src="'.'http://katie.openstreetmap.org/~twain/images/mapicons/'.$aPointDetails['icon'].'.n.32.png'.'">';
100 echo $aPointDetails['localname'].'</h1>';
101 echo '<div class="locationdetails">';
103 foreach($aPointDetails['aNames'] as $sKey => $sValue)
105 echo ' <div class="line"><span class="name">'.$sValue.'</span> ('.$sKey.')</div>';
108 echo ' <div>Type: <span class="type">'.$aPointDetails['class'].':'.$aPointDetails['type'].'</span></div>';
109 echo ' <div>Admin Level: <span class="adminlevel">'.$aPointDetails['admin_level'].'</span></div>';
110 echo ' <div>Rank: <span class="rankaddress">'.$aPointDetails['rank_search_label'].'</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>';
116 echo '<h2>Address</h2>';
117 echo '<div class=\"address\">';
118 $iPrevRank = 1000000;
119 $sPrevLocalName = '';
120 foreach($aAddressLines as $aAddressLine)
122 $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
124 echo '<div class="line'.($iPrevRank<=$aAddressLine['rank_address'] || $sPrevLocalName == $aAddressLine['localname']?' notused':'').'">';
125 if (!($iPrevRank<=$aAddressLine['rank_address'] || $sPrevLocalName == $aAddressLine['localname']))
127 $iPrevRank = $aAddressLine['rank_address'];
128 $sPrevLocalName = $aAddressLine['localname'];
130 echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
132 echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
133 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>';
134 echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
135 echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
136 echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
137 echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
138 echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
144 if (sizeof($aParentOfLines))
146 echo '<h2>Parent Of (named features only):</h2>';
148 $aGroupedAddressLines = array();
149 foreach($aParentOfLines as $aAddressLine)
151 if (!isset($aGroupedAddressLines[$aAddressLine['type']])) $aGroupedAddressLines[$aAddressLine['type']] = array();
152 $aGroupedAddressLines[$aAddressLine['type']][] = $aAddressLine;
154 foreach($aGroupedAddressLines as $sGroupHeading => $aParentOfLines)
156 $sGroupHeading = ucwords($sGroupHeading);
157 echo "<h3>$sGroupHeading</h3>";
158 foreach($aParentOfLines as $aAddressLine)
160 $aAddressLine['localname'] = $aAddressLine['localname']?$aAddressLine['localname']:$aAddressLine['housenumber'];
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 // echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
168 // echo ', <span class="rankaddress">'.$aAddressLine['rank_address'].'</span>';
169 echo '<span class="area">'.($aAddressLine['isarea']=='t'?'Polygon':'Point').'</span>';
170 echo ', <span class="distance">~'.(round($aAddressLine['distance']*69,1)).' miles</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 ', <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
180 // echo '<h2>Other Parts:</h2>';
181 // echo '<h2>Linked To:</h2>';