3 $aFilteredPlaces = array();
5 if (!sizeof($aPlace)) {
7 $aFilteredPlaces['error'] = $sError;
8 else $aFilteredPlaces['error'] = 'Unable to geocode';
10 if (isset($aPlace['place_id'])) $aFilteredPlaces['place_id'] = $aPlace['place_id'];
11 $aFilteredPlaces['licence'] = 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright';
12 $sOSMType = formatOSMType($aPlace['osm_type']);
14 $aFilteredPlaces['osm_type'] = $sOSMType;
15 $aFilteredPlaces['osm_id'] = $aPlace['osm_id'];
17 if (isset($aPlace['lat'])) $aFilteredPlaces['lat'] = $aPlace['lat'];
18 if (isset($aPlace['lon'])) $aFilteredPlaces['lon'] = $aPlace['lon'];
19 $aFilteredPlaces['display_name'] = $aPlace['langaddress'];
20 if (isset($aPlace['aAddress'])) $aFilteredPlaces['address'] = $aPlace['aAddress'];
21 if (isset($aPlace['sExtraTags'])) $aFilteredPlaces['extratags'] = $aPlace['sExtraTags'];
22 if (isset($aPlace['sNameDetails'])) $aFilteredPlaces['namedetails'] = $aPlace['sNameDetails'];
24 if (isset($aPlace['aBoundingBox'])) {
25 $aFilteredPlaces['boundingbox'] = $aPlace['aBoundingBox'];
28 if (isset($aPlace['asgeojson'])) {
29 $aFilteredPlaces['geojson'] = json_decode($aPlace['asgeojson']);
32 if (isset($aPlace['assvg'])) {
33 $aFilteredPlaces['svg'] = $aPlace['assvg'];
36 if (isset($aPlace['astext'])) {
37 $aFilteredPlaces['geotext'] = $aPlace['astext'];
40 if (isset($aPlace['askml'])) {
41 $aFilteredPlaces['geokml'] = $aPlace['askml'];
45 javascript_renderData($aFilteredPlaces);