You are here

function _openlayers_block_get_map in Openlayers 7.3

Helper function return the map name according to the block delta.

Parameters

string $delta: The block delta.

Return value

\Drupal\openlayers\Types\MapInterface The map object.

1 call to _openlayers_block_get_map()
openlayers_block_block_view in modules/openlayers_block/openlayers_block.module
Implements hook_block_view().

File

modules/openlayers_block/openlayers_block.module, line 62
Openlayers Block module.

Code

function _openlayers_block_get_map($delta) {
  foreach (\Drupal\openlayers\Openlayers::loadAll('Map') as $map) {
    if (is_object($map) && _openlayers_block_get_block_id($map
      ->getMachineName()) == $delta && $map
      ->getOption('provideBlock', FALSE)) {
      return $map;
    }
  }
  return FALSE;
}