$(function(){ function drawLibraryMap(element){ var mapOptions = { center: new google.maps.LatLng(51.7534121912958, -1.25402374744419), zoom: 16, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false }; var map = new google.maps.Map(element, mapOptions); var info_windows = []; var marker9 = new google.maps.Marker({ position: new google.maps.LatLng(51.7542470268889, -1.25442674383521), map: map, title: "Bodleian Library - Old Library" }); var infowindow9 = new google.maps.InfoWindow({ content:"

Bodleian Library - Old Library
Catte Street
Oxford
OX1 3BG

" }); info_windows.push(infowindow9); google.maps.event.addListener(marker9, 'click', function() { for(var i = 0; i < info_windows.length; i++) info_windows[i].close(); infowindow9.open(map, marker9); }); var marker10 = new google.maps.Marker({ position: new google.maps.LatLng(51.7534121912958, -1.25402374744419), map: map, title: "Bodleian Library - Radcliffe Camera" }); var infowindow10 = new google.maps.InfoWindow({ content:"

Bodleian Library - Radcliffe Camera
Radcliffe Square
Oxford
OX1 3BG

" }); info_windows.push(infowindow10); google.maps.event.addListener(marker10, 'click', function() { for(var i = 0; i < info_windows.length; i++) info_windows[i].close(); infowindow10.open(map, marker10); }); var marker11 = new google.maps.Marker({ position: new google.maps.LatLng(51.7550526504601, -1.25508590221409), map: map, title: "Bodleian Library - Weston Library" }); var infowindow11 = new google.maps.InfoWindow({ content:"

Bodleian Library - Weston Library
Broad Street
Oxford
OX1 3BG

" }); info_windows.push(infowindow11); google.maps.event.addListener(marker11, 'click', function() { for(var i = 0; i < info_windows.length; i++) info_windows[i].close(); infowindow11.open(map, marker11); }); } /* We use a multiple selector to stop jQuery shortening to document.getElementById() * which would only return the first result (and there might be multiple #library_map * elements, shockingly; e.g. on Contact pages */ $('#library_map, #junk-id-goes-here').each(function(){ drawLibraryMap(this); }).on('click', function(){ if($(this).hasClass('mobile')) return true; return true; }); });
Back to top