diff --git a/lib/ClassTypes.php b/lib/ClassTypes.php
index 971f5b93..5a69d1de 100644
--- a/lib/ClassTypes.php
+++ b/lib/ClassTypes.php
@@ -236,6 +236,20 @@ function getIcon($aPlace)
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.
*
diff --git a/lib/Geocode.php b/lib/Geocode.php
index 253b9798..0c93e0a9 100644
--- a/lib/Geocode.php
+++ b/lib/Geocode.php
@@ -903,9 +903,9 @@ class Geocode
}
// 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);
diff --git a/lib/template/details-html.php b/lib/template/details-html.php
index 4ea5a258..c15e74c8 100644
--- a/lib/template/details-html.php
+++ b/lib/template/details-html.php
@@ -57,10 +57,12 @@
return $sHTML;
}
- function map_icon($sIcon)
+ function map_icon($aPlace)
{
+ $sIcon = Nominatim\ClassTypes\getIconFile($aPlace);
if (isset($sIcon)) {
- echo '
';
+ $sLabel = Nominatim\ClassTypes\getIcon($aPlace);
+ echo '';
}
}
@@ -112,7 +114,7 @@