You are here

public function Yandex::alterCommonMap in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 modules/geolocation_yandex/src/Plugin/geolocation/MapProvider/Yandex.php \Drupal\geolocation_yandex\Plugin\geolocation\MapProvider\Yandex::alterCommonMap()

Alter common map build array.

Parameters

array $render_array: Render array.

array $map_settings: The current map settings.

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

Return value

array Render attachments.

Overrides MapProviderBase::alterCommonMap

File

modules/geolocation_yandex/src/Plugin/geolocation/MapProvider/Yandex.php, line 194

Class

Yandex
Provides Yandex Maps API.

Namespace

Drupal\geolocation_yandex\Plugin\geolocation\MapProvider

Code

public function alterCommonMap(array $render_array, array $map_settings, array $context) {
  $render_array['#attached'] = BubbleableMetadata::mergeAttachments(empty($render_array['#attached']) ? [] : $render_array['#attached'], [
    'library' => [
      'geolocation_yandex/commonmap.yandex',
    ],
  ]);
  return $render_array;
}