4 $aOutput['licence'] = "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright";
5 $aOutput['batch'] = array();
7 foreach($aBatchResults as $aSearchResults)
9 $aFilteredPlaces = array();
10 foreach($aSearchResults as $iResNum => $aPointDetails)
13 'place_id'=>$aPointDetails['place_id'],
16 $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?'relation':'')));
19 $aPlace['osm_type'] = $sOSMType;
20 $aPlace['osm_id'] = $aPointDetails['osm_id'];
23 if (isset($aPointDetails['aBoundingBox']))
25 $aPlace['boundingbox'] = array(
26 $aPointDetails['aBoundingBox'][0],
27 $aPointDetails['aBoundingBox'][1],
28 $aPointDetails['aBoundingBox'][2],
29 $aPointDetails['aBoundingBox'][3]);
31 if (isset($aPointDetails['aPolyPoints']) && $bShowPolygons)
33 $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
37 if (isset($aPointDetails['zoom']))
39 $aPlace['zoom'] = $aPointDetails['zoom'];
42 $aPlace['lat'] = $aPointDetails['lat'];
43 $aPlace['lon'] = $aPointDetails['lon'];
44 $aPlace['display_name'] = $aPointDetails['name'];
45 $aPlace['place_rank'] = $aPointDetails['rank_search'];
47 $aPlace['category'] = $aPointDetails['class'];
48 $aPlace['type'] = $aPointDetails['type'];
50 $aPlace['importance'] = $aPointDetails['importance'];
52 if (isset($aPointDetails['icon']))
54 $aPlace['icon'] = $aPointDetails['icon'];
57 if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0)
59 $aPlace['address'] = $aPointDetails['address'];
62 if (isset($aPointDetails['asgeojson']))
64 $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
67 if (isset($aPointDetails['assvg']))
69 $aPlace['svg'] = $aPointDetails['assvg'];
72 if (isset($aPointDetails['astext']))
74 $aPlace['geotext'] = $aPointDetails['astext'];
77 if (isset($aPointDetails['askml']))
79 $aPlace['geokml'] = $aPointDetails['askml'];
82 $aFilteredPlaces[] = $aPlace;
84 $aOutput['batch'][] = $aFilteredPlaces;
87 javascript_renderData($aOutput, array('geojson'));