public function Austria::format in Geolocation Field 8.3
Same name and namespace in other branches
- 8.2 modules/geolocation_google_maps/src/Plugin/geolocation/GeocoderCountryFormatting/Austria.php \Drupal\geolocation_google_maps\Plugin\geolocation\GeocoderCountryFormatting\Austria::format()
Reverse geocode an address.
Intended return subject to available data:
[
'organization',
'address_line1',
'address_line2',
'postal_code',
'sorting_code',
'dependent_locality',
'dependent_locality_code',
'locality',
'locality_code',
'administrative_area',
'administrative_area_code',
'country',
'country_code',
'formatted_address',
];
Parameters
array $atomics: Address components.
Return value
array||null Address or NULL.
Overrides GoogleCountryFormattingBase::format
File
- modules/
geolocation_google_maps/ src/ Plugin/ geolocation/ GeocoderCountryFormatting/ Austria.php, line 21
Class
- Austria
- Provides address formatting.
Namespace
Drupal\geolocation_google_maps\Plugin\geolocation\GeocoderCountryFormattingCode
public function format(array $atomics) {
$address_elements = parent::format($atomics);
if (isset($atomics['streetNumber']) && $atomics['streetNumber'] && isset($atomics['route']) && $atomics['route']) {
$address_elements['addressLine1'] = $atomics['route'] . ' ' . $atomics['streetNumber'];
}
return $address_elements;
}