public function OpenlayersLayer::getAllSources in Openlayers 8.4
File
- src/
Entity/ OpenlayersLayer.php, line 88
Class
- OpenlayersLayer
- Defines the Openlayers Layer entity.
Namespace
Drupal\openlayers\EntityCode
public function getAllSources() {
$sourceNames = \Drupal::service('config.storage')
->listAll('openlayers.source');
$sources = [];
foreach ($sourceNames as $sourceName) {
$sourceLabel = \Drupal::config($sourceName)
->get('label');
$sourceName = str_replace('openlayers.source.', '', $sourceName);
$sources[$sourceName] = $sourceLabel;
}
return $sources;
}