From d9617334cb5284c52571ba7ecdede78e47201779 Mon Sep 17 00:00:00 2001
From: Reuben Turk <reubenturk@gmail.com>
Date: Thu, 30 Sep 2010 09:51:05 +0000
Subject: [PATCH] #352553 by lonelyrobot - Make gmap views honor the marker
 action gmap setting.

---
 gmap_plugin_style_gmap.inc | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/gmap_plugin_style_gmap.inc b/gmap_plugin_style_gmap.inc
index df72fe5..498f1b4 100644
--- a/gmap_plugin_style_gmap.inc
+++ b/gmap_plugin_style_gmap.inc
@@ -84,6 +84,7 @@ class gmap_plugin_style_gmap extends views_plugin_style {
       return;
     }
 
+    $defaults = gmap_defaults();
     $lat_field = 'gmap_lat';
     $lon_field = 'gmap_lon';
 
@@ -189,18 +190,26 @@ class gmap_plugin_style_gmap extends views_plugin_style {
             $tooltip = $row->$tooltip_field;
           }
 
-          $markers[] = array(
+          $marker = array(
             'latitude' => $lat,
             'longitude' => $lon,
             'markername' => $markername,
             'offset' => $offsets[$markername],
-            'text' => $this->row_plugin->render($row),
             'opts' => array(
               'title' => $tooltip,
               'highlight' => (!empty($highlight_nid) && !empty($row_nid) && $highlight_nid == $row_nid) ? 1 : 0,
               'highlightcolor' => $this->options['highlight_nodearg_color'],
             ),
           );
+          // Marker mode: popup.
+          if ($defaults['markermode'] == 1) {
+            $marker['text'] = $this->row_plugin->render($row);
+          }
+          // Marker mode: link.
+          else if ($defaults['markermode'] == 2) {
+            $marker['link'] = url('node/' . $row_nid);
+          }
+          $markers[] = $marker;
 
           $offsets[$markername]++;
         }
-- 
GitLab