mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-12-25 05:52:32 +03:00
also adapt uses of ClassTypes in website/
This commit is contained in:
parent
528fe6553f
commit
859347523f
@ -897,7 +897,7 @@ class Geocode
|
||||
foreach ($aSearchResults as $iIdx => $aResult) {
|
||||
$fRadius = ClassTypes\getDefRadius($aResult);
|
||||
|
||||
$aOutlineResult = $this->oPlaceLookup->getOutlines($aResult['place_id'], $aResult['lon'], $aResult['lat'], $fDiameter);
|
||||
$aOutlineResult = $this->oPlaceLookup->getOutlines($aResult['place_id'], $aResult['lon'], $aResult['lat'], $fRadius);
|
||||
if ($aOutlineResult) {
|
||||
$aResult = array_merge($aResult, $aOutlineResult);
|
||||
}
|
||||
@ -905,7 +905,7 @@ class Geocode
|
||||
// Is there an icon set for this type of result?
|
||||
$sIcon = ClassTypes\getIcon($aResult);
|
||||
if (isset($sIcon)) {
|
||||
$aResult['icon'] = CONST_Website_BaseURL.'images/mapicons/'.$aIcon.'.p.20.png';
|
||||
$aResult['icon'] = CONST_Website_BaseURL.'images/mapicons/'.$sIcon.'.p.20.png';
|
||||
}
|
||||
|
||||
$sLabel = ClassTypes\getLabel($aResult);
|
||||
@ -941,7 +941,7 @@ class Geocode
|
||||
// - number of exact matches from the query
|
||||
$aResult['foundorder'] -= $aResults[$aResult['place_id']]->iExactMatches;
|
||||
// - importance of the class/type
|
||||
$iClassImportance = ClassTypes/getImportance($aResult);
|
||||
$iClassImportance = ClassTypes\getImportance($aResult);
|
||||
if (isset($iClassImportance)) {
|
||||
$aResult['foundorder'] += 0.0001 * $iClassImportance;
|
||||
} else {
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
function map_icon($sIcon)
|
||||
{
|
||||
if ($sIcon){
|
||||
if (isset($sIcon)) {
|
||||
echo '<img id="mapicon" src="'.CONST_Website_BaseURL.'images/mapicons/'.$sIcon.'.n.32.png'.'" alt="'.$sIcon.'" />';
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ $aPlaceDetails['calculated_importance'] = (float) $aPointDetails['calculated_imp
|
||||
|
||||
$aPlaceDetails['extratags'] = $aPointDetails['aExtraTags'];
|
||||
$aPlaceDetails['calculated_wikipedia'] = $aPointDetails['wikipedia'];
|
||||
if ($aPointDetails['icon']) {
|
||||
if (isset($aPointDetails['icon'])) {
|
||||
$aPlaceDetails['icon'] = CONST_Website_BaseURL.'images/mapicons/'.$aPointDetails['icon'].'.n.32.png';
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ if (!$aPointDetails) {
|
||||
}
|
||||
|
||||
$aPointDetails['localname'] = $aPointDetails['localname']?$aPointDetails['localname']:$aPointDetails['housenumber'];
|
||||
$aPointDetails['icon'] = Nominatim\ClassTypes\getProperty($aPointDetails, 'icon', false);
|
||||
$aPointDetails['icon'] = Nominatim\ClassTypes\getIcon($aPointDetails);
|
||||
$aPointDetails['rank_search_label'] = getSearchRankLabel($aPointDetails['rank_search']); // only used in HTML format
|
||||
|
||||
// Get all alternative names (languages, etc)
|
||||
|
@ -103,10 +103,8 @@ if (!empty($aParentOfLines)) {
|
||||
echo '<h2>Parent Of:</h2>';
|
||||
$aGroupedAddressLines = array();
|
||||
foreach ($aParentOfLines as $aAddressLine) {
|
||||
$aAddressLine['label'] = Nominatim\ClassTypes\getProperty($aAddressLine, 'label');
|
||||
if (!$aAddressLine['label']) {
|
||||
$aAddressLine['label'] = ucwords($aAddressLine['type']);
|
||||
}
|
||||
$aAddressLine['label'] = Nominatim\ClassTypes\getLabel($aAddressLine)
|
||||
?? ucwords($aAddressLine['type']);
|
||||
|
||||
if (!isset($aGroupedAddressLines[$aAddressLine['label']])) $aGroupedAddressLines[$aAddressLine['label']] = array();
|
||||
$aGroupedAddressLines[$aAddressLine['label']][] = $aAddressLine;
|
||||
|
@ -58,7 +58,7 @@ foreach ($aOsmIds as $sItem) {
|
||||
$oPlace['place_id'],
|
||||
$oPlace['lon'],
|
||||
$oPlace['lat'],
|
||||
Nominatim\ClassTypes\getProperty($oPlace, 'defdiameter', 0.0001)
|
||||
Nominatim\ClassTypes\getDefRadius($oPlace)
|
||||
);
|
||||
|
||||
if ($aOutlineResult) {
|
||||
|
@ -55,7 +55,7 @@ if (isset($aPlace)) {
|
||||
$aPlace['place_id'],
|
||||
$aPlace['lon'],
|
||||
$aPlace['lat'],
|
||||
Nominatim\ClassTypes\getProperty($aPlace, 'defdiameter', 0.0001),
|
||||
Nominatim\ClassTypes\getDefRadius($aPlace),
|
||||
$fLat,
|
||||
$fLon
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user