ClientLocation.php in Geolocation Field 8.3
File
src/Plugin/geolocation/MapCenter/ClientLocation.php
View source
<?php
namespace Drupal\geolocation\Plugin\geolocation\MapCenter;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\geolocation\MapCenterInterface;
use Drupal\geolocation\MapCenterBase;
class ClientLocation extends MapCenterBase implements MapCenterInterface {
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;
}
}