]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/template/address-jsonv2.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / lib / template / address-jsonv2.php
index 4e751a0d4b458ba4f7cff9fbe7fe592863c92276..92cf4f1cc5025d830ea92556682f2eb8e746348e 100644 (file)
@@ -3,7 +3,7 @@
 
        if (!sizeof($aPlace))
        {
-               if ($sError)
+               if (isset($sError))
                        $aFilteredPlaces['error'] = $sError;
                else
                        $aFilteredPlaces['error'] = 'Unable to geocode';
                 }
                if (isset($aPlace['lat'])) $aFilteredPlaces['lat'] = $aPlace['lat'];
                if (isset($aPlace['lon'])) $aFilteredPlaces['lon'] = $aPlace['lon'];
+
+               $aFilteredPlaces['place_rank'] = $aPlace['rank_search'];
+
                 $aFilteredPlaces['category'] = $aPlace['class'];
                 $aFilteredPlaces['type'] = $aPlace['type'];
+
+               $aFilteredPlaces['importance'] = $aPlace['importance'];
+
                 $aFilteredPlaces['addresstype'] = strtolower($aPlace['addresstype']);
 
                $aFilteredPlaces['display_name'] = $aPlace['langaddress'];
                 $aFilteredPlaces['name'] = $aPlace['placename'];
-               if ($bShowAddressDetails && $aAddress && sizeof($aAddress)) $aFilteredPlaces['address'] = $aAddress;
+               if ($bShowAddressDetails && $aPlace['aAddress'] && sizeof($aPlace['aAddress'])) $aFilteredPlaces['address'] = $aPlace['aAddress'];
        }
 
        javascript_renderData($aFilteredPlaces);