]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/template/address-xml.php
don't print address details if they are not requested
[nominatim.git] / lib / template / address-xml.php
index dc9f054855354e10ec556a301403978950f35752..185601ad2f5f3c874feff0ff4f6392d5b246ab5e 100644 (file)
                if ($aPlace['place_id']) echo ' place_id="'.$aPlace['place_id'].'"';\r
                if ($aPlace['osm_type'] && $aPlace['osm_id']) echo ' osm_type="'.($aPlace['osm_type']=='N'?'node':($aPlace['osm_type']=='W'?'way':'relation')).'"'.' osm_id="'.$aPlace['osm_id'].'"';\r
                if ($aPlace['ref']) echo ' ref="'.htmlspecialchars($aPlace['ref']).'"';\r
+               if (isset($aPlace['lat'])) echo ' lat="'.htmlspecialchars($aPlace['lat']).'"';\r
+               if (isset($aPlace['lon'])) echo ' lon="'.htmlspecialchars($aPlace['lon']).'"';\r
                echo ">".htmlspecialchars($aPlace['langaddress'])."</result>";\r
 \r
-               echo "<addressparts>";\r
-               foreach($aAddress as $sKey => $sValue)\r
-               {\r
-                       $sKey = str_replace(' ','_',$sKey);\r
-                       echo "<$sKey>";\r
-                       echo htmlspecialchars($sValue);\r
-                       echo "</$sKey>";\r
-               }\r
-               echo "</addressparts>";\r
+        if ($bShowAddressDetails) {\r
+                       echo "<addressparts>";\r
+                       foreach($aAddress as $sKey => $sValue)\r
+                       {\r
+                               $sKey = str_replace(' ','_',$sKey);\r
+                               echo "<$sKey>";\r
+                               echo htmlspecialchars($sValue);\r
+                               echo "</$sKey>";\r
+                       }\r
+                       echo "</addressparts>";\r
+        }\r
        }\r
        \r
        echo "</reversegeocode>";\r