This repository has been archived by the owner on Nov 4, 2018. It is now read-only.
forked from tkompare/flushots2013
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.min.js
1 lines (1 loc) · 3.81 KB
/
main.min.js
1
(function(d,a,e,c){var b={city:"Nashville",domid:"map",eventquery:"SELECT * FROM 1BBj4p6g4qsYdnMkaAANh6veaj_eV8FuGejX_-U0R",fturl:"https://www.googleapis.com/fusiontables/v1/query",googlemapsapikey:"AIzaSyBoLtwZuTU86R_YGAUISPOX73ienTJTbYs",iconfee:"/img/red.png",iconfree:"/img/blue.png",iconlocation:"/img/yellow-dot.png",infoboxoptions:{disableAutoPan:false,maxWidth:0,pixelOffset:new google.maps.Size(-121,0),zIndex:null,boxStyle:{background:"url('img/tipbox.gif') no-repeat",opacity:0.92,width:"240px"},closeBoxMargin:"11px 4px 4px 4px",closeBoxURL:"img/close_x.png",infoBoxClearance:new google.maps.Size(25,60),visible:false,pane:"floatPane",enableEventPropagation:false},lat:36.1667,lng:-86.7833,state:"Tennessee",styles:"grey minlabels",zoom:12,zoomaddress:14};d(function(){var f=new a({domid:b.domid,init:true,lat:b.lat,lng:b.lng,styles:b.styles,zoom:b.zoom});var j=new c(b.infoboxoptions);var h=document.createElement("div");j.setMapLegend(h,f,j,b);h.index=1;f.Map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(h);if(j.geolocate){var g=document.createElement("div");j.setFindMeControl(g,f,j,b);g.index=1;f.Map.controls[google.maps.ControlPosition.TOP_RIGHT].push(g)}var k=new e(b.fturl,b.eventquery,b.googlemapsapikey);d.getJSON(k.url,{dataType:"jsonp",timeout:5000}).done(function(l){k.columns=l.columns;k.rows=l.rows;j.getEvents(k.columns,k.rows,f);j.setMarkersByDay("all")}).fail(function(){alert("Oh, no! We are having trouble getting the information we need from storage.")});d("#nav-all").click(function(){d("#nav-li-days,#nav-li-seven,.day-btn").removeClass("active");d("#nav-li-all").addClass("active");d("#nav-days-text").text("On A Day");if(d("#navbar-button").is(":visible")){d("#navbar-button").click()}j.setMarkersByDay("all")});d("#nav-seven").click(function(){d("#nav-li-days,#nav-li-all,.day-btn").removeClass("active");d("#nav-li-seven").addClass("active");d("#nav-days-text").text("On A Day");if(d("#navbar-button").is(":visible")){d("#navbar-button").click()}j.setMarkersByDay("seven")});d(".day").click(function(){d("#nav-li-all,#nav-li-seven").removeClass("active");d("#nav-li-days").addClass("active");d("#nav-days-text").text(d(this).text());if(d("#navbar-button").is(":visible")){d("#navbar-button").click()}j.setMarkersByDay(d(this).text())});d("#nav-address").change(function(){if(d(this).val().length===0){if(j.AddressMarker!==null){j.AddressMarker.setMap(null)}}});d("#nav-go").click(function(){d("#nav-address").blur();if(d("#nav-address").val().length>0){var l=new google.maps.Geocoder();l.geocode({address:d("#nav-address").val()+", "+b.city+", "+b.state},function(n,m){if(m==google.maps.GeocoderStatus.OK){if(n[0]){f.Map.panTo(n[0].geometry.location);f.Map.setZoom(b.zoomaddress);if(j.AddressMarker===null){j.AddressMarker=new google.maps.Marker({position:n[0].geometry.location,map:f.Map,icon:b.iconlocation,clickable:false})}else{j.AddressMarker.setPosition(n[0].geometry.location);if(j.AddressMarker.getMap()===null){j.AddressMarker.setMap(f.Map)}}if(d("#navbar-button").is(":visible")){d("#navbar-button").click()}var o=d.trim(d("#nav-address").val()).split(" ");if(o[0].match(/^[0-9]+$/)!==null){var p=o[0].substr(0,o[0].length-2)+"00";if(p!=="00"){o[0]=p}else{o[0]="0"}}var q=o.join(" ");_gaq.push(["_trackEvent","Go Button","Address",q])}else{alert("Sorry! We couldn't find that address.")}}else{alert("Sorry! We couldn't find that address.")}})}else{alert("Please enter a "+b.city+' street address in the box next to the "Go" button in the bottom navigation bar.')}});d("body").on("click",".directions",function(){var l="http://www.google.com/maps?";if(d("#nav-address").val()!==""){l+="saddr="+d("#nav-address").val()+" "+b.city+", "+b.state+"&"}l+="daddr="+this.Events[i].data.street1+" "+this.Events[i].data.city+", "+this.Events[i].data.state+" "+this.Events[i].data.postal_code;window.open(l)})})})(jQuery,TkMap,FusionTable,Flushots);