X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/80f6aca0c22984b79e24a19bc602258dd3caeb34..330b8d2fdfdd935da123abf9ecf96b3bc7a12be5:/lib-php/template/search-geocodejson.php?ds=inline diff --git a/lib-php/template/search-geocodejson.php b/lib-php/template/search-geocodejson.php index 3e3a31c4..bba41a0d 100644 --- a/lib-php/template/search-geocodejson.php +++ b/lib-php/template/search-geocodejson.php @@ -1,4 +1,12 @@ $aPointDetails) { @@ -9,14 +17,18 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { ) ); - if (isset($aPointDetails['place_id'])) $aPlace['properties']['geocoding']['place_id'] = $aPointDetails['place_id']; + if (isset($aPointDetails['place_id'])) { + $aPlace['properties']['geocoding']['place_id'] = $aPointDetails['place_id']; + } $sOSMType = formatOSMType($aPointDetails['osm_type']); if ($sOSMType) { $aPlace['properties']['geocoding']['osm_type'] = $sOSMType; $aPlace['properties']['geocoding']['osm_id'] = $aPointDetails['osm_id']; } + $aPlace['properties']['geocoding']['osm_key'] = $aPointDetails['class']; + $aPlace['properties']['geocoding']['osm_value'] = $aPointDetails['type']; - $aPlace['properties']['geocoding']['type'] = $aPointDetails['type']; + $aPlace['properties']['geocoding']['type'] = addressRankToGeocodeJsonType($aPointDetails['rank_address']); $aPlace['properties']['geocoding']['label'] = $aPointDetails['langaddress']; @@ -34,7 +46,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',