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'];
31 $aPlace['display_name'] = $aPointDetails['name'];
33 if ($sOutputFormat == 'jsonv2' || $sOutputFormat == 'geojson') {
34 $aPlace['place_rank'] = $aPointDetails['rank_search'];
35 $aPlace['category'] = $aPointDetails['class'];
37 $aPlace['class'] = $aPointDetails['class'];
39 $aPlace['type'] = $aPointDetails['type'];
41 $aPlace['importance'] = $aPointDetails['importance'];
43 if (isset($aPointDetails['icon']) && $aPointDetails['icon']) {
44 $aPlace['icon'] = $aPointDetails['icon'];
47 if (isset($aPointDetails['address']) && !empty($aPointDetails['address'])) {
48 $aPlace['address'] = $aPointDetails['address'];
51 if (isset($aPointDetails['asgeojson'])) {
52 $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
55 if (isset($aPointDetails['assvg'])) {
56 $aPlace['svg'] = $aPointDetails['assvg'];
59 if (isset($aPointDetails['astext'])) {
60 $aPlace['geotext'] = $aPointDetails['astext'];
63 if (isset($aPointDetails['askml'])) {
64 $aPlace['geokml'] = $aPointDetails['askml'];
67 if (isset($aPointDetails['sExtraTags'])) $aPlace['extratags'] = $aPointDetails['sExtraTags'];
68 if (isset($aPointDetails['sNameDetails'])) $aPlace['namedetails'] = $aPointDetails['sNameDetails'];
70 $aFilteredPlaces[] = $aPlace;
73 javascript_renderData($aFilteredPlaces);