X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/db3ced17bbfff00411f506d8c84419c875959d5e..11a1191ba08f5244bd2e4f760e07310a2e34c026:/lib-php/template/search-json.php?ds=inline diff --git a/lib-php/template/search-json.php b/lib-php/template/search-json.php index 4b896d08..5fb13020 100644 --- a/lib-php/template/search-json.php +++ b/lib-php/template/search-json.php @@ -1,4 +1,12 @@ $aPointDetails) { @@ -6,7 +14,7 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { 'place_id'=>$aPointDetails['place_id'], 'licence'=>'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright', ); - + $sOSMType = formatOSMType($aPointDetails['osm_type']); if ($sOSMType) { $aPlace['osm_type'] = $sOSMType; @@ -45,7 +53,7 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { } if (isset($aPointDetails['asgeojson'])) { - $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']); + $aPlace['geojson'] = json_decode($aPointDetails['asgeojson'], true); } if (isset($aPointDetails['assvg'])) { @@ -60,8 +68,12 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { $aPlace['geokml'] = $aPointDetails['askml']; } - if (isset($aPointDetails['sExtraTags'])) $aPlace['extratags'] = $aPointDetails['sExtraTags']; - if (isset($aPointDetails['sNameDetails'])) $aPlace['namedetails'] = $aPointDetails['sNameDetails']; + if (isset($aPointDetails['sExtraTags'])) { + $aPlace['extratags'] = $aPointDetails['sExtraTags']; + } + if (isset($aPointDetails['sNameDetails'])) { + $aPlace['namedetails'] = $aPointDetails['sNameDetails']; + } $aFilteredPlaces[] = $aPlace; }