You are here

function gmap_get_id in GMap Module 7.2

Same name and namespace in other branches
  1. 5 gmap.module \gmap_get_id()
  2. 6.2 gmap.module \gmap_get_id()
  3. 6 gmap.module \gmap_get_id()
  4. 7 gmap.module \gmap_get_id()

Get a CSS id for a map and type.

@todo move this to GmapToolbox

Since CSS ids have to be unique, GMap related IDs are assigned by this function.

1 call to gmap_get_id()
gmap_widget_setup in ./gmap.module
Set up widget.

File

./gmap.module, line 1100
GMap -- Routines to use the Google Maps API in Drupal.

Code

function gmap_get_id($map, $type) {
  static $serial = array();
  if (!isset($serial[$map])) {
    $serial[$map] = array();
  }
  if (!isset($serial[$map][$type])) {
    $serial[$map][$type] = -1;
  }
  $serial[$map][$type]++;
  return 'gmap-' . $map . '-' . $type . $serial[$map][$type];
}