You are here

public function GeocoderCountryFormattingBase::format in Geolocation Field 8.2

Same name and namespace in other branches
  1. 8.3 src/GeocoderCountryFormattingBase.php \Drupal\geolocation\GeocoderCountryFormattingBase::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 GeocoderCountryFormattingInterface::format

2 calls to GeocoderCountryFormattingBase::format()
GoogleCountryFormattingBase::format in modules/geolocation_google_maps/src/GoogleCountryFormattingBase.php
Reverse geocode an address.
NominatimCountryFormattingBase::format in modules/geolocation_leaflet/src/NominatimCountryFormattingBase.php
Reverse geocode an address.
2 methods override GeocoderCountryFormattingBase::format()
GoogleCountryFormattingBase::format in modules/geolocation_google_maps/src/GoogleCountryFormattingBase.php
Reverse geocode an address.
NominatimCountryFormattingBase::format in modules/geolocation_leaflet/src/NominatimCountryFormattingBase.php
Reverse geocode an address.

File

src/GeocoderCountryFormattingBase.php, line 15

Class

GeocoderCountryFormattingBase
Defines an interface for geolocation google geocoder country plugins.

Namespace

Drupal\geolocation

Code

public function format(array $atomics) {
  $address_elements = [
    'organization' => '',
    'addressLine1' => '',
    'addressLine2' => '',
    'locality' => '',
    'postalCode' => '',
    'administrativeArea' => '',
    'countryCode' => '',
  ];
  return $address_elements;
}