0 Replies - 360 Views - Last Post: 02 November 2010 - 05:03 PM

#1 Gray37   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 25-October 10

Linking directly to pointers on Google mashup

Posted 02 November 2010 - 05:03 PM

Hi there,

I am trying to link from external web pages to specific markers in my
Google mashup, and have tried to adapt some JQuery code to do this,
however it does not seem to be calling the markers/info windows
correctly.

The code I'm using is:

//After google jquery load add this:
google.setonloadCallback(function() {
        //jQuery plugin extension from
http://jquery-howto.blogspot.com/2009/09/get-url-parameters-values-wi...
        $.extend({
          getUrlVars: function(){
                var vars = [], hash;
                var hashes =
window.location.href.slice(window.location.href.indexOf('?') +
1).split('&');
                for(var i = 0; i < hashes.length; i++)
                {
                  hash = hashes[i].split('=');
                  vars.push(hash[0]);
                  vars[hash[0]] = hash[1];
                }
                return vars;
          },
          getUrlVar: function(name){
                return $.getUrlVars()[name];
          }
        });

}, true);

//Add this at the bottom of your Javascript:

$(document).ready(function(){
        var tourNo = $.getUrlVar('tourNo');
        if (tourNo !== null){
                myclick(tourNo);
        }

});


---

See the source code and lines 41 and 221 here:
http://www.ucl.ac.uk...s/virtual-tour/

Thanks for any help you can give.

G

Is This A Good Question/Topic? 0
  • +

Page 1 of 1