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) $aSearchResults = array();
9 $aFilteredPlaces = array();
10 foreach ($aSearchResults as $iResNum => $aPointDetails) {
12 'place_id'=>$aPointDetails['place_id'],
15 $sOSMType = formatOSMType($aPointDetails['osm_type']);
17 $aPlace['osm_type'] = $sOSMType;
18 $aPlace['osm_id'] = $aPointDetails['osm_id'];
21 if (isset($aPointDetails['aBoundingBox'])) {
22 $aPlace['boundingbox'] = array(
23 $aPointDetails['aBoundingBox'][0],
24 $aPointDetails['aBoundingBox'][1],
25 $aPointDetails['aBoundingBox'][2],
26 $aPointDetails['aBoundingBox'][3]
30 if (isset($aPointDetails['zoom'])) {
31 $aPlace['zoom'] = $aPointDetails['zoom'];
34 $aPlace['lat'] = $aPointDetails['lat'];
35 $aPlace['lon'] = $aPointDetails['lon'];
36 $aPlace['display_name'] = $aPointDetails['name'];
37 $aPlace['place_rank'] = $aPointDetails['rank_search'];
39 $aPlace['category'] = $aPointDetails['class'];
40 $aPlace['type'] = $aPointDetails['type'];
42 $aPlace['importance'] = $aPointDetails['importance'];
44 if (isset($aPointDetails['icon'])) {
45 $aPlace['icon'] = $aPointDetails['icon'];
48 if (isset($aPointDetails['address'])) {
49 $aPlace['address'] = $aPointDetails['address']->getAddressNames();
52 if (isset($aPointDetails['asgeojson'])) {
53 $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
56 if (isset($aPointDetails['assvg'])) {
57 $aPlace['svg'] = $aPointDetails['assvg'];
60 if (isset($aPointDetails['astext'])) {
61 $aPlace['geotext'] = $aPointDetails['astext'];
64 if (isset($aPointDetails['askml'])) {
65 $aPlace['geokml'] = $aPointDetails['askml'];
68 $aFilteredPlaces[] = $aPlace;
70 $aOutput['batch'][] = $aFilteredPlaces;
73 javascript_renderData($aOutput, array('geojson'));