You are here

function _openlayers_create_map_id in Openlayers 6.2

Same name and namespace in other branches
  1. 6 includes/openlayers.render.inc \_openlayers_create_map_id()
  2. 7.2 includes/openlayers.render.inc \_openlayers_create_map_id()

Create Map ID

Create a unique ID for any maps that are not assigned an ID

@note Technically someone can assign a map ID identical to the one that is created

Return value

New map id

1 call to _openlayers_create_map_id()
openlayers_build_map in ./openlayers.module
Prepare a map for rendering.

File

includes/openlayers.render.inc, line 182
Processing functions for layers and behaviors

Code

function _openlayers_create_map_id() {
  static $map_count = 0;
  $id = 'openlayers-map-auto-id-' . $map_count;
  $map_count++;
  return $id;
}