]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/template/address-xml.php
simplify constructor of SetupFunctions
[nominatim.git] / lib / template / address-xml.php
index 6183b284dbc3e8df471ffc719e438e1de83dd17a..a17da738215b0ee0c354aa239750df4698f3999e 100644 (file)
@@ -11,7 +11,7 @@ echo " attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.ope
 echo " querystring='".htmlspecialchars($_SERVER['QUERY_STRING'], ENT_QUOTES)."'";
 echo ">\n";
 
-if (!sizeof($aPlace)) {
+if (empty($aPlace)) {
     if (isset($sError))
         echo "<error>$sError</error>";
     else echo '<error>Unable to geocode</error>';
@@ -48,9 +48,9 @@ if (!sizeof($aPlace)) {
     }
     echo '>'.htmlspecialchars($aPlace['langaddress']).'</result>';
 
-    if (isset($aPlace['aAddress'])) {
+    if (isset($aPlace['address'])) {
         echo '<addressparts>';
-        foreach ($aPlace['aAddress'] as $sKey => $sValue) {
+        foreach ($aPlace['address']->getAddressNames() as $sKey => $sValue) {
             $sKey = str_replace(' ', '_', $sKey);
             echo "<$sKey>";
             echo htmlspecialchars($sValue);