2         header("content-type: application/json; charset=UTF-8");
 
   4         $aFilteredPlaces = array();
 
   5         foreach($aSearchResults as $iResNum => $aPointDetails)
 
   8                                 'place_id'=>$aPointDetails['place_id'],
 
   9                                 'licence'=>"Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright",
 
  12                 $sOSMType = ($aPointDetails['osm_type'] == 'N'?'node':($aPointDetails['osm_type'] == 'W'?'way':($aPointDetails['osm_type'] == 'R'?
 
  13                                         'relation':($aPointDetails['osm_type'] == 'T'?'tiger':($aPointDetails['osm_type'] == 'I'?'interpolation':'')))));
 
  16                         $aPlace['osm_type'] = $sOSMType;
 
  17                         $aPlace['osm_id'] = $aPointDetails['osm_id'];
 
  20                 if (isset($aPointDetails['aBoundingBox']))
 
  22                         $aPlace['boundingbox'] = $aPointDetails['aBoundingBox'];
 
  24                         if (isset($aPointDetails['aPolyPoints']) && $bShowPolygons)
 
  26                                 $aPlace['polygonpoints'] = $aPointDetails['aPolyPoints'];
 
  30                 if (isset($aPointDetails['zoom']))
 
  32                         $aPlace['zoom'] = $aPointDetails['zoom'];
 
  35                 $aPlace['lat'] = $aPointDetails['lat'];
 
  36                 $aPlace['lon'] = $aPointDetails['lon'];
 
  37                 $aPlace['display_name'] = $aPointDetails['name'];
 
  39                 $aPlace['class'] = $aPointDetails['class'];
 
  40                 $aPlace['type'] = $aPointDetails['type'];
 
  42                 $aPlace['importance'] = $aPointDetails['importance'];
 
  44                 if (isset($aPointDetails['icon']) && $aPointDetails['icon'])
 
  46                         $aPlace['icon'] = $aPointDetails['icon'];
 
  49                 if (isset($aPointDetails['address']))
 
  51                         $aPlace['address'] = $aPointDetails['address'];
 
  54                 if (isset($aPointDetails['asgeojson']))
 
  56                         $aPlace['geojson'] = json_decode($aPointDetails['asgeojson']);
 
  59                 if (isset($aPointDetails['assvg']))
 
  61                         $aPlace['svg'] = $aPointDetails['assvg'];
 
  64                 if (isset($aPointDetails['astext']))
 
  66                         $aPlace['geotext'] = $aPointDetails['astext'];
 
  69                 if (isset($aPointDetails['askml']))
 
  71                         $aPlace['geokml'] = $aPointDetails['askml'];
 
  74                 if (isset($aPointDetails['sExtraTags'])) $aPlace['extratags'] = $aPointDetails['sExtraTags'];
 
  75                 if (isset($aPointDetails['sNameDetails'])) $aPlace['namedetails'] = $aPointDetails['sNameDetails'];
 
  77                 $aFilteredPlaces[] = $aPlace;
 
  80         javascript_renderData($aFilteredPlaces);