]> git.openstreetmap.org Git - nominatim.git/commitdiff
in /details JSON output add check if place (type) has an icon set
authormarc tobias <mtmail@gmx.net>
Tue, 21 Aug 2018 15:26:14 +0000 (17:26 +0200)
committermarc tobias <mtmail@gmx.net>
Wed, 22 Aug 2018 11:34:34 +0000 (13:34 +0200)
lib/template/details-json.php

index 9b4237c70720331a82b20160f2570c1b7bc3c0df..06554aba68f2143c6a24b46ce9cdb39e9cfc3362 100644 (file)
@@ -26,7 +26,9 @@ $aPlaceDetails['calculated_importance'] = (float) $aPointDetails['calculated_imp
 
 $aPlaceDetails['extratags'] = $aPointDetails['aExtraTags'];
 $aPlaceDetails['calculated_wikipedia'] = $aPointDetails['wikipedia'];
 
 $aPlaceDetails['extratags'] = $aPointDetails['aExtraTags'];
 $aPlaceDetails['calculated_wikipedia'] = $aPointDetails['wikipedia'];
-$aPlaceDetails['icon'] = CONST_Website_BaseURL.'images/mapicons/'.$aPointDetails['icon'].'.n.32.png';
+if ($aPointDetails['icon']) {
+    $aPlaceDetails['icon'] = CONST_Website_BaseURL.'images/mapicons/'.$aPointDetails['icon'].'.n.32.png';
+}
 
 $aPlaceDetails['rank_address'] = (int) $aPointDetails['rank_address'];
 $aPlaceDetails['rank_search'] = (int) $aPointDetails['rank_search'];
 
 $aPlaceDetails['rank_address'] = (int) $aPointDetails['rank_address'];
 $aPlaceDetails['rank_search'] = (int) $aPointDetails['rank_search'];