X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/7a31a3d106a2ee0133ece09dfa6a29a0f2894b57..6f383d6073b68409e8da243356eccf5e2847f264:/website/details.php diff --git a/website/details.php b/website/details.php index 08d1d2d8..c9e86312 100755 --- a/website/details.php +++ b/website/details.php @@ -5,6 +5,7 @@ require_once(dirname(dirname(__FILE__)).'/settings/settings.php'); require_once(CONST_BasePath.'/lib/init-website.php'); require_once(CONST_BasePath.'/lib/log.php'); require_once(CONST_BasePath.'/lib/output.php'); +require_once(CONST_BasePath.'/lib/AddressDetails.php'); ini_set('memory_limit', '200M'); $oParams = new Nominatim\ParameterParser(); @@ -135,15 +136,7 @@ if (!$aPointDetails) { } $aPointDetails['localname'] = $aPointDetails['localname']?$aPointDetails['localname']:$aPointDetails['housenumber']; - -$aClassType = getClassTypesWithImportance(); - -$sPointClassType = $aPointDetails['class'].':'.$aPointDetails['type']; -if (isset($aClassType[$sPointClassType]) && $aClassType[$sPointClassType]['icon']) { - $aPointDetails['icon'] = $aClassType[$sPointClassType]['icon']; -} else { - $aPointDetails['icon'] = false; -} +$aPointDetails['icon'] = Nominatim\ClassTypes\getProperty($aPointDetails, 'icon', false); // Get all alternative names (languages, etc) $sSQL = 'SELECT (each(name)).key,(each(name)).value FROM placex '; @@ -172,14 +165,8 @@ if (PEAR::isError($aPointDetails['aExtraTags'])) { // possible timeout // Address $aAddressLines = false; if ($bIncludeAddressDetails) { - $aAddressLines = getAddressDetails( - $oDB, - $sLanguagePrefArraySQL, - $iPlaceID, - $aPointDetails['country_code'], - -1, - true - ); + $oDetails = new Nominatim\AddressDetails($oDB, $iPlaceID, -1, $sLanguagePrefArraySQL); + $aAddressLines = $oDetails->getAddressDetails(true); } // Linked places