public function GeolocationBlock::defaultConfiguration in Geolocation Field 8.3
Same name and namespace in other branches
- 8.2 src/Plugin/Block/GeolocationBlock.php \Drupal\geolocation\Plugin\Block\GeolocationBlock::defaultConfiguration()
Overrides BlockPluginTrait::defaultConfiguration
File
- src/
Plugin/ Block/ GeolocationBlock.php, line 75
Class
- GeolocationBlock
- Exposes a map rendered as a block.
Namespace
Drupal\geolocation\Plugin\BlockCode
public function defaultConfiguration() {
$configuration = parent::defaultConfiguration();
$configuration['map_provider_id'] = '';
if (\Drupal::moduleHandler()
->moduleExists('geolocation_google_maps')) {
$configuration['map_provider_id'] = 'google_maps';
}
elseif (\Drupal::moduleHandler()
->moduleExists('geolocation_leaflet')) {
$configuration['map_provider_id'] = 'leaflet';
}
$configuration['map_provider_settings'] = [];
$configuration['centre'] = [];
$configuration['locations'] = [];
return $configuration;
}