You are here

class GeofieldGoogleMapFormatter in Geofield Map 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/GeofieldGoogleMapFormatter.php \Drupal\geofield_map\Plugin\Field\FieldFormatter\GeofieldGoogleMapFormatter

Plugin implementation of the 'geofield_google_map' formatter.

Plugin annotation


@FieldFormatter(
  id = "geofield_google_map",
  label = @Translation("Geofield Google Map"),
  field_types = {
    "geofield"
  }
)

Hierarchy

Expanded class hierarchy of GeofieldGoogleMapFormatter

File

src/Plugin/Field/FieldFormatter/GeofieldGoogleMapFormatter.php, line 34

Namespace

Drupal\geofield_map\Plugin\Field\FieldFormatter
View source
class GeofieldGoogleMapFormatter extends FormatterBase implements ContainerFactoryPluginInterface {
  use GeofieldMapFieldTrait;

  /**
   * Empty Map Options.
   *
   * @var array
   */
  protected $emptyMapOptions = [
    '0' => 'Empty field',
    '1' => 'Custom Message',
    '2' => 'Empty Map Centered at the Default Center',
  ];

  /**
   * The config factory service.
   *
   * @var \Drupal\Core\Config\ConfigFactoryInterface
   */
  protected $config;

  /**
   * Entity manager service.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * Entity display repository.
   *
   * @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface
   */
  protected $entityDisplayRepository;

  /**
   * The Link generator Service.
   *
   * @var \Drupal\Core\Utility\LinkGeneratorInterface
   */
  protected $link;

  /**
   * The EntityField Manager service.
   *
   * @var \Drupal\Core\Entity\EntityFieldManagerInterface
   */
  protected $entityFieldManager;

  /**
   * The geoPhpWrapper service.
   *
   * @var \Drupal\geofield\GeoPHP\GeoPHPInterface
   */
  protected $geoPhpWrapper;

  /**
   * The Renderer service property.
   *
   * @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface
   */
  protected $renderer;

  /**
   * GeofieldGoogleMapFormatter constructor.
   *
   * @param string $plugin_id
   *   The plugin_id for the formatter.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The definition of the field to which the formatter is associated.
   * @param array $settings
   *   The formatter settings.
   * @param string $label
   *   The formatter label display setting.
   * @param string $view_mode
   *   The view mode.
   * @param array $third_party_settings
   *   Any third party settings settings.
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
   *   A config factory for retrieving required config objects.
   * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
   *   The Translation service.
   * @param \Drupal\Core\Utility\LinkGeneratorInterface $link_generator
   *   The Link Generator service.
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   Entity type manager service.
   * @param \Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository
   *   Entity display repository service.
   * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager
   *   The Entity Field Manager.
   * @param \Drupal\geofield\GeoPHP\GeoPHPInterface $geophp_wrapper
   *   The The geoPhpWrapper.
   * @param \Drupal\Core\Render\RendererInterface $renderer
   *   The Renderer service.
   */
  public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, ConfigFactoryInterface $config_factory, TranslationInterface $string_translation, LinkGeneratorInterface $link_generator, EntityTypeManagerInterface $entity_type_manager, EntityDisplayRepositoryInterface $entity_display_repository, EntityFieldManagerInterface $entity_field_manager, GeoPHPInterface $geophp_wrapper, RendererInterface $renderer) {
    parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
    $this->config = $config_factory;
    $this->link = $link_generator;
    $this->entityTypeManager = $entity_type_manager;
    $this->entityDisplayRepository = $entity_display_repository;
    $this->entityFieldManager = $entity_field_manager;
    $this->geoPhpWrapper = $geophp_wrapper;
    $this->renderer = $renderer;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($plugin_id, $plugin_definition, $configuration['field_definition'], $configuration['settings'], $configuration['label'], $configuration['view_mode'], $configuration['third_party_settings'], $container
      ->get('config.factory'), $container
      ->get('string_translation'), $container
      ->get('link_generator'), $container
      ->get('entity_type.manager'), $container
      ->get('entity_display.repository'), $container
      ->get('entity_field.manager'), $container
      ->get('geofield.geophp'), $container
      ->get('renderer'));
  }

  /**
   * {@inheritdoc}
   */
  public static function defaultSettings() {
    return self::getDefaultSettings() + parent::defaultSettings();
  }

  /**
   * {@inheritdoc}
   */
  public function getSettings() {

    // Merge defaults before returning the array.
    if (!$this->defaultSettingsMerged) {
      $this
        ->mergeDefaults();
    }
    return $this->settings;
  }

  /**
   * {@inheritdoc}
   */
  public function settingsForm(array $form, FormStateInterface $form_state) {
    $default_settings = self::defaultSettings();
    $settings = $this
      ->getSettings();
    $elements = $this
      ->generateGMapSettingsForm($form, $form_state, $settings, $default_settings);
    return $elements + parent::settingsForm($form, $form_state);
  }

  /**
   * {@inheritdoc}
   */
  public function settingsSummary() {
    $settings = $this
      ->getSettings();
    $gmap_api_key = $this
      ->getGmapApiKey();

    // Define the Google Maps API Key value message string.
    if (!empty($gmap_api_key)) {
      $state = $this->link
        ->generate($gmap_api_key, Url::fromRoute('geofield_map.settings', [], [
        'query' => [
          'destination' => Url::fromRoute('<current>')
            ->toString(),
        ],
      ]));
    }
    else {
      $state = $this
        ->t("<span class='geofield-map-warning'>Gmap Api Key missing<br>Google Maps functionality may not be available.</span> @settings_page_link", [
        '@settings_page_link' => $this->link
          ->generate($this
          ->t('Set it in the Geofield Map Configuration Page'), Url::fromRoute('geofield_map.settings', [], [
          'query' => [
            'destination' => Url::fromRoute('<current>')
              ->toString(),
          ],
        ])),
      ]);
    }
    $map_gmap_api_key = [
      '#markup' => $this
        ->t('Google Maps API Key: @state', [
        '@state' => $state,
      ]),
    ];
    $map_dimensions = [
      '#markup' => $this
        ->t('Map Dimensions: Width: @width - Height: @height', [
        '@width' => $settings['map_dimensions']['width'],
        '@height' => $settings['map_dimensions']['height'],
      ]),
    ];
    $map_empty = [
      '#type' => 'html_tag',
      '#tag' => 'div',
      '#value' => $this
        ->t('Behaviour for the Empty Map: @state', [
        '@state' => $this->emptyMapOptions[$settings['map_empty']['empty_behaviour']],
      ]),
    ];
    if ($settings['map_empty']['empty_behaviour'] === '1') {
      $map_empty['message'] = [
        '#markup' => $this
          ->t('Empty Field Message: Width: @state', [
          '@state' => $settings['map_empty']['empty_message'],
        ]),
      ];
    }
    $map_center = [
      '#type' => 'html_tag',
      '#tag' => 'div',
      '#value' => $this
        ->t('Map Default Center: @state_lat, @state_lon', [
        '@state_lat' => $settings['map_center']['lat'],
        '@state_lon' => $settings['map_center']['lon'],
      ]),
      'center_force' => [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Force Map Center: @state', [
          '@state' => $settings['map_center']['center_force'] ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ],
    ];
    $map_zoom_and_pan = [
      '#type' => 'html_tag',
      '#tag' => 'div',
      '#value' => '<u>' . $this
        ->t('Map Zoom and Pan:') . '</u>',
      'zoom' => [
        'initial' => [
          '#type' => 'html_tag',
          '#tag' => 'div',
          '#value' => $this
            ->t('Start Zoom: @state', [
            '@state' => $settings['map_zoom_and_pan']['zoom']['initial'],
          ]),
        ],
        'force' => [
          '#type' => 'html_tag',
          '#tag' => 'div',
          '#value' => $this
            ->t('Force Start Zoom: @state', [
            '@state' => $settings['map_zoom_and_pan']['zoom']['force'] ? $this
              ->t('Yes') : $this
              ->t('No'),
          ]),
        ],
        'min' => [
          '#type' => 'html_tag',
          '#tag' => 'div',
          '#value' => $this
            ->t('Min Zoom: @state', [
            '@state' => $settings['map_zoom_and_pan']['zoom']['min'],
          ]),
        ],
        'max' => [
          '#type' => 'html_tag',
          '#tag' => 'div',
          '#value' => $this
            ->t('Max Zoom: @state', [
            '@state' => $settings['map_zoom_and_pan']['zoom']['max'],
          ]),
        ],
      ],
      'scrollwheel' => [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Scrollwheel: @state', [
          '@state' => $settings['map_zoom_and_pan']['scrollwheel'] ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ],
      'draggable' => [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Draggable: @state', [
          '@state' => $settings['map_zoom_and_pan']['draggable'] ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ],
      'map_reset' => [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Map Reset Control: @state', [
          '@state' => !empty($settings['map_zoom_and_pan']['map_reset']) ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ],
    ];

    // Remove the unselected array keys
    // from the map_type_control_options_type_ids.
    $map_type_control_options_type_ids = array_filter($settings['map_controls']['map_type_control_options_type_ids'], function ($value) {
      return $value !== 0;
    });
    $map_controls = [
      '#type' => 'html_tag',
      '#tag' => 'div',
      '#value' => '<u>' . $this
        ->t('Map Controls:') . '</u>',
      'disable_default_ui' => [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Disable Default UI: @state', [
          '@state' => $settings['map_controls']['disable_default_ui'] ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ],
      'map_type_id' => [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Default Map Type: @state', [
          '@state' => $settings['map_controls']['map_type_id'],
        ]),
      ],
    ];
    if (!$settings['map_controls']['disable_default_ui']) {
      $map_controls['zoom_control'] = [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Zoom Control: @state', [
          '@state' => $settings['map_controls']['zoom_control'] ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ];
      $map_controls['map_type_control'] = [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Map Type Control: @state', [
          '@state' => $settings['map_controls']['map_type_control'] ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ];
      $map_controls['map_type_control_options_type_ids'] = [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $settings['map_controls']['map_type_control'] ? $this
          ->t('Enabled Map Types: @state', [
          '@state' => implode(', ', array_keys($map_type_control_options_type_ids)),
        ]) : '',
      ];
      $map_controls['scale_control'] = [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Scale Control: @state', [
          '@state' => $settings['map_controls']['scale_control'] ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ];
      $map_controls['street_view_control'] = [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Streetview Control: @state', [
          '@state' => $settings['map_controls']['street_view_control'] ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ];
      $map_controls['fullscreen_control'] = [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Fullscreen Control: @state', [
          '@state' => $settings['map_controls']['fullscreen_control'] ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ];
    }
    $map_marker_and_infowindow = [
      '#type' => 'html_tag',
      '#tag' => 'div',
      '#value' => '<u>' . $this
        ->t('Map Marker and Infowindow:') . '</u>',
      'icon_image_path' => [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Marker Icon: @state', [
          '@state' => !empty($settings['map_marker_and_infowindow']['icon_image_path']) ? $settings['map_marker_and_infowindow']['icon_image_path'] : $this
            ->t('Default Google Marker'),
        ]),
      ],
      'infowindow_field' => [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Marker Infowindow @state', [
          '@state' => !empty($settings['map_marker_and_infowindow']['infowindow_field']) ? 'from: ' . $settings['map_marker_and_infowindow']['infowindow_field'] : $this
            ->t('disabled'),
        ]),
      ],
      'force_open' => [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Open Infowindow on Load: @state', [
          '@state' => $settings['map_marker_and_infowindow']['force_open'] ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ],
    ];
    if ($settings['map_marker_and_infowindow']['infowindow_field'] == '#rendered_entity') {
      $map_marker_and_infowindow['view_mode'] = [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('View Mode: @state', [
          '@state' => $settings['map_marker_and_infowindow']['view_mode'],
        ]),
      ];
    }
    if (!empty($settings['map_additional_options'])) {
      $map_additional_options = [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Map Additional Options:'),
        'value' => [
          '#type' => 'html_tag',
          '#tag' => 'div',
          '#value' => $settings['map_additional_options'],
        ],
      ];
    }
    $map_oms = [
      '#type' => 'html_tag',
      '#tag' => 'div',
      '#value' => '<u>' . $this
        ->t('Overlapping Markers:') . '</u>',
      'map_oms_control' => [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Spiderfy overlapping markers: @state', [
          '@state' => $settings['map_oms']['map_oms_control'] ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ],
    ];
    $map_markercluster = [
      '#type' => 'html_tag',
      '#tag' => 'div',
      '#value' => '<u>' . $this
        ->t('Marker Clustering:') . '</u>',
      'markercluster_control' => [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Marker Cluster Enabled: @state', [
          '@state' => $settings['map_markercluster']['markercluster_control'] ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ],
    ];
    if (!empty($settings['map_markercluster']['markercluster_additional_options'])) {
      $map_markercluster['markercluster_additional_options'] = [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Marker Cluster Additional Options:'),
        'value' => [
          '#type' => 'html_tag',
          '#tag' => 'div',
          '#value' => $settings['map_markercluster']['markercluster_additional_options'],
        ],
      ];
    }
    $custom_style_map = [
      '#type' => 'html_tag',
      '#tag' => 'div',
      '#value' => $this
        ->t('Custom Style Map: @state', [
        '@state' => $settings['custom_style_map']['custom_style_control'] ? $this
          ->t('Yes') : $this
          ->t('No'),
      ]),
    ];
    if ($settings['custom_style_map']['custom_style_control']) {
      $custom_style_map['custom_style_name'] = [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Custom Style Name: @state', [
          '@state' => $settings['custom_style_map']['custom_style_name'],
        ]),
      ];
      $custom_style_map['custom_style_default'] = [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $this
          ->t('Custom Map Style as Default: @state', [
          '@state' => $settings['custom_style_map']['custom_style_default'] ? $this
            ->t('Yes') : $this
            ->t('No'),
        ]),
      ];
    }
    $summary = [
      'map_gmap_api_key' => $map_gmap_api_key,
      'map_dimensions' => $map_dimensions,
      'map_empty' => $map_empty,
      'map_center' => $map_center,
      'map_zoom_and_pan' => $map_zoom_and_pan,
      'map_controls' => $map_controls,
      'map_marker_and_infowindow' => $map_marker_and_infowindow,
      'map_additional_options' => isset($map_additional_options) ? $map_additional_options : NULL,
      'map_oms' => $map_oms,
      'map_markercluster' => $map_markercluster,
      'custom_style_map' => $custom_style_map,
    ];

    // Attach Geofield Map Library.
    $summary['library'] = [
      '#attached' => [
        'library' => [
          'geofield_map/geofield_map_general',
        ],
      ],
    ];
    return $summary;
  }

  /**
   * {@inheritdoc}
   */
  public function viewElements(FieldItemListInterface $items, $langcode) {

    // This avoids the infinite loop by stopping the display
    // of any map embedded in an infowindow.
    $view_in_progress =& drupal_static(__FUNCTION__);
    if ($view_in_progress) {
      return [];
    }
    $view_in_progress = TRUE;

    /* @var \Drupal\Core\Entity\EntityInterface $entity */
    $entity = $items
      ->getEntity();

    // Take the entity translation, if existing.

    /* @var \Drupal\Core\TypedData\TranslatableInterface $entity */
    if ($entity
      ->hasTranslation($langcode)) {
      $entity = $entity
        ->getTranslation($langcode);
    }
    $entity_type = $entity
      ->getEntityTypeId();
    $bundle = $entity
      ->bundle();
    $entity_id = $entity
      ->id();

    /* @var \Drupal\Core\Field\FieldDefinitionInterface $field */
    $field = $items
      ->getFieldDefinition();
    $map_settings = $this
      ->getSettings();

    // Performs some preprocess on the maps settings before sending to js.
    $this
      ->preProcessMapSettings($map_settings);
    $js_settings = [
      'mapid' => Html::getUniqueId("geofield_map_entity_{$bundle}_{$entity_id}_{$field->getName()}"),
      'map_settings' => $map_settings,
      'data' => [],
    ];
    $description_field = isset($map_settings['map_marker_and_infowindow']['infowindow_field']) ? $map_settings['map_marker_and_infowindow']['infowindow_field'] : NULL;
    $description = [];

    // Render the entity with the selected view mode.
    if (isset($description_field) && $description_field === '#rendered_entity' && is_object($entity)) {
      $build = $this->entityTypeManager
        ->getViewBuilder($entity_type)
        ->view($entity, $map_settings['map_marker_and_infowindow']['view_mode']);
      $description[] = $this->renderer
        ->renderPlain($build);
    }
    elseif (isset($description_field)) {
      $description_field_name = strtolower($map_settings['map_marker_and_infowindow']['infowindow_field']);
      if ($map_settings['map_marker_and_infowindow']['infowindow_field'] === 'title') {
        $description[] = $entity
          ->label();
      }
      elseif (isset($entity->{$description_field_name})) {
        foreach ($entity->{$description_field_name}
          ->getValue() as $value) {
          $description[] = isset($value['value']) ? $value['value'] : '';
          if ($map_settings['map_marker_and_infowindow']['multivalue_split'] == FALSE) {
            break;
          }
        }
      }
    }
    $data = $this
      ->getGeoJsonData($items, $description);
    if (empty($data) && $map_settings['map_empty']['empty_behaviour'] !== '2') {
      $view_in_progress = FALSE;
      return [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#value' => $map_settings['map_empty']['empty_behaviour'] === '1' ? $map_settings['map_empty']['empty_message'] : '',
        '#attributes' => [
          'class' => [
            'empty-geofield',
          ],
        ],
      ];
    }
    else {
      $js_settings['data'] = [
        'type' => 'FeatureCollection',
        'features' => $data,
      ];
    }
    $element = [
      geofield_map_googlemap_render($js_settings),
    ];

    // Part of infinite loop stopping strategy.
    $view_in_progress = FALSE;
    return $element;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
FormatterBase::$fieldDefinition protected property The field definition.
FormatterBase::$label protected property The label display setting.
FormatterBase::$settings protected property The formatter settings. Overrides PluginSettingsBase::$settings
FormatterBase::$viewMode protected property The view mode.
FormatterBase::getFieldSetting protected function Returns the value of a field setting.
FormatterBase::getFieldSettings protected function Returns the array of field settings.
FormatterBase::isApplicable public static function Returns if the formatter can be used for the provided field. Overrides FormatterInterface::isApplicable 14
FormatterBase::prepareView public function Allows formatters to load information for field values being displayed. Overrides FormatterInterface::prepareView 2
FormatterBase::view public function Builds a renderable array for a fully themed field. Overrides FormatterInterface::view 1
GeofieldGoogleMapFormatter::$config protected property The config factory service.
GeofieldGoogleMapFormatter::$emptyMapOptions protected property Empty Map Options.
GeofieldGoogleMapFormatter::$entityDisplayRepository protected property Entity display repository.
GeofieldGoogleMapFormatter::$entityFieldManager protected property The EntityField Manager service.
GeofieldGoogleMapFormatter::$entityTypeManager protected property Entity manager service.
GeofieldGoogleMapFormatter::$geoPhpWrapper protected property The geoPhpWrapper service.
GeofieldGoogleMapFormatter::$link protected property The Link generator Service.
GeofieldGoogleMapFormatter::$renderer protected property The Renderer service property.
GeofieldGoogleMapFormatter::create public static function Creates an instance of the plugin. Overrides FormatterBase::create
GeofieldGoogleMapFormatter::defaultSettings public static function Defines the default settings for this plugin. Overrides PluginSettingsBase::defaultSettings
GeofieldGoogleMapFormatter::getSettings public function Returns the array of settings, including defaults for missing settings. Overrides PluginSettingsBase::getSettings
GeofieldGoogleMapFormatter::settingsForm public function Returns a form to configure settings for the formatter. Overrides FormatterBase::settingsForm
GeofieldGoogleMapFormatter::settingsSummary public function Returns a short summary for the current formatter settings. Overrides FormatterBase::settingsSummary
GeofieldGoogleMapFormatter::viewElements public function Builds a renderable array for a field value. Overrides FormatterInterface::viewElements
GeofieldGoogleMapFormatter::__construct public function GeofieldGoogleMapFormatter constructor. Overrides FormatterBase::__construct
GeofieldMapFieldTrait::$customMapStylePlaceholder protected property
GeofieldMapFieldTrait::$gMapTypesOptions protected property Google Map Types Options.
GeofieldMapFieldTrait::$infowindowFieldTypesOptions protected property Google Map Types Options.
GeofieldMapFieldTrait::customMapStyleValidate public static function Form element validation handler for a Custom Map Style Name Required.
GeofieldMapFieldTrait::generateGmapSettingsForm public function Generate the Google Map Settings Form.
GeofieldMapFieldTrait::getDefaultSettings public static function Get the Default Settings.
GeofieldMapFieldTrait::getGeoJsonData protected function Transform Geofield data into Geojson features.
GeofieldMapFieldTrait::getGmapApiKey private function Get the GMap Api Key from the geofield_map settings/configuration.
GeofieldMapFieldTrait::jsonValidate public static function Form element json format validation handler.
GeofieldMapFieldTrait::maxZoomLevelValidate public static function Form element validation handler for the Map Max Zoom level.
GeofieldMapFieldTrait::preProcessMapSettings protected function Pre Process the MapSettings.
GeofieldMapFieldTrait::setCustomStyleMapElement private function Set Custom Map Style Element.
GeofieldMapFieldTrait::setMapAdditionalOptionsElement private function Set Map Additional Options Element.
GeofieldMapFieldTrait::setMapCenterElement private function Set Map Center Element.
GeofieldMapFieldTrait::setMapControlsElement private function Set Map Control Element.
GeofieldMapFieldTrait::setMapDimensionsElement private function Set Map Dimension Element.
GeofieldMapFieldTrait::setMapEmptyElement private function Set Map Empty Options Element.
GeofieldMapFieldTrait::setMapGoogleApiKeyElement private function Set Map Google Api Key Element.
GeofieldMapFieldTrait::setMapMarkerAndInfowindowElement private function Set Map Marker and Infowindow Element.
GeofieldMapFieldTrait::setMapMarkerclusterElement private function Set Map Marker Cluster Element.
GeofieldMapFieldTrait::setMapOmsElement private function Set Overlapping Marker Spiderfier Element.
GeofieldMapFieldTrait::setMapZoomAndPanElement private function Set Map Zoom and Pan Element.
GeofieldMapFieldTrait::urlValidate public static function Form element url format validation handler.
GeofieldMapFieldTrait::zoomLevelValidate public static function Form element validation handler for a Map Zoom level.
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginSettingsBase::$defaultSettingsMerged protected property Whether default settings have been merged into the current $settings.
PluginSettingsBase::$thirdPartySettings protected property The plugin settings injected by third party modules.
PluginSettingsBase::calculateDependencies public function Calculates dependencies for the configured plugin. Overrides DependentPluginInterface::calculateDependencies 6
PluginSettingsBase::getSetting public function Returns the value of a setting, or its default value if absent. Overrides PluginSettingsInterface::getSetting
PluginSettingsBase::getThirdPartyProviders public function Gets the list of third parties that store information. Overrides ThirdPartySettingsInterface::getThirdPartyProviders
PluginSettingsBase::getThirdPartySetting public function Gets the value of a third-party setting. Overrides ThirdPartySettingsInterface::getThirdPartySetting
PluginSettingsBase::getThirdPartySettings public function Gets all third-party settings of a given module. Overrides ThirdPartySettingsInterface::getThirdPartySettings
PluginSettingsBase::mergeDefaults protected function Merges default settings values into $settings.
PluginSettingsBase::onDependencyRemoval public function Informs the plugin that some configuration it depends on will be deleted. Overrides PluginSettingsInterface::onDependencyRemoval 3
PluginSettingsBase::setSetting public function Sets the value of a setting for the plugin. Overrides PluginSettingsInterface::setSetting
PluginSettingsBase::setSettings public function Sets the settings for the plugin. Overrides PluginSettingsInterface::setSettings
PluginSettingsBase::setThirdPartySetting public function Sets the value of a third-party setting. Overrides ThirdPartySettingsInterface::setThirdPartySetting
PluginSettingsBase::unsetThirdPartySetting public function Unsets a third-party setting. Overrides ThirdPartySettingsInterface::unsetThirdPartySetting
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.