mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 13:24:07 +00:00
also adapt uses of ClassTypes in website/
This commit is contained in:
@@ -897,7 +897,7 @@ class Geocode
|
|||||||
foreach ($aSearchResults as $iIdx => $aResult) {
|
foreach ($aSearchResults as $iIdx => $aResult) {
|
||||||
$fRadius = ClassTypes\getDefRadius($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) {
|
if ($aOutlineResult) {
|
||||||
$aResult = array_merge($aResult, $aOutlineResult);
|
$aResult = array_merge($aResult, $aOutlineResult);
|
||||||
}
|
}
|
||||||
@@ -905,7 +905,7 @@ class Geocode
|
|||||||
// Is there an icon set for this type of result?
|
// Is there an icon set for this type of result?
|
||||||
$sIcon = ClassTypes\getIcon($aResult);
|
$sIcon = ClassTypes\getIcon($aResult);
|
||||||
if (isset($sIcon)) {
|
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);
|
$sLabel = ClassTypes\getLabel($aResult);
|
||||||
@@ -941,7 +941,7 @@ class Geocode
|
|||||||
// - number of exact matches from the query
|
// - number of exact matches from the query
|
||||||
$aResult['foundorder'] -= $aResults[$aResult['place_id']]->iExactMatches;
|
$aResult['foundorder'] -= $aResults[$aResult['place_id']]->iExactMatches;
|
||||||
// - importance of the class/type
|
// - importance of the class/type
|
||||||
$iClassImportance = ClassTypes/getImportance($aResult);
|
$iClassImportance = ClassTypes\getImportance($aResult);
|
||||||
if (isset($iClassImportance)) {
|
if (isset($iClassImportance)) {
|
||||||
$aResult['foundorder'] += 0.0001 * $iClassImportance;
|
$aResult['foundorder'] += 0.0001 * $iClassImportance;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
function map_icon($sIcon)
|
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.'" />';
|
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['extratags'] = $aPointDetails['aExtraTags'];
|
||||||
$aPlaceDetails['calculated_wikipedia'] = $aPointDetails['wikipedia'];
|
$aPlaceDetails['calculated_wikipedia'] = $aPointDetails['wikipedia'];
|
||||||
if ($aPointDetails['icon']) {
|
if (isset($aPointDetails['icon'])) {
|
||||||
$aPlaceDetails['icon'] = CONST_Website_BaseURL.'images/mapicons/'.$aPointDetails['icon'].'.n.32.png';
|
$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['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
|
$aPointDetails['rank_search_label'] = getSearchRankLabel($aPointDetails['rank_search']); // only used in HTML format
|
||||||
|
|
||||||
// Get all alternative names (languages, etc)
|
// Get all alternative names (languages, etc)
|
||||||
|
|||||||
@@ -103,10 +103,8 @@ if (!empty($aParentOfLines)) {
|
|||||||
echo '<h2>Parent Of:</h2>';
|
echo '<h2>Parent Of:</h2>';
|
||||||
$aGroupedAddressLines = array();
|
$aGroupedAddressLines = array();
|
||||||
foreach ($aParentOfLines as $aAddressLine) {
|
foreach ($aParentOfLines as $aAddressLine) {
|
||||||
$aAddressLine['label'] = Nominatim\ClassTypes\getProperty($aAddressLine, 'label');
|
$aAddressLine['label'] = Nominatim\ClassTypes\getLabel($aAddressLine)
|
||||||
if (!$aAddressLine['label']) {
|
?? ucwords($aAddressLine['type']);
|
||||||
$aAddressLine['label'] = ucwords($aAddressLine['type']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($aGroupedAddressLines[$aAddressLine['label']])) $aGroupedAddressLines[$aAddressLine['label']] = array();
|
if (!isset($aGroupedAddressLines[$aAddressLine['label']])) $aGroupedAddressLines[$aAddressLine['label']] = array();
|
||||||
$aGroupedAddressLines[$aAddressLine['label']][] = $aAddressLine;
|
$aGroupedAddressLines[$aAddressLine['label']][] = $aAddressLine;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ foreach ($aOsmIds as $sItem) {
|
|||||||
$oPlace['place_id'],
|
$oPlace['place_id'],
|
||||||
$oPlace['lon'],
|
$oPlace['lon'],
|
||||||
$oPlace['lat'],
|
$oPlace['lat'],
|
||||||
Nominatim\ClassTypes\getProperty($oPlace, 'defdiameter', 0.0001)
|
Nominatim\ClassTypes\getDefRadius($oPlace)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($aOutlineResult) {
|
if ($aOutlineResult) {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ if (isset($aPlace)) {
|
|||||||
$aPlace['place_id'],
|
$aPlace['place_id'],
|
||||||
$aPlace['lon'],
|
$aPlace['lon'],
|
||||||
$aPlace['lat'],
|
$aPlace['lat'],
|
||||||
Nominatim\ClassTypes\getProperty($aPlace, 'defdiameter', 0.0001),
|
Nominatim\ClassTypes\getDefRadius($aPlace),
|
||||||
$fLat,
|
$fLat,
|
||||||
$fLon
|
$fLon
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user