Adding Drupal gmap marker onClick event

Average: 3.3 (431 votes)

This is a patch for gmap drupal module 7.x-2.x that will call a JS function when a marker is clicked. 

It will add extra options to gmap settings in views that allow a field's content to be passed as parameter to the called function.

The function name is gmap_marker_onclick(arg), here is an example:

function gmap_marker_onclick(nid) {
  alert('Arg '+nid);
}

Get the patch file at the bottom and apply it from within gmap module directory using:

patch -p1 < marker-onclick.patch 
glqxz9283 sfy39587stf02 mnesdcuix8
sfy39587stf03
sfy39587stf04