2 header("content-type: application/json; charset=UTF-8");
4 $aFilteredPlaces = array();
5 foreach($aSearchResults as $iResNum => $aPointDetails)
8 'place_id'=>$aPointDetails['place_id'],
9 'licence'=>"Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
12 $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
15 $aPlace['osm_type'] = $sOSMType;
16 $aPlace['osm_id'] = $aPointDetails['osm_id'];
19 if (isset($aPointDetails['aBoundingBox']))
21 $aPlace['boundingbox'] = $aPointDetails['aBoundingBox'][0];
23 if (isset($aPointDetails['aPolyPoints']) && $bShowPolygons)
25 $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
29 if (isset($aPointDetails['zoom']))
31 $aPlace['zoom'] = $aPointDetails['zoom'];
34 $aPlace['lat'] = $aPointDetails['lat'];
35 $aPlace['lon'] = $aPointDetails['lon'];
36 $aPlace['display_name'] = $aPointDetails['name'];
38 $aPlace['class'] = $aPointDetails['class'];
39 $aPlace['type'] = $aPointDetails['type'];
41 $aPlace['importance'] = $aPointDetails['importance'];
43 if (isset($aPointDetails['icon']) && $aPointDetails['icon'])
45 $aPlace['icon'] = $aPointDetails['icon'];
48 if (isset($aPointDetails['address']))
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);