$(function(){ function drawLibraryMap(element){ var mapOptions = { center: new google.maps.LatLng(51.754247026888855, -1.2544267438352108), 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.754247026888855, -1.2544267438352108), 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.75341219129575, -1.2540237474441938), 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.75505265046011, -1.2550859022140912), 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