return $aIcons[$sClassPlace] ?? null;
}
+/**
+ * Get an icon for the given object with its full URL.
+ */
+function getIconFile($aPlace)
+{
+ $sIcon = getIcon($aPlace);
+
+ if (!isset($sIcon)) {
+ return null;
+ }
+
+ return CONST_Website_BaseURL.'images/mapicons/'.$sIcon.'.p.20.png';
+}
+
/**
* Return a class importance value for the given place.
*
}
// Is there an icon set for this type of result?
- $sIcon = ClassTypes\getIcon($aResult);
+ $sIcon = ClassTypes\getIconFile($aResult);
if (isset($sIcon)) {
- $aResult['icon'] = CONST_Website_BaseURL.'images/mapicons/'.$sIcon.'.p.20.png';
+ $aResult['icon'] = $sIcon;
}
$sLabel = ClassTypes\getLabel($aResult);
return $sHTML;
}
- function map_icon($sIcon)
+ function map_icon($aPlace)
{
+ $sIcon = Nominatim\ClassTypes\getIconFile($aPlace);
if (isset($sIcon)) {
- echo '<img id="mapicon" src="'.CONST_Website_BaseURL.'images/mapicons/'.$sIcon.'.n.32.png'.'" alt="'.$sIcon.'" />';
+ $sLabel = Nominatim\ClassTypes\getIcon($aPlace);
+ echo '<img id="mapicon" src="'.$sIcon.'" alt="'.$sLabel.'" />';
}
}
</h1>
</div>
<div class="col-sm-2 text-right">
- <?php map_icon($aPointDetails['icon']) ?>
+ <?php map_icon($aPointDetails) ?>
</div>
</div>
<div class="row">
$aPlaceDetails['extratags'] = $aPointDetails['aExtraTags'];
$aPlaceDetails['calculated_wikipedia'] = $aPointDetails['wikipedia'];
-if (isset($aPointDetails['icon'])) {
- $aPlaceDetails['icon'] = CONST_Website_BaseURL.'images/mapicons/'.$aPointDetails['icon'].'.n.32.png';
+$sIcon = Nominatim\ClassTypes\getIconFile($aPointDetails);
+if (isset($sIcon)) {
+ $aPlaceDetails['icon'] = $sIcon;
}
$aPlaceDetails['rank_address'] = (int) $aPointDetails['rank_address'];
}
$aPointDetails['localname'] = $aPointDetails['localname']?$aPointDetails['localname']:$aPointDetails['housenumber'];
-$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)