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'];
19 if (isset($aPointDetails['aPolyPoints'])) {
20 $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
24 if (isset($aPointDetails['zoom'])) {
25 $aPlace['zoom'] = $aPointDetails['zoom'];
28 $aPlace['lat'] = $aPointDetails['lat'];
29 $aPlace['lon'] = $aPointDetails['lon'];
30 $aPlace['display_name'] = $aPointDetails['name'];
32 if ($sOutputFormat == 'jsonv2') {
33 $aPlace['place_rank'] = $aPointDetails['rank_search'];
34 $aPlace['category'] = $aPointDetails['class'];
36 $aPlace['class'] = $aPointDetails['class'];
38 $aPlace['type'] = $aPointDetails['type'];
40 $aPlace['importance'] = $aPointDetails['importance'];
42 if (isset($aPointDetails['icon']) && $aPointDetails['icon']) {
43 $aPlace['icon'] = $aPointDetails['icon'];
46 if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])) {
47 $aPlace['address'] = $aPointDetails['address'];
50 if (isset($aPointDetails['asgeojson'])) {
51 $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
54 if (isset($aPointDetails['assvg'])) {
55 $aPlace['svg'] = $aPointDetails['assvg'];
58 if (isset($aPointDetails['astext'])) {
59 $aPlace['geotext'] = $aPointDetails['astext'];
62 if (isset($aPointDetails['askml'])) {
63 $aPlace['geokml'] = $aPointDetails['askml'];
66 if (isset($aPointDetails['sExtraTags'])) $aPlace['extratags'] = $aPointDetails['sExtraTags'];
67 if (isset($aPointDetails['sNameDetails'])) $aPlace['namedetails'] = $aPointDetails['sNameDetails'];
69 $aFilteredPlaces[] = $aPlace;
72 javascript_renderData($aFilteredPlaces);