var map; var gmarkers = []; var infowindow; var loc_list; var center = new google.maps.LatLng(1, 2); function HomeControl(controlDiv, map){ controlDiv.style.padding = '5px'; var controlUI = document.createElement('DIV'); controlUI.id = 'pb_button'; controlUI.title = 'Powered by: Helios Calendar'; controlDiv.appendChild(controlUI); var controlText = document.createElement('DIV'); controlText.innerHTML = 'Visit VU Calendar'; controlUI.appendChild(controlText); google.maps.event.addDomListener(controlUI, 'click', function() { window.location.href = 'https://events.vanderbilt.edu'; }); } function initialize() { var myOptions = { zoom: 12, center: center, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: true, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU }, scaleControl: true, scaleControlOptions: { position: google.maps.ControlPosition.BOTTOM_LEFT }, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL, position: google.maps.ControlPosition.TOP_LEFT }}; map = new google.maps.Map(document.getElementById('map_canvas'), myOptions); setMarkers(map, locations); infowindow = new google.maps.InfoWindow({content: ''}); var homeControlDiv = document.createElement('DIV'); var homeControl = new HomeControl(homeControlDiv, map); homeControlDiv.index = 1; map.controls[google.maps.ControlPosition.TOP_RIGHT].push(homeControlDiv); } var locations = [ ["2173"," Engineering & Science Bldg","36.1457192","-86.8066559"," Engineering & Science Bldg","Highland Ave","","Nashville","TN","","37240","5","Thursday, November 22, 2018","0",""], ["982","214 Light Hall","36.1666667","-86.7833333","214 Light Hall","VUMC","","Nashville","TN","","","2","Friday, December 14, 2018","0",""], ["817","2147 Belcourt","36.145188","-86.804957","2147 Belcourt","2147 Belcourt Ave","","Nashville","TN","USA","37212","1","Friday, November 16, 2018","0",""], ["931","2525 West End Ave. ","36.1447","-86.8027","2525 West End Ave. ","","","","TN","","","8","Monday, November 19, 2018","0",""], ["2063","419 Light Hall","36.1432028","-86.8039240","419 Light Hall","Garland Street","","Nashville","TN","","","2","Thursday, January 17, 2019","0",""], ["1084","Barnes and Noble at Vanderbilt","36.1463543","-86.8083744","Barnes and Noble at Vanderbilt","2501 West End Avenue",""," Nashville","TN","","37203","5","Saturday, December 01, 2018","0",""], ["1003","Benton Chapel","36.1466434","-86.8004108","Benton Chapel","411 21St Ave S.","","Nashville","TN","United States","37240","2","Friday, December 07, 2018","0",""], ["900","Biological Sciences Building/Medical Research Building (MRB) III ","36.1445701","-86.8003339","Biological Sciences Building/Medical Research Building (MRB) III ","465 21st Ave S","","Nashville","TN","","37232","6","Friday, November 16, 2018","0",""], ["1528","Bishop Joseph Johnson Black Cultural Center","36.1489935","-86.8041151","Bishop Joseph Johnson Black Cultural Center","Black Cultural Center Building","2301 Vanderbilt Place ","Nashville","TN","United States","37235","4","Monday, November 26, 2018","0",""], ["847","Blair School of Music","36.145704","-86.806011","Blair School of Music","2400 Blakemore Ave","","Nashville","TN","USA","37212","1","Friday, November 16, 2018","0",""], ["1025","Blair School of Music, Ingram Hall","36.1412135","-86.8027772","Blair School of Music, Ingram Hall","2400 Blakemore Avenue","","Nashville","TN","","37212","9","Thursday, November 29, 2018","0",""], ["788","Buttrick Hall","36.14795","-86.802562","Buttrick Hall","390 24th Ave S","","Nashville","TN","USA","37240","9","Wednesday, December 05, 2018","0",""], ["778","Calhoun Hall","36.144957","-86.801429","Calhoun Hall","2115 West End Ave","","Nashville","TN","USA","37240","2","Tuesday, November 27, 2018","0",""], ["762","Central & Divinity Libraries","36.149464","-86.800204","Central & Divinity Libraries","419 21St Ave S","","Nashville","TN","USA","37240","4","Friday, November 16, 2018","0",""], ["938","Community Room, Jean and Alexander Heard Library","36.1443747","-86.8027437","Community Room, Jean and Alexander Heard Library","Vanderbilt University","","Nashville","TN","United States","37204","1","Tuesday, April 02, 2019","0",""], ["770","Godchaux Nursing Annex","36.13916","-86.80073","Godchaux Nursing Annex","461 21St Ave S","","Nashville","TN","USA","37232","3","Monday, November 26, 2018","0",""], ["1033","Green Hills Office Building","36.1426398","-86.8001068","Green Hills Office Building","VMG, 3841 Green Hills Village Drive","","Nashville","TN","","37232","1","Wednesday, December 19, 2018","0",""], ["988","Langford Auditorium","36.1447","-86.8027","Langford Auditorium","","","","TN","","","1","Friday, December 14, 2018","0",""], ["902","Light Hall ","36.1421640","-86.8024230","Light Hall ","2215 Garland Avenue","","Nashville","TN","USA","37232","15","Friday, November 16, 2018","0",""], ["883","Mcgugin Complex","36.146529","-86.808921","Mcgugin Complex","2601 Jess Neely Dr","","Nashville","TN","USA","37212","6","Thursday, November 29, 2018","0",""], ["995","Medical Center East (MCE)","36.1447","-86.8027","Medical Center East (MCE)","","","","TN","","","2","Thursday, November 29, 2018","0",""], ["930","Medical Center East, South Tower","36.1447","-86.8027","Medical Center East, South Tower","",""," ","TN","","","14","Tuesday, November 20, 2018","0",""], ["1036","Medical Center North ","36.1426398","-86.8001068","Medical Center North ","VUH","","Nashville ","TN","","37232 ","1","Thursday, December 06, 2018","0",""], ["767","Medical Research Building (MRB) II (Preston Cancer Research Building)","36.140360","-86.802708","Medical Research Building (MRB) II (Preston Cancer Research Building)","465 21St Ave S","","Nashville","TN","USA","37232","1","Thursday, January 31, 2019","0",""], ["943","Monroe Carell Jr Children's Hospital","36.1388929","-86.8022694","Monroe Carell Jr Children's Hospital","2200 Childrens Way","","Nashville","TN","USA","37232","11","Monday, November 19, 2018","0",""], ["907","Peabody Campus","36.1437507","-86.7964559","Peabody Campus","230 Appleton Place","","Nashville","TN","US","37203","15","Friday, November 16, 2018","0",""], ["750","Peabody Library","36.141371","-86.799203","Peabody Library","1210 21St Ave S","","Nashville","TN","USA","37212","5","Thursday, November 22, 2018","0",""], ["800","Sarratt Student Center","36.145485","-86.803743","Sarratt Student Center","2302 Vanderbilt Pl","","Nashville","TN","USA","37240","4","Thursday, November 29, 2018","0",""], ["857","Schulman Center Hillel","36.146391","-86.806373","Schulman Center Hillel","2421 Vanderbilt Pl","","Nashville","TN","USA","37212","1","Thursday, January 31, 2019","0",""], ["2164","Steve and Judy Turner Recital Hall","36.1386200","-86.8060680","Steve and Judy Turner Recital Hall","2400 Blakemore Avenue","","Nashville","TN","","37212","8","Friday, November 16, 2018","0",""], ["1086","Stevenson Center","36.1457192","-86.8066559","Stevenson Center","","","Nashville","TN","","37240","1","Monday, December 03, 2018","0",""], ["842","Student Life Center","36.1443245","-86.8061192","Student Life Center","310 25th Ave S","","Nashville","TN","USA","37212","1","Thursday, November 29, 2018","0",""], ["728","The Commons Center","36.145359","-86.797159","The Commons Center","230 Appleton Pl","","Nashville","TN","USA","37212","1","Monday, December 10, 2018","0",""], ["1039","The Vanderbilt Clinic (TVC)","36.1426398","-86.8001068","The Vanderbilt Clinic (TVC)","1301 Medical Center ","","Nashville ","TN","","37232","3","Tuesday, November 20, 2018","0",""], ["1090","Vanderbilt Health 100 Oaks","36.1080624","-86.7639372","Vanderbilt Health 100 Oaks","719 Thompson Lane","","Nashville","TN","","37204","9","Monday, November 19, 2018","0",""], ["897","Vanderbilt Law School","36.1481438","-86.8000764","Vanderbilt Law School","131 21st Ave South","","Nashville","TN","USA","37203","1","Wednesday, February 20, 2019","0",""], ["1045","Vanderbilt Medical Group - Williamson County","35.9178798","-86.8197744","Vanderbilt Medical Group - Williamson County","2105 Edward Curd Lane ","","Franklin ","TN","","37067","1","Friday, November 16, 2018","0",""], ["882","Vanderbilt Recreation and Wellness Center","36.146537","-86.808918","Vanderbilt Recreation and Wellness Center","2700 Childrens Way","","Nashville","TN","USA","37212","1","Saturday, January 19, 2019","0",""], ["2057","Vanderbilt University Fine Arts Gallery","36.1591258","-86.8050998","Vanderbilt University Fine Arts Gallery","1220 21st Avenue South","","Nashville","TN","","37203","42","Friday, November 16, 2018","0",""], ["918","Vanderbilt University Hospital","36.1413920","-86.8019910","Vanderbilt University Hospital","1211 Medical Center Drive","","Nashville","TN","USA","37232","355","Monday, January 21, 2019","0",""], ["1900","VUH 4203","36.1414463","-86.8015694","VUH 4203","1211 Medical Center Drive","","","TN","","","1","Tuesday, December 04, 2018","0",""], ["769","Wilson Hall","36.14068","-86.800694","Wilson Hall","111 21St Ave S","","Nashville","TN","USA","37240","6","Monday, November 19, 2018","0",""], ["746","Wyatt Center","36.144213","-86.799005","Wyatt Center","1930 South Dr","","Nashville","TN","USA","37212","1","Wednesday, February 13, 2019","0",""], ]; function setMarkers(map, markers) { for (var i = 0; i < markers.length; i++) { if(markers[i] != undefined){ var location = markers[i]; var siteLatLng = new google.maps.LatLng(location[2], location[3]); var marker = new google.maps.Marker({ position: siteLatLng, map: map, title: location[1], html: '
'+location[1]+''+setIW(location)+'
', icon: 'https://events.vanderbilt.edu/img/pins/default.png' }); google.maps.event.addListener(marker, 'click', function(){ infowindow.setContent(this.html); infowindow.open(map, this); }); gmarkers.push(marker); } } } function setIW(loc){ var iw = (loc[5] != '') ? '' + loc[5] + '' : ''; iw += (loc[6] != '') ? ''+loc[6]+'' : ''; iw += (loc[7] != '') ? ''+loc[7]+'' : ''; iw += (loc[8] != '') ? ''+loc[8]+'' : ''; iw += (loc[10] != '') ? ''+loc[10]+'' : ''; iw += (loc[9] != '') ? ''+loc[9]+'' : ''; iw += (loc[13] == 1) ? 'Website: Click to Visit' : ''; iw += (loc[14] != '') ? 'Phone: '+loc[14]+'' : ''; iw += (loc[2] != '' && loc[3] != '') ? ''+loc[2]+', '+loc[3]+'' : ''; iw += (loc[11] != '') ? 'Events: '+loc[11]+'' : 'Events: 0'; iw += (loc[12] != '') ? 'Next Event: '+loc[12]+'' : ''; return iw; } function showIW(loc){ map.setZoom(16); google.maps.event.trigger(gmarkers[loc], 'click'); }