--- gmap--/gmap/gmap_location.module	2009-02-12 11:54:25.000000000 -0700
+++ gmap/gmap_location.module	2009-10-15 04:39:59.000000000 -0600
@@ -549,6 +549,16 @@ function gmap_location_block($op = 'list
           '#default_value' => variable_get('gmap_location_block_macro', '[gmap |width=100% |height=200px |control=None |behavior=+autozoom +notype]'),
         );
 
+		
+		$form["gmap_location_block_mode"] = array(
+		  '#type' => 'radios',
+		  '#title' => t('Marker mode'),
+		  '#description' => t('Perform this action when a marker is clicked.'),
+		  '#options' => array(t('Do nothing'), t('Open info window'), t('Open link')),
+		  '#default_value' => variable_get('gmap_location_block_mode', 1),
+		);
+
+
         $ntypes = node_get_types();
         foreach ($ntypes as $key => $value) {
           $settings = variable_get("location_settings_node_$key", FALSE);
@@ -600,6 +610,17 @@ function gmap_location_block($op = 'list
         else {
           variable_set('gmap_location_block_macro', $macro);
         }
+        // Save mode, if customized.
+        $mode = trim($edit['gmap_location_block_mode']);
+        if ($mode == 1 || empty($macro)) {
+          // If the user doesn't customize the variable, don't set it.
+          // This saves a lot of headache in the future.
+          variable_del('gmap_location_block_mode');
+        }
+        else {
+          variable_set('gmap_location_block_mode', $mode);
+        }
+
 
         // Save node type specific macros.
         $ntypes = node_get_types();
@@ -658,6 +679,9 @@ function gmap_location_block_view($nid) 
     $markertypes = variable_get('gmap_node_markers', array());
     $markers = array();
     $count = 0;
+
+    $marker_mode = variable_get('gmap_location_block_mode', 1);
+
     foreach ($node->locations as $loc) {
       // @@@ Todo: Client side geocoding
       if (location_has_coordinates($loc)) {
@@ -675,13 +699,20 @@ function gmap_location_block_view($nid) 
           $markertitle = $loc['name'];
         }
 
-        $markers[] = array(
+		$new_marker = array(
           'latitude' => $loc['latitude'],
           'longitude' => $loc['longitude'],
           'markername' => $markername,
           'offset' => $count-1,
           'opts' => array('title' => $markertitle),
         );
+
+		if ($marker_mode == 1) {
+			$new_marker['rmt'] = $nid . '/0';
+		} elseif ($marker_mode == 2) {
+			$new_marker['link'] = url('node/'. $nid);
+		}
+        $markers[] = $new_marker;
       }
     }
     if (!empty($markers)) {
@@ -693,6 +724,9 @@ function gmap_location_block_view($nid) 
       $map['latitude'] = $markers[0]['latitude'];
       $map['longitude'] = $markers[0]['longitude'];
       $map['markers'] = $markers;
+	  $map['markermode'] = $marker_mode;
+      $map['rmtcallback'] = url('map/node/load');
+
       $block['subject'] = t('Location');
       $block['content'] = theme('gmap', array('#settings' => $map)); // @@@ Better theme
     }
@@ -728,6 +762,7 @@ function gmap_location_author_block_view
       );
     }
     if (!empty($markers)) {
+
       $macro = variable_get('gmap_location_author_block_macro', '[gmap |width=100% |height=200px |control=None |behavior=+autozoom +notype]');
       $map = gmap_parse_macro($macro);
       $map['latitude'] = $markers[0]['latitude'];
