- if (isset($_GET['json_callback']) && preg_match('/^[-A-Za-z0-9:_]+$/',$_GET['json_callback']))
- {
- echo $_GET['json_callback'].'('.javascript_renderData($aFilteredPlaces).')';
- }
- else
- {
- echo javascript_renderData($aFilteredPlaces);
- }
+ if (isset($aPlace['aAddress'])) $aFilteredPlaces['address'] = $aPlace['aAddress'];
+ if (isset($aPlace['sExtraTags'])) $aFilteredPlaces['extratags'] = $aPlace['sExtraTags'];
+ if (isset($aPlace['sNameDetails'])) $aFilteredPlaces['namedetails'] = $aPlace['sNameDetails'];
+
+ if (isset($aPlace['aBoundingBox']))
+ {
+ $aFilteredPlaces['boundingbox'] = $aPlace['aBoundingBox'];
+
+ if (isset($aPlace['aPolyPoints']) && $bAsPoints)
+ {
+ $aFilteredPlaces['polygonpoints'] = $aPlace['aPolyPoints'];
+ }
+ }
+
+ if (isset($aPlace['asgeojson']))
+ {
+ $aFilteredPlaces['geojson'] = json_decode($aPlace['asgeojson']);
+ }