4 $aOutput['licence'] = 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright';
5 $aOutput['batch'] = array();
7 foreach ($aBatchResults as $aSearchResults) {
8 if (!$aSearchResults) {
9 $aSearchResults = array();
11 $aFilteredPlaces = array();
12 foreach ($aSearchResults as $iResNum => $aPointDetails) {
14 'place_id'=>$aPointDetails['place_id'],
17 $sOSMType = formatOSMType($aPointDetails['osm_type']);
19 $aPlace['osm_type'] = $sOSMType;
20 $aPlace['osm_id'] = $aPointDetails['osm_id'];
23 if (isset($aPointDetails['aBoundingBox'])) {
24 $aPlace['boundingbox'] = array(
25 $aPointDetails['aBoundingBox'][0],
26 $aPointDetails['aBoundingBox'][1],
27 $aPointDetails['aBoundingBox'][2],
28 $aPointDetails['aBoundingBox'][3]
32 if (isset($aPointDetails['zoom'])) {
33 $aPlace['zoom'] = $aPointDetails['zoom'];
36 $aPlace['lat'] = $aPointDetails['lat'];
37 $aPlace['lon'] = $aPointDetails['lon'];
38 $aPlace['display_name'] = $aPointDetails['name'];
39 $aPlace['place_rank'] = $aPointDetails['rank_search'];
41 $aPlace['category'] = $aPointDetails['class'];
42 $aPlace['type'] = $aPointDetails['type'];
44 $aPlace['importance'] = $aPointDetails['importance'];
46 if (isset($aPointDetails['icon'])) {
47 $aPlace['icon'] = $aPointDetails['icon'];
50 if (isset($aPointDetails['address'])) {
51 $aPlace['address'] = $aPointDetails['address']->getAddressNames();
54 if (isset($aPointDetails['asgeojson'])) {
55 $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
58 if (isset($aPointDetails['assvg'])) {
59 $aPlace['svg'] = $aPointDetails['assvg'];
62 if (isset($aPointDetails['astext'])) {
63 $aPlace['geotext'] = $aPointDetails['astext'];
66 if (isset($aPointDetails['askml'])) {
67 $aPlace['geokml'] = $aPointDetails['askml'];
70 $aFilteredPlaces[] = $aPlace;
72 $aOutput['batch'][] = $aFilteredPlaces;
75 javascript_renderData($aOutput, array('geojson'));