You are here

ProviderInterface.php in Geocoder 8.3

Same filename and directory in other branches
  1. 8.2 src/ProviderInterface.php

Namespace

Drupal\geocoder

File

src/ProviderInterface.php
View source
<?php

namespace Drupal\geocoder;


/**
 * Provides an interface for geocoder provider plugins.
 *
 * Providers are plugins that knows how to parse an input, passed as string, and
 * transform it into geographical data.
 */
interface ProviderInterface {

  /**
   * Geocode a source string.
   *
   * @param string $source
   *   The data to be geocoded.
   *
   * @return \Geocoder\Model\AddressCollection|\Geometry|null
   *   The address collection, or the geometry, or NULL.
   */
  public function geocode($source);

  /**
   * Reverse geocode latitude and longitude.
   *
   * @param float $latitude
   *   The latitude.
   * @param float $longitude
   *   The longitude.
   *
   * @return \Geocoder\Model\AddressCollection|null
   *   The AddressCollection object, NULL otherwise.
   */
  public function reverse($latitude, $longitude);

}

Interfaces

Namesort descending Description
ProviderInterface Provides an interface for geocoder provider plugins.