public function ControlCustomElementBase::alterMap in Geolocation Field 8.2
Same name in this branch
- 8.2 modules/geolocation_google_maps/src/Plugin/geolocation/MapFeature/ControlCustomElementBase.php \Drupal\geolocation_google_maps\Plugin\geolocation\MapFeature\ControlCustomElementBase::alterMap()
- 8.2 modules/geolocation_leaflet/src/Plugin/geolocation/MapFeature/ControlCustomElementBase.php \Drupal\geolocation_leaflet\Plugin\geolocation\MapFeature\ControlCustomElementBase::alterMap()
Same name and namespace in other branches
- 8.3 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
3 calls to ControlCustomElementBase::alterMap()
- ControlCustomGeocoder::alterMap in modules/
geolocation_google_maps/ src/ Plugin/ geolocation/ MapFeature/ ControlCustomGeocoder.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.
3 methods override ControlCustomElementBase::alterMap()
- ControlCustomGeocoder::alterMap in modules/
geolocation_google_maps/ src/ Plugin/ geolocation/ MapFeature/ ControlCustomGeocoder.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\MapFeatureCode
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;
}