You are here

function gmap_get_id in GMap Module 6.2

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

Get a CSS id for a map and type. 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. This function will change a form element's ID so it is found by the GMap handlers system.

File

./gmap.module, line 1040
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];
}