2 $aFilteredPlaces = array();
7 $aFilteredPlaces['error'] = $sError;
9 $aFilteredPlaces['error'] = 'Unable to geocode';
13 if (isset($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 = ($aPlace['osm_type'] == 'N'?'node':($aPlace['osm_type'] == 'W'?'way':($aPlace['osm_type'] == 'R'?'relation':'')));
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'];
23 $aFilteredPlaces['display_name'] = $aPlace['langaddress'];
24 if (isset($aPlace['aAddress'])) $aFilteredPlaces['address'] = $aPlace['aAddress'];
25 if (isset($aPlace['sExtraTags'])) $aFilteredPlaces['extratags'] = $aPlace['sExtraTags'];
26 if (isset($aPlace['sNameDetails'])) $aFilteredPlaces['namedetails'] = $aPlace['sNameDetails'];
28 if (isset($aPlace['aBoundingBox']))
30 $aFilteredPlaces['boundingbox'] = $aPlace['aBoundingBox'];
32 if (isset($aPlace['aPolyPoints']) && $bAsPoints)
34 $aFilteredPlaces['polygonpoints'] = $aPlace['aPolyPoints'];
38 if (isset($aPlace['asgeojson']))
40 $aFilteredPlaces['geojson'] = json_decode($aPlace['asgeojson']);
43 if (isset($aPlace['assvg']))
45 $aFilteredPlaces['svg'] = $aPlace['assvg'];
48 if (isset($aPlace['astext']))
50 $aFilteredPlaces['geotext'] = $aPlace['astext'];
53 if (isset($aPlace['askml']))
55 $aFilteredPlaces['geokml'] = $aPlace['askml'];
61 javascript_renderData($aFilteredPlaces);