You are here

interface MapCenterInterface in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 src/MapCenterInterface.php \Drupal\geolocation\MapCenterInterface

Defines an interface for geolocation MapCenter plugins.

Hierarchy

Expanded class hierarchy of MapCenterInterface

All classes that implement MapCenterInterface

6 files declare their use of MapCenterInterface
ClientLocation.php in src/Plugin/geolocation/MapCenter/ClientLocation.php
FitLocations.php in src/Plugin/geolocation/MapCenter/FitLocations.php
FixedBoundaries.php in src/Plugin/geolocation/MapCenter/FixedBoundaries.php
Location.php in src/Plugin/geolocation/MapCenter/Location.php
ViewsBoundaryArgument.php in src/Plugin/geolocation/MapCenter/ViewsBoundaryArgument.php

... See full list

File

src/MapCenterInterface.php, line 10

Namespace

Drupal\geolocation
View source
interface MapCenterInterface extends PluginInspectionInterface {

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

  /**
   * Provide MapCenter 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 $center_option_id
   *   MapCenter 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($center_option_id, array $settings, $context = NULL);

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

  /**
   * Alter map..
   *
   * @param array $map
   *   Map object.
   * @param int $center_option_id
   *   MapCenter option ID.
   * @param array $center_option_settings
   *   The current feature settings.
   * @param mixed $context
   *   Context like field formatter, field widget or view.
   *
   * @return array
   *   Map object.
   */
  public function alterMap(array $map, $center_option_id, array $center_option_settings, $context = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
MapCenterInterface::alterMap public function Alter map.. 1
MapCenterInterface::getAvailableMapCenterOptions public function For one MapCenter (i.e. boundary filter), return all options (all filters). 1
MapCenterInterface::getDefaultSettings public static function Provide a populated settings array. 1
MapCenterInterface::getSettings public function Provide MapCenter option specific settings. 1
MapCenterInterface::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