public function GoogleMaps::alterCommonMap in Geolocation Field 8.3
Same name and namespace in other branches
- 8.2 modules/geolocation_google_maps/src/Plugin/geolocation/MapProvider/GoogleMaps.php \Drupal\geolocation_google_maps\Plugin\geolocation\MapProvider\GoogleMaps::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_google_maps/ src/ Plugin/ geolocation/ MapProvider/ GoogleMaps.php, line 220
Class
- GoogleMaps
- Provides Google Maps.
Namespace
Drupal\geolocation_google_maps\Plugin\geolocation\MapProviderCode
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_google_maps/commonmap.google',
],
]);
return $render_array;
}