public function YandexBalloon::alterMap in Geolocation Field 8.3
Same name and namespace in other branches
- 8.2 modules/geolocation_yandex/src/Plugin/geolocation/MapFeature/YandexBalloon.php \Drupal\geolocation_yandex\Plugin\geolocation\MapFeature\YandexBalloon::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
File
- modules/
geolocation_yandex/ src/ Plugin/ geolocation/ MapFeature/ YandexBalloon.php, line 65
Class
- YandexBalloon
- Provides marker balloon.
Namespace
Drupal\geolocation_yandex\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['#attached'] = BubbleableMetadata::mergeAttachments(empty($render_array['#attached']) ? [] : $render_array['#attached'], [
'library' => [
'geolocation_yandex/mapfeature.' . $this
->getPluginId(),
],
'drupalSettings' => [
'geolocation' => [
'maps' => [
$render_array['#id'] => [
$this
->getPluginId() => [
'enable' => TRUE,
'infoAutoDisplay' => $feature_settings['info_auto_display'],
'disableAutoPan' => $feature_settings['disable_auto_pan'],
'maxWidth' => $feature_settings['max_width'],
'panelMaxMapArea' => $feature_settings['panel_max_map_area'],
],
],
],
],
],
]);
return $render_array;
}