X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/6a7e0d652b1d40a397e1c1386d500101796676c4..23dabad0b0c8c1ffd9b4973bfc9e1d739e6128d7:/lib-php/template/search-geojson.php diff --git a/lib-php/template/search-geojson.php b/lib-php/template/search-geojson.php index 0847fba4..7665700d 100644 --- a/lib-php/template/search-geojson.php +++ b/lib-php/template/search-geojson.php @@ -1,4 +1,12 @@ $aPointDetails) { @@ -8,7 +16,7 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { 'place_id'=>$aPointDetails['place_id'], ) ); - + $sOSMType = formatOSMType($aPointDetails['osm_type']); if ($sOSMType) { $aPlace['properties']['osm_type'] = $sOSMType; @@ -46,7 +54,7 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { } if (isset($aPointDetails['asgeojson'])) { - $aPlace['geometry'] = json_decode($aPointDetails['asgeojson']); + $aPlace['geometry'] = json_decode($aPointDetails['asgeojson'], true); } else { $aPlace['geometry'] = array( 'type' => 'Point', @@ -58,8 +66,12 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { } - if (isset($aPointDetails['sExtraTags'])) $aPlace['properties']['extratags'] = $aPointDetails['sExtraTags']; - if (isset($aPointDetails['sNameDetails'])) $aPlace['properties']['namedetails'] = $aPointDetails['sNameDetails']; + if (isset($aPointDetails['sExtraTags'])) { + $aPlace['properties']['extratags'] = $aPointDetails['sExtraTags']; + } + if (isset($aPointDetails['sNameDetails'])) { + $aPlace['properties']['namedetails'] = $aPointDetails['sNameDetails']; + } $aFilteredPlaces[] = $aPlace; }