You are here

interface LocationInterface in Geolocation Field 8.2

Same name and namespace in other branches
  1. 8.3 src/LocationInterface.php \Drupal\geolocation\LocationInterface

Defines an interface for geolocation Location plugins.

Hierarchy

Expanded class hierarchy of LocationInterface

All classes that implement LocationInterface

7 files declare their use of LocationInterface
FirstRow.php in src/Plugin/geolocation/Location/FirstRow.php
FixedCoordinates.php in src/Plugin/geolocation/Location/FixedCoordinates.php
FreeGeoIp.php in src/Plugin/geolocation/Location/FreeGeoIp.php
ViewsBoundaryArgument.php in src/Plugin/geolocation/Location/ViewsBoundaryArgument.php
ViewsEntityArgument.php in src/Plugin/geolocation/Location/ViewsEntityArgument.php

... See full list

File

src/LocationInterface.php, line 10

Namespace

Drupal\geolocation
View source
interface LocationInterface extends PluginInspectionInterface {

  /**
   * Provide a populated settings array.
   *
   * @return array
   *   The settings array with the default map settings.
   */
  public static function getDefaultSettings();

  /**
   * Provide Location option specific settings.
   *
   * @param array $settings
   *   Current settings.
   *
   * @return array
   *   An array only containing keys defined in this plugin.
   */
  public function getSettings(array $settings);

  /**
   * Settings form by ID and context.
   *
   * @param int $location_option_id
   *   Location option ID.
   * @param array $settings
   *   The current option settings.
   * @param mixed $context
   *   Current context.
   *
   * @return array
   *   A form array to be integrated in whatever.
   */
  public function getSettingsForm($location_option_id, array $settings, $context = NULL);

  /**
   * For one Location (i.e. boundary filter), return all options (all filters).
   *
   * @param mixed $context
   *   Context like field formatter, field widget or view.
   *
   * @return array
   *   Available location options indexed by ID.
   */
  public function getAvailableLocationOptions($context);

  /**
   * Get map location.
   *
   * @param int $location_option_id
   *   Location option ID.
   * @param array $location_option_settings
   *   The current feature settings.
   * @param mixed $context
   *   Context like field formatter, field widget or view.
   *
   * @return array
   *   With content
   *    'lat' => latitude
   *    'lng' => longitude
   */
  public function getCoordinates($location_option_id, array $location_option_settings, $context = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
LocationInterface::getAvailableLocationOptions public function For one Location (i.e. boundary filter), return all options (all filters). 1
LocationInterface::getCoordinates public function Get map location. 1
LocationInterface::getDefaultSettings public static function Provide a populated settings array. 1
LocationInterface::getSettings public function Provide Location option specific settings. 1
LocationInterface::getSettingsForm public function Settings form by ID and context. 1
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2