2 $aFilteredPlaces = array();
3 foreach($aSearchResults as $iResNum => $aPointDetails)
6 'place_id'=>$aPointDetails['place_id'],
7 'licence'=>"Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
10 $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
13 $aPlace['osm_type'] = $sOSMType;
14 $aPlace['osm_id'] = $aPointDetails['osm_id'];
17 if (isset($aPointDetails['aBoundingBox']))
19 $aPlace['boundingbox'] = $aPointDetails['aBoundingBox'];
21 if (isset($aPointDetails['aPolyPoints']) && $bShowPolygons)
23 $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
27 if (isset($aPointDetails['zoom']))
29 $aPlace['zoom'] = $aPointDetails['zoom'];
32 $aPlace['lat'] = $aPointDetails['lat'];
33 $aPlace['lon'] = $aPointDetails['lon'];
34 $aPlace['display_name'] = $aPointDetails['name'];
35 $aPlace['place_rank'] = $aPointDetails['rank_search'];
37 $aPlace['category'] = $aPointDetails['class'];
38 $aPlace['type'] = $aPointDetails['type'];
40 $aPlace['importance'] = $aPointDetails['importance'];
42 if (isset($aPointDetails['icon']))
44 $aPlace['icon'] = $aPointDetails['icon'];
47 if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0)
49 $aPlace['address'] = $aPointDetails['address'];
52 if (isset($aPointDetails['asgeojson']))
54 $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
57 if (isset($aPointDetails['assvg']))
59 $aPlace['svg'] = $aPointDetails['assvg'];
62 if (isset($aPointDetails['astext']))
64 $aPlace['geotext'] = $aPointDetails['astext'];
67 if (isset($aPointDetails['askml']))
69 $aPlace['geokml'] = $aPointDetails['askml'];
72 if (isset($aPointDetails['sExtraTags'])) $aPlace['extratags'] = $aPointDetails['sExtraTags'];
73 if (isset($aPointDetails['sNameDetails'])) $aPlace['namedetails'] = $aPointDetails['sNameDetails'];
75 $aFilteredPlaces[] = $aPlace;
78 javascript_renderData($aFilteredPlaces);