function _openlayers_create_map_id in Openlayers 6
Same name and namespace in other branches
- 6.2 includes/openlayers.render.inc \_openlayers_create_map_id()
- 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_render_map in ./
openlayers.module - Render Map
File
- includes/
openlayers.render.inc, line 223 - This file holds the functions the extra processing of rendering a map
Code
function _openlayers_create_map_id() {
// Set up variables
$map_id = '';
static $map_count = 0;
// Put together ID
$map_id = OPENLAYERS_MAP_ID_PREFIX . '-' . $map_count;
// Add another
$map_count += 1;
// Return ID
return $map_id;
}