Search within:

Building Directory

'); //initialize map $('.map-container > .container ').append('

View Transportation & Parking Services’ parking map for an accessible/printable version of the Athens Campus map.

Sort by:

Show or hide Historical Locations

'); window.theMap = L.map('map'); L.tileLayer('https://api.mapbox.com/styles/v1/{id}/{z}/{x}/{y}@2x?access_token={accessToken}', { attribution: 'Map data © OpenStreetMap contributors, Imagery © Mapbox', maxZoom: 18, id: 'ohiouniversity/ckmpa10ym14zk17pn5iam2840/tiles/256', tileSize: 512, gestureHandling: true, keyboard: false, zoomOffset: -1, accessToken: 'pk.eyJ1Ijoib2hpb3VuaXZlcnNpdHkiLCJhIjoiY2ttcDl2dTQzMmNpajJ2bWdwa3hkc3I0aCJ9.MV9oGDDKcF8AfJxWFnyXhA' }).addTo(window.theMap); //set controls position to bottom right like GMaps window.theMap.zoomControl.setPosition('bottomright'); //set map to not zoom when scrolled over window.theMap.scrollWheelZoom.disable(); var markers = []; //Function to detect elements in viewport //Credit: https://tinyurl.com/yx9k232l $.fn.isInViewport = function() { var elementTop = $(this).offset().top; var elementBottom = elementTop + $(this).outerHeight(); var viewportTop = $(window).scrollTop(); var viewportBottom = viewportTop + $(window).height(); return elementBottom > viewportTop && elementTop < viewportBottom; }; //building add function, include listing hover/tooltip animate within map function addBuildings(init){ if (!init){ //clear map & markers //not sure why native method fails to clear map, taking blunt force approach //window.theMap.removeLayer(markers); $('.leaflet-marker-pane').html(''); markers = []; }else{} var totItems = $('.the-listing .grid').length; var pts = []; $('.the-listing .grid').each(function(index){ var thisCount = index+1; $(this).addClass('marker-'+thisCount); var lat = $(this).find('.location').attr('data-lat'); var long = $(this).find('.location').attr('data-long'); //skip the airport as a centering point, otherwise store the point for map centering if ($(this).find('.location span').text() == '147'){ if (totItems === 1){ pts.push([lat,long]) } }else{ pts.push([lat,long]) } var thisPlace = $(this).find('.location a').clone()[0]; var customPin = L.icon({ iconUrl: 'https://webcms.ohio.edu/sites/default/files/media-icons/generic/location-cutler.png', iconSize: [25,35] }); var marker = L.marker([lat, long], {icon: customPin}); marker.bindPopup(thisPlace); markers.push(marker); if (thisCount === totItems){ L.layerGroup(markers).addTo(window.theMap); //pan the map to the item or items //window.theMap.setView(mapCenter, zoomLvl); window.theMap.fitBounds(pts); window.theMap.gestureHandling.enable(); } }); //check listing height and insert expander button when needed if ($('#blazy-views-campus-buildings-block-1-1').outerHeight() <= 336){ $('#locations-toggle').hide(); }else{ $('#locations-toggle').show(); } }addBuildings(true); window.theMap.on('loaded', function(e) { map.fitBounds(e.target.getBounds()); window.theMap.gestureHandling.enable(); $('body').find('#map .loader').remove(); }); $('.the-listing').on('mouseenter', '.grid', function(){ var theMarker = $(this).attr('class').split(' ')[1].split('-')[1]; $('.leaflet-marker-pane img:nth-child('+theMarker+')').addClass('marker-hover'); }); $('.the-listing').on('mouseleave', '.grid', function(){ var theMarker = $(this).attr('class').split(' ')[1].split('-')[1]; $('.leaflet-marker-pane img:nth-child('+theMarker+')').removeClass('marker-hover'); }); $('.the-listing').on('click', '.grid', function(event){ if (isTouchDevice()){ var theMarker = $(this).attr('class').split(' ')[1].split('-')[1]; if (window.hoverPlace == theMarker){ return true; }else{ event.preventDefault(); window.hoverPlace = theMarker; var lat = $(this).find('.location').attr('data-lat'); var long = $(this).find('.location').attr('data-long'); window.theMap.setView([lat, long], 18); $('.leaflet-marker-pane img:nth-child('+theMarker+')').addClass('marker-hover'); } } }) $(document).ajaxStop(function(){ addBuildings(); }) //handle filters //input field function submitTextSearch(){ var query = $('body').find('#pretty-title-search').val(); if (query !== '' && query.length){ $('input[id^="edit-title"]').val(query); $('input[id^="edit-submit-campus-buildings"]').click(); }else{ $('input[id^="edit-title"]').val(''); $('input[id^="edit-submit-campus-buildings"]').click(); } } //submit on enter keypress $('body').find('#pretty-filters').on('keyup', function(e){ if (e.key === 'Enter' || e.keyCode === 13){ submitTextSearch(); } }); $('.map-container').on('click', '#pretty-filters button', function(event){ event.preventDefault(); if ($(this).hasClass('active')){ return false; }else{ $(this).siblings('.active').removeClass('active'); $(this).addClass('active'); var thisID = $(this).attr('id'); if (thisID == 'add-user-location'){ if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function (p) { var lat = p.coords.latitude; var long = p.coords.longitude; var customPin = L.icon({ iconUrl: 'https://webcms.ohio.edu/sites/default/files/media-icons/generic/location-moss.png', iconSize: [25,35] }); var marker = L.marker([lat, long], {icon: customPin}); marker.addTo(window.theMap); var zoomToUser = function(){ setTimeout(function(){ var lastImg = $('.leaflet-pane.leaflet-marker-pane img').last(); if (lastImg.attr('src').indexOf('location-moss.png') > -1){ window.theMap.setView([lat, long], 18); lastImg.addClass('marker-hover'); }else{ zoomToUser(); } }, 500); } zoomToUser(); }); }else{ alert('Your device does not support Geolocation or your browser is blocking location access.'); } }else if (thisID == 'pretty-search-submit'){ submitTextSearch(); } else if (thisID == 'name-sort'){ $('select[id^="edit-sort-by"]').val('title'); }else if(thisID == 'map-number-sort'){ $('select[id^="edit-sort-by"]').val('field_building_number_value'); }else if(thisID == 'alpha-asc-sort'){ $('select[id^="edit-sort-order"]').val('ASC') }else if(thisID == 'alpha-desc-sort'){ $('select[id^="edit-sort-order"]').val('DESC') }else if (thisID == 'hide-historical'){ $('select[id^="edit-historic-demolished"]').val(0); }else if (thisID == 'show-historical'){ $('select[id^="edit-historic-demolished"]').val(1); }else{ //uh...what did you click? return false; } $('input[id^="edit-submit-campus-buildings"]').click(); } }) //Expander button function for View listing var expanderBtn = $('#locations-toggle'); expanderBtn.click(function(event){ var theListing = $('body').find('.the-listing'); event.preventDefault(); $(this).toggleClass('active'); if ($(this).hasClass('active')){ $(this).text('Show Less'); theListing.css({'height' : 'auto'}); }else{ $(this).text('Show More'); theListing.css({ 'height' : '336px'}); setTimeout(function(){ $('window,html').animate({ scrollTop : $('#pretty-filters').offset().top - 120 }, 'slow'); }, 50); } }); $('#map').attr('tabindex', -1); });