2 $aFilteredPlaces = array();
7 $aFilteredPlaces['error'] = $sError;
9 $aFilteredPlaces['error'] = 'Unable to geocode';
13 if ($aPlace['place_id']) $aFilteredPlaces['place_id'] = $aPlace['place_id'];
14 $aFilteredPlaces['licence'] = "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright";
15 $sOSMType = formatOSMType($aPlace['osm_type']);
18 $aFilteredPlaces['osm_type'] = $sOSMType;
19 $aFilteredPlaces['osm_id'] = $aPlace['osm_id'];
21 if (isset($aPlace['lat'])) $aFilteredPlaces['lat'] = $aPlace['lat'];
22 if (isset($aPlace['lon'])) $aFilteredPlaces['lon'] = $aPlace['lon'];
24 $aFilteredPlaces['place_rank'] = $aPlace['rank_search'];
26 $aFilteredPlaces['category'] = $aPlace['class'];
27 $aFilteredPlaces['type'] = $aPlace['type'];
29 $aFilteredPlaces['importance'] = $aPlace['importance'];
31 $aFilteredPlaces['addresstype'] = strtolower($aPlace['addresstype']);
33 $aFilteredPlaces['display_name'] = $aPlace['langaddress'];
34 $aFilteredPlaces['name'] = $aPlace['placename'];
36 if (isset($aPlace['aAddress'])) $aFilteredPlaces['address'] = $aPlace['aAddress'];
37 if (isset($aPlace['sExtraTags'])) $aFilteredPlaces['extratags'] = $aPlace['sExtraTags'];
38 if (isset($aPlace['sNameDetails'])) $aFilteredPlaces['namedetails'] = $aPlace['sNameDetails'];
40 if (isset($aPlace['aBoundingBox']))
42 $aFilteredPlaces['boundingbox'] = $aPlace['aBoundingBox'];
45 if (isset($aPlace['asgeojson']))
47 $aFilteredPlaces['geojson'] = json_decode($aPlace['asgeojson']);
50 if (isset($aPlace['assvg']))
52 $aFilteredPlaces['svg'] = $aPlace['assvg'];
55 if (isset($aPlace['astext']))
57 $aFilteredPlaces['geotext'] = $aPlace['astext'];
60 if (isset($aPlace['askml']))
62 $aFilteredPlaces['geokml'] = $aPlace['askml'];
67 javascript_renderData($aFilteredPlaces);