]> git.openstreetmap.org Git - nominatim.git/commitdiff
avoid warnings when geometry of object cannot be determined
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 6 Feb 2012 23:14:21 +0000 (23:14 +0000)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 6 Feb 2012 23:14:21 +0000 (23:14 +0000)
lib/template/details-html.php
lib/template/search-xml.php
website/search.php

index eca76c7ea275407fac8251a7310eb539e842a615..9124d594c4c56a82a476189147512ba6e43cfac0 100644 (file)
@@ -74,10 +74,12 @@ body {
                        var proj_map = map.getProjectionObject();
                        var latlon;
 <?php
+if (isset($aPolyPoints)) {
 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);;
                        var polygonFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing]),null,style);
index b15c9a2efb7dc5abf5e90cd6e56eef663bb2bc1a..6e48be4c2ce3c3ae7a004cf6838b5d5f03e5ac1b 100644 (file)
@@ -42,7 +42,7 @@
                        echo ','.$aResult['aBoundingBox'][3];\r
                        echo '"';\r
 \r
-                       if ($bShowPolygons)\r
+                       if ($bShowPolygons && isset($aResult['aPolyPoints']))\r
                        {\r
                                echo ' polygonpoints=\'';\r
                                echo javascript_renderData($aResult['aPolyPoints']);\r
index 4a75c768809b14b6a6204a1be4fae4e500534aab..7169c829abba66041c1d7a31c6940e418499be9c 100755 (executable)
                                }
 
                                // Output data suitable for display (points and a bounding box)
-                               if ($bShowPolygons)
+                               if ($bShowPolygons && isset($aPolyPoints))
                                {
                                        $aResult['aPolyPoints'] = array();
                                        foreach($aPolyPoints as $aPoint)