X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/a855ffe58e258be6ac4a68a802d87b65fdfd6033..756c23f39fcfa5d5a20ba587460f59cf2840e537:/website/details.php?ds=sidebyside diff --git a/website/details.php b/website/details.php index 61ed4c63..9fb8a900 100755 --- a/website/details.php +++ b/website/details.php @@ -66,11 +66,23 @@ $sSQL .= " ST_y(centroid) as lat, ST_x(centroid) as lon,"; $sSQL .= " case when importance = 0 OR importance IS NULL then 0.75-(rank_search::float/40) else importance end as calculated_importance, "; $sSQL .= " ST_AsText(CASE WHEN ST_NPoints(geometry) > 5000 THEN ST_SimplifyPreserveTopology(geometry, 0.0001) ELSE geometry END) as outlinestring"; $sSQL .= " from placex where place_id = $iPlaceID"; + $aPointDetails = chksql($oDB->getRow($sSQL), "Could not get details of place object."); + +if (!$aPointDetails) { + userError("Unknown place id."); +} + $aPointDetails['localname'] = $aPointDetails['localname']?$aPointDetails['localname']:$aPointDetails['housenumber']; $aClassType = getClassTypesWithImportance(); -$aPointDetails['icon'] = $aClassType[$aPointDetails['class'].':'.$aPointDetails['type']]['icon']; + +$sPointClassType = $aPointDetails['class'].':'.$aPointDetails['type']; +if (isset($aClassType[$sPointClassType]) && $aClassType[$sPointClassType]['icon']) { + $aPointDetails['icon'] = $aClassType[$sPointClassType]['icon']; +} else { + $aPointDetails['icon'] = false; +} // Get all alternative names (languages, etc) $sSQL = "select (each(name)).key,(each(name)).value from placex where place_id = $iPlaceID order by (each(name)).key";