From 6fa67f4d860b3542071900807a17e64c83239475 Mon Sep 17 00:00:00 2001
From: Brandon Bergren <bdragon@rtk0.net>
Date: Wed, 11 Feb 2009 19:12:12 +0000
Subject: [PATCH] Forward port missing changes from 1.1.2.4 (8/20/2008 7:40
 PM): Integrate some of bevan's mods into marker.js.

---
 js/marker.js | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/js/marker.js b/js/marker.js
index ee23a0b..248973b 100644
--- a/js/marker.js
+++ b/js/marker.js
@@ -46,14 +46,30 @@ Drupal.gmap.addHandler('gmap', function (elem) {
 
   // Default marker actions.
   obj.bind('clickmarker', function (marker) {
+    // Local/stored content
     if (marker.text) {
       marker.marker.openInfoWindowHtml(marker.text);
     }
+    // AJAX content
     if (marker.rmt) {
-      $.get(obj.vars.rmtcallback + '/' + marker.rmt, {}, function (data) {
+      var uri = marker.rmt;
+      // If there was a callback, prefix that.
+      // (If there wasn't, marker.rmt was the FULL path.)
+      if (obj.vars.rmtcallback) {
+        uri = obj.vars.rmtcallback + '/' + marker.rmt;
+      }
+      // @Bevan: I think it makes more sense to do it in this order.
+      // @Bevan: I don't like your choice of variable btw, seems to me like
+      // @Bevan: it belongs in the map object, or at *least* somewhere in
+      // @Bevan: the gmap settings proper...
+      //if (!marker.text && Drupal.settings.loadingImage) {
+      //  marker.marker.openInfoWindowHtml(Drupal.settings.loadingImage);
+      //}
+      $.get(uri, {}, function (data) {
         marker.marker.openInfoWindowHtml(data);
       });
     }
+    // Tabbed content
     else if (marker.tabs) {
       var infoWinTabs = [];
       for (var m in marker.tabs) {
@@ -63,6 +79,7 @@ Drupal.gmap.addHandler('gmap', function (elem) {
       }
       marker.marker.openInfoWindowTabsHtml(infoWinTabs);
     }
+    // No content -- marker is a link
     else if (marker.link) {
       open(marker.link, '_self');
     }
-- 
GitLab