You are here

interface GeocoderInterface in Geocoder 8.3

Same name and namespace in other branches
  1. 8.2 src/GeocoderInterface.php \Drupal\geocoder\GeocoderInterface

Provides a geocoder factory method interface.

Hierarchy

Expanded class hierarchy of GeocoderInterface

All classes that implement GeocoderInterface

4 files declare their use of GeocoderInterface
AddressGeocodeFormatter.php in modules/geocoder_address/src/Plugin/Field/FieldFormatter/AddressGeocodeFormatter.php
FileGeocodeFormatter.php in modules/geocoder_field/src/Plugin/Field/FieldFormatter/FileGeocodeFormatter.php
GeocodeFormatterBase.php in modules/geocoder_field/src/Plugin/Field/GeocodeFormatterBase.php
GeoPhpGeocodeFormatter.php in modules/geocoder_geofield/src/Plugin/Field/FieldFormatter/GeoPhpGeocodeFormatter.php

File

src/GeocoderInterface.php, line 10

Namespace

Drupal\geocoder
View source
interface GeocoderInterface {

  /**
   * Geocodes a string.
   *
   * @param string $address_string
   *   The string to geocode.
   * @param \Drupal\geocoder\GeocoderProviderInterface[] $providers
   *   A list of Geocoder providers to use to perform the geocoding.
   *
   * @return \Geocoder\Model\AddressCollection|\Geometry|null
   *   An address collection or NULL on geocoding failure.
   */
  public function geocode(string $address_string, array $providers);

  /**
   * Reverse geocodes coordinates.
   *
   * @param string $latitude
   *   The latitude.
   * @param string $longitude
   *   The longitude.
   * @param \Drupal\geocoder\GeocoderProviderInterface[] $providers
   *   A list of Geocoder providers to use to perform the reverse geocoding.
   *
   * @return \Geocoder\Model\AddressCollection|null
   *   An address collection or NULL on geocoding failure.
   */
  public function reverse(string $latitude, string $longitude, array $providers) : ?AddressCollection;

}

Members

Namesort descending Modifiers Type Description Overrides
GeocoderInterface::geocode public function Geocodes a string. 1
GeocoderInterface::reverse public function Reverse geocodes coordinates. 1