3 $aFilteredPlaces = array();
4 foreach($aSearchResults as $iResNum => $aPointDetails)
7 'place_id'=>$aPointDetails['place_id'],
8 'licence'=>"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",
11 $sOSMType = formatOSMType($aPointDetails['osm_type']);
14 $aPlace['osm_type'] = $sOSMType;
15 $aPlace['osm_id'] = $aPointDetails['osm_id'];
18 if (isset($aPointDetails['aBoundingBox']))
20 $aPlace['boundingbox'] = $aPointDetails['aBoundingBox'];
22 if (isset($aPointDetails['aPolyPoints']))
24 $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
28 if (isset($aPointDetails['zoom']))
30 $aPlace['zoom'] = $aPointDetails['zoom'];
33 $aPlace['lat'] = $aPointDetails['lat'];
34 $aPlace['lon'] = $aPointDetails['lon'];
35 $aPlace['display_name'] = $aPointDetails['name'];
36 $aPlace['place_rank'] = $aPointDetails['rank_search'];
38 $aPlace['category'] = $aPointDetails['class'];
39 $aPlace['type'] = $aPointDetails['type'];
41 $aPlace['importance'] = $aPointDetails['importance'];
43 if (isset($aPointDetails['icon']))
45 $aPlace['icon'] = $aPointDetails['icon'];
48 if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0)
50 $aPlace['address'] = $aPointDetails['address'];
53 if (isset($aPointDetails['asgeojson']))
55 $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
58 if (isset($aPointDetails['assvg']))
60 $aPlace['svg'] = $aPointDetails['assvg'];
63 if (isset($aPointDetails['astext']))
65 $aPlace['geotext'] = $aPointDetails['astext'];
68 if (isset($aPointDetails['askml']))
70 $aPlace['geokml'] = $aPointDetails['askml'];
73 if (isset($aPointDetails['sExtraTags'])) $aPlace['extratags'] = $aPointDetails['sExtraTags'];
74 if (isset($aPointDetails['sNameDetails'])) $aPlace['namedetails'] = $aPointDetails['sNameDetails'];
76 $aFilteredPlaces[] = $aPlace;
79 javascript_renderData($aFilteredPlaces);