function _olebs_get_maps_with_blockswitcher in Openlayers 7.3
Helper function that returns maps with the blockswitcher behavior enabled.
Uses static caching.
Return value
array Array with maps.
2 calls to _olebs_get_maps_with_blockswitcher()
- openlayers_block_switcher_block_info in modules/
openlayers_block_switcher/ openlayers_block_switcher.module - Implements hook_block_info().
- _olebs_get_map_name in modules/
openlayers_block_switcher/ openlayers_block_switcher.module - Helper function that return the map name according to the block delta.
File
- modules/
openlayers_block_switcher/ openlayers_block_switcher.module, line 45 - Openlayers Block Switcher.
Code
function _olebs_get_maps_with_blockswitcher() {
$maps =& drupal_static(__FUNCTION__, array());
if (!isset($maps)) {
foreach (\Drupal\openlayers\Openlayers::loadAll('Map') as $map) {
if (is_object($map) && $map
->getOption('provideBlockLayerSwitcher', FALSE) == TRUE) {
$maps[] = $map;
}
}
}
return $maps;
}