$(document).ready(function(){ initialize(); }); function initialize() { var myLatlng = new google.maps.LatLng(53.802914,-1.7599563); var myOptions = { zoom: 12, center: myLatlng, draggableCursor: 'pointer', mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var googlemapFull = $('.googlemap'); var marker = new google.maps.Marker({ position: myLatlng, map: map, title:"13/05/2015 - Governing Body Meeting - City" }); $(googlemapFull).on('click',function(e){ e.preventDefault(); window.location.href = '../?mapid=0'; }); google.maps.event.addListener( marker, 'click', function() { window.location.href = '../?mapid=0'; }); }