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 if ($aPointDetails['placename'] !== null) {
24 $aPlace['properties']['geocoding']['name'] = $aPointDetails['placename'];
27 if (isset($aPointDetails['address'])) {
28 $aPointDetails['address']->addGeocodeJsonAddressParts(
29 $aPlace['properties']['geocoding']
32 $aPlace['properties']['geocoding']['admin']
33 = $aPointDetails['address']->getAdminLevels();
36 if (isset($aPointDetails['asgeojson'])) {
37 $aPlace['geometry'] = json_decode($aPointDetails['asgeojson']);
39 $aPlace['geometry'] = array(
41 'coordinates' => array(
42 (float) $aPointDetails['lon'],
43 (float) $aPointDetails['lat']
47 $aFilteredPlaces[] = $aPlace;
51 javascript_renderData(array(
52 'type' => 'FeatureCollection',
55 'attribution' => 'Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright',
59 'features' => $aFilteredPlaces