You are here

interface MapFeatureInterface in Geolocation Field 8.2

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

Defines an interface for geolocation MapFeature plugins.

Hierarchy

Expanded class hierarchy of MapFeatureInterface

All classes that implement MapFeatureInterface

File

src/MapFeatureInterface.php, line 11

Namespace

Drupal\geolocation
View source
interface MapFeatureInterface extends PluginInspectionInterface {

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

  /**
   * Provide map feature specific settings ready to handover to JS.
   *
   * @param array $settings
   *   Current general map settings. Might contain unrelated settings as well.
   *
   * @return array
   *   An array only containing keys defined in this plugin.
   */
  public function getSettings(array $settings);

  /**
   * Provide a summary array to use in field formatters.
   *
   * @param array $settings
   *   The current map settings.
   *
   * @return array
   *   An array to use as field formatter summary.
   */
  public function getSettingsSummary(array $settings);

  /**
   * Provide a generic map settings form array.
   *
   * @param array $settings
   *   The current map settings.
   * @param array $parents
   *   Form specific optional prefix.
   *
   * @return array
   *   A form array to be integrated in whatever.
   */
  public function getSettingsForm(array $settings, array $parents);

  /**
   * Validate Feature Form.
   *
   * @param array $values
   *   Feature values.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   Form State.
   * @param array $parents
   *   Element parents.
   */
  public function validateSettingsForm(array $values, FormStateInterface $form_state, array $parents);

  /**
   * Alter render array.
   *
   * @param array $render_array
   *   Render array.
   * @param array $feature_settings
   *   The current feature settings.
   * @param array $context
   *   Context like field formatter, field widget or view.
   *
   * @return array
   *   Render array.
   */
  public function alterMap(array $render_array, array $feature_settings, array $context);

}

Members

Namesort descending Modifiers Type Description Overrides
MapFeatureInterface::alterMap public function Alter render array. 1
MapFeatureInterface::getDefaultSettings public static function Provide a populated settings array. 1
MapFeatureInterface::getSettings public function Provide map feature specific settings ready to handover to JS. 1
MapFeatureInterface::getSettingsForm public function Provide a generic map settings form array. 1
MapFeatureInterface::getSettingsSummary public function Provide a summary array to use in field formatters. 1
MapFeatureInterface::validateSettingsForm public function Validate Feature Form. 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