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]
29 if (isset($aPointDetails['aPolyPoints']) && $bShowPolygons) {
30 $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
34 if (isset($aPointDetails['zoom'])) {
35 $aPlace['zoom'] = $aPointDetails['zoom'];
38 $aPlace['lat'] = $aPointDetails['lat'];
39 $aPlace['lon'] = $aPointDetails['lon'];
40 $aPlace['display_name'] = $aPointDetails['name'];
41 $aPlace['place_rank'] = $aPointDetails['rank_search'];
43 $aPlace['category'] = $aPointDetails['class'];
44 $aPlace['type'] = $aPointDetails['type'];
46 $aPlace['importance'] = $aPointDetails['importance'];
48 if (isset($aPointDetails['icon'])) {
49 $aPlace['icon'] = $aPointDetails['icon'];
52 if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0) {
53 $aPlace['address'] = $aPointDetails['address'];
56 if (isset($aPointDetails['asgeojson'])) {
57 $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
60 if (isset($aPointDetails['assvg'])) {
61 $aPlace['svg'] = $aPointDetails['assvg'];
64 if (isset($aPointDetails['astext'])) {
65 $aPlace['geotext'] = $aPointDetails['astext'];
68 if (isset($aPointDetails['askml'])) {
69 $aPlace['geokml'] = $aPointDetails['askml'];
72 $aFilteredPlaces[] = $aPlace;
74 $aOutput['batch'][] = $aFilteredPlaces;
77 javascript_renderData($aOutput, array('geojson'));