You are here

public function ClientLocation::alterMap in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 src/Plugin/geolocation/MapCenter/ClientLocation.php \Drupal\geolocation\Plugin\geolocation\MapCenter\ClientLocation::alterMap()

Alter map..

Parameters

array $map: Map object.

int $center_option_id: MapCenter option ID.

array $center_option_settings: The current feature settings.

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

Return value

array Map object.

Overrides MapCenterBase::alterMap

File

src/Plugin/geolocation/MapCenter/ClientLocation.php, line 23

Class

ClientLocation
Fixed coordinates map center.

Namespace

Drupal\geolocation\Plugin\geolocation\MapCenter

Code

public function alterMap(array $map, $center_option_id, array $center_option_settings, $context = NULL) {
  $map = parent::alterMap($map, $center_option_id, $center_option_settings, $context);
  $map['#attached'] = BubbleableMetadata::mergeAttachments($map['#attached'], [
    'library' => [
      'geolocation/map_center.client_location',
    ],
  ]);
  return $map;
}