3 $aFilteredPlaces = array();
4 foreach ($aSearchResults as $iResNum => $aPointDetails) {
12 if (isset($aPointDetails['place_id'])) $aPlace['properties']['geocoding']['place_id'] = $aPointDetails['place_id'];
13 $sOSMType = formatOSMType($aPointDetails['osm_type']);
15 $aPlace['properties']['geocoding']['osm_type'] = $sOSMType;
16 $aPlace['properties']['geocoding']['osm_id'] = $aPointDetails['osm_id'];
19 $aPlace['properties']['geocoding']['type'] = $aPointDetails['type'];
21 $aPlace['properties']['geocoding']['label'] = $aPointDetails['langaddress'];
23 $aPlace['properties']['geocoding']['name'] = $aPointDetails['placename'];
25 if (isset($aPointDetails['address'])) {
26 $aPointDetails['address']->addGeocodeJsonAddressParts(
27 $aPlace['properties']['geocoding']
30 $aPlace['properties']['geocoding']['admin']
31 = $aPointDetails['address']->getAdminLevels();
34 if (isset($aPointDetails['asgeojson'])) {
35 $aPlace['geometry'] = json_decode($aPointDetails['asgeojson']);
37 $aPlace['geometry'] = array(
39 'coordinates' => array(
40 (float) $aPointDetails['lon'],
41 (float) $aPointDetails['lat']
45 $aFilteredPlaces[] = $aPlace;
49 javascript_renderData(array(
50 'type' => 'FeatureCollection',
53 'attribution' => 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright',
57 'features' => $aFilteredPlaces