ControlCustomElementBase.php in Geolocation Field 8.2
File
modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/ControlCustomElementBase.php
View source
<?php
namespace Drupal\geolocation_leaflet\Plugin\geolocation\MapFeature;
abstract class ControlCustomElementBase extends ControlElementBase {
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
->getPluginId(),
],
'data-control-position' => $feature_settings['position'],
],
];
return $render_array;
}
}