3 $aFilteredPlaces = array();
4 foreach ($aSearchResults as $iResNum => $aPointDetails) {
6 'place_id'=>$aPointDetails['place_id'],
7 'licence'=>'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright',
10 $sOSMType = formatOSMType($aPointDetails['osm_type']);
12 $aPlace['osm_type'] = $sOSMType;
13 $aPlace['osm_id'] = $aPointDetails['osm_id'];
16 if (isset($aPointDetails['aBoundingBox'])) {
17 $aPlace['boundingbox'] = $aPointDetails['aBoundingBox'];
20 if (isset($aPointDetails['zoom'])) {
21 $aPlace['zoom'] = $aPointDetails['zoom'];
24 $aPlace['lat'] = $aPointDetails['lat'];
25 $aPlace['lon'] = $aPointDetails['lon'];
27 $aPlace['display_name'] = $aPointDetails['name'];
29 if ($sOutputFormat == 'jsonv2' || $sOutputFormat == 'geojson') {
30 $aPlace['place_rank'] = $aPointDetails['rank_search'];
31 $aPlace['category'] = $aPointDetails['class'];
33 $aPlace['class'] = $aPointDetails['class'];
35 $aPlace['type'] = $aPointDetails['type'];
37 $aPlace['importance'] = $aPointDetails['importance'];
39 if (isset($aPointDetails['icon']) && $aPointDetails['icon']) {
40 $aPlace['icon'] = $aPointDetails['icon'];
43 if (isset($aPointDetails['address'])) {
44 $aPlace['address'] = $aPointDetails['address']->getAddressNames();
47 if (isset($aPointDetails['asgeojson'])) {
48 $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
51 if (isset($aPointDetails['assvg'])) {
52 $aPlace['svg'] = $aPointDetails['assvg'];
55 if (isset($aPointDetails['astext'])) {
56 $aPlace['geotext'] = $aPointDetails['astext'];
59 if (isset($aPointDetails['askml'])) {
60 $aPlace['geokml'] = $aPointDetails['askml'];
63 if (isset($aPointDetails['sExtraTags'])) $aPlace['extratags'] = $aPointDetails['sExtraTags'];
64 if (isset($aPointDetails['sNameDetails'])) $aPlace['namedetails'] = $aPointDetails['sNameDetails'];
66 $aFilteredPlaces[] = $aPlace;
69 javascript_renderData($aFilteredPlaces);