]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/template/details-html.php
Update details.php to show linked places
[nominatim.git] / lib / template / details-html.php
index 721af44de7add3bcb36bc9ca2f60521e3b02d77c..c438659b6e7f107854389b37f65a5ed1f2966739 100644 (file)
@@ -33,7 +33,6 @@ body {
     </style>
        <script src="js/OpenLayers.js"></script>
        <script src="js/tiles.js"></script>
-       <script src="prototype-1.6.0.3.js"></script>
        <script type="text/javascript">
         
                var map;
@@ -75,9 +74,12 @@ body {
                        var proj_map = map.getProjectionObject();
                        var latlon;
 <?php
-foreach($aPolyPoints as $aPolyPoint)
+if (isset($aPolyPoints))
 {
-       echo "                        pointList.push(new OpenLayers.Geometry.Point(".$aPolyPoint[1].",".$aPolyPoint[2]."));\n";
+       foreach($aPolyPoints as $aPolyPoint)
+       {
+               echo "                        pointList.push(new OpenLayers.Geometry.Point(".$aPolyPoint[1].",".$aPolyPoint[2]."));\n";
+       }
 }
 ?>
                        var linearRing = new OpenLayers.Geometry.LinearRing(pointList).transform(proj_EPSG4326, proj_map);;
@@ -140,7 +142,7 @@ foreach($aPolyPoints as $aPolyPoint)
                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>';
                echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
                echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
-               echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
+//             echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
                echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
                echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
                echo ')';
@@ -148,6 +150,30 @@ foreach($aPolyPoints as $aPolyPoint)
        }
        echo '</div>';
 
+       if ($aLinkedLines)
+       {
+               echo '<h2>Linked Places</h2>';
+               echo '<div class=\"linked\">';
+               foreach($aLinkedLines as $aAddressLine)
+               {       
+                       $sOSMType = ($aAddressLine['osm_type'] == 'N'?'node':($aAddressLine['osm_type'] == 'W'?'way':($aAddressLine['osm_type'] == 'R'?'relation':'')));
+
+                       echo '<div class="line">';
+                       echo '<span class="name">'.(trim($aAddressLine['localname'])?$aAddressLine['localname']:'<span class="noname">No Name</span>').'</span>';
+                       echo ' (';
+                       echo '<span class="type"><span class="label">Type: </span>'.$aAddressLine['class'].':'.$aAddressLine['type'].'</span>';
+                       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>';
+                       echo ', <span class="adminlevel">'.$aAddressLine['admin_level'].'</span>';
+                       echo ', <span class="rankaddress">'.$aAddressLine['rank_search_label'].'</span>';
+//                     echo ', <span class="area">'.($aAddressLine['fromarea']=='t'?'Polygon':'Point').'</span>';
+                       echo ', <span class="distance">'.$aAddressLine['distance'].'</span>';
+                       echo ' <a href="details.php?place_id='.$aAddressLine['place_id'].'">GOTO</a>';
+                       echo ')';
+                       echo '</div>';
+               }
+               echo '</div>';
+       }
+
        if ($aPlaceSearchNameKeywords)
        {
                echo '<h2>Name Keywords</h2>';