4 $aOutput['licence'] = "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright";
5 $aOutput['batch'] = array();
7 foreach($aBatchResults as $aSearchResults)
9 if (!$aSearchResults) $aSearchResults = array();
10 $aFilteredPlaces = array();
11 foreach($aSearchResults as $iResNum => $aPointDetails)
14 'place_id'=>$aPointDetails['place_id'],
17 $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
20 $aPlace['osm_type'] = $sOSMType;
21 $aPlace['osm_id'] = $aPointDetails['osm_id'];
24 if (isset($aPointDetails['aBoundingBox']))
26 $aPlace['boundingbox'] = array(
27 $aPointDetails['aBoundingBox'][0],
28 $aPointDetails['aBoundingBox'][1],
29 $aPointDetails['aBoundingBox'][2],
30 $aPointDetails['aBoundingBox'][3]);
32 if (isset($aPointDetails['aPolyPoints']) && $bShowPolygons)
34 $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
38 if (isset($aPointDetails['zoom']))
40 $aPlace['zoom'] = $aPointDetails['zoom'];
43 $aPlace['lat'] = $aPointDetails['lat'];
44 $aPlace['lon'] = $aPointDetails['lon'];
45 $aPlace['display_name'] = $aPointDetails['name'];
46 $aPlace['place_rank'] = $aPointDetails['rank_search'];
48 $aPlace['category'] = $aPointDetails['class'];
49 $aPlace['type'] = $aPointDetails['type'];
51 $aPlace['importance'] = $aPointDetails['importance'];
53 if (isset($aPointDetails['icon']))
55 $aPlace['icon'] = $aPointDetails['icon'];
58 if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0)
60 $aPlace['address'] = $aPointDetails['address'];
63 if (isset($aPointDetails['asgeojson']))
65 $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
68 if (isset($aPointDetails['assvg']))
70 $aPlace['svg'] = $aPointDetails['assvg'];
73 if (isset($aPointDetails['astext']))
75 $aPlace['geotext'] = $aPointDetails['astext'];
78 if (isset($aPointDetails['askml']))
80 $aPlace['geokml'] = $aPointDetails['askml'];
83 $aFilteredPlaces[] = $aPlace;
85 $aOutput['batch'][] = $aFilteredPlaces;
88 javascript_renderData($aOutput, array('geojson'));