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'];
31 $aPlace['place_rank'] = $aPointDetails['rank_search'];
33 $aPlace['category'] = $aPointDetails['class'];
34 $aPlace['type'] = $aPointDetails['type'];
36 $aPlace['importance'] = $aPointDetails['importance'];
38 if (isset($aPointDetails['icon'])) {
39 $aPlace['icon'] = $aPointDetails['icon'];
42 if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0) {
43 $aPlace['address'] = $aPointDetails['address'];
46 if (isset($aPointDetails['asgeojson'])) {
47 $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
50 if (isset($aPointDetails['assvg'])) {
51 $aPlace['svg'] = $aPointDetails['assvg'];
54 if (isset($aPointDetails['astext'])) {
55 $aPlace['geotext'] = $aPointDetails['astext'];
58 if (isset($aPointDetails['askml'])) {
59 $aPlace['geokml'] = $aPointDetails['askml'];
62 if (isset($aPointDetails['sExtraTags'])) $aPlace['extratags'] = $aPointDetails['sExtraTags'];
63 if (isset($aPointDetails['sNameDetails'])) $aPlace['namedetails'] = $aPointDetails['sNameDetails'];
65 $aFilteredPlaces[] = $aPlace;
68 javascript_renderData($aFilteredPlaces);