You are here

public function ControlCustomElementBase::alterMap in Geolocation Field 8.3

Same name in this branch
  1. 8.3 modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlCustomElementBase.php \Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature\ControlCustomElementBase::alterMap()
  2. 8.3 modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/ControlCustomElementBase.php \Drupal\geolocation_leaflet\Plugin\geolocation\MapFeature\ControlCustomElementBase::alterMap()
Same name and namespace in other branches
  1. 8.2 modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlCustomElementBase.php \Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature\ControlCustomElementBase::alterMap()

Alter render array.

Parameters

array $render_array: Render array.

array $feature_settings: The current feature settings.

array $context: Context like field formatter, field widget or view.

Return value

array Render array.

Overrides MapFeatureBase::alterMap

4 calls to ControlCustomElementBase::alterMap()
ControlCustomGeocoder::alterMap in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlCustomGeocoder.php
Alter render array.
ControlCustomLoadingIndicator::alterMap in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlCustomLoadingIndicator.php
Alter render array.
ControlCustomLocate::alterMap in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlCustomLocate.php
Alter render array.
ControlCustomRecenter::alterMap in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlCustomRecenter.php
Alter render array.
4 methods override ControlCustomElementBase::alterMap()
ControlCustomGeocoder::alterMap in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlCustomGeocoder.php
Alter render array.
ControlCustomLoadingIndicator::alterMap in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlCustomLoadingIndicator.php
Alter render array.
ControlCustomLocate::alterMap in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlCustomLocate.php
Alter render array.
ControlCustomRecenter::alterMap in modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlCustomRecenter.php
Alter render array.

File

modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlCustomElementBase.php, line 13

Class

ControlCustomElementBase
Class ControlMapFeatureBase.

Namespace

Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature

Code

public function alterMap(array $render_array, array $feature_settings, array $context = []) {
  $render_array = parent::alterMap($render_array, $feature_settings, $context);
  $render_array['#controls'][$this->pluginId] = [
    '#type' => 'container',
    '#attributes' => [
      'class' => [
        'geolocation-map-control',
        $this->pluginId,
      ],
      'data-google-map-control-position' => $feature_settings['position'],
    ],
  ];
  return $render_array;
}