//pull these out so i can grab them elsewhere var map; var allMarkers = []; var layer; var polygon; var overlay; var bounds = new google.maps.LatLngBounds(); var minilocs=[]; var locations = []; var allMarkersMin = []; var allMarkersEvent = []; var eventlocations = []; function getsetcookie() { try { var mapzoom=map.getZoom(); var mapcenter=map.getCenter(); var maplat=mapcenter.lat(); var maplng=mapcenter.lng(); var maptypeid=map.getMapTypeId(); var cookiestring=maplat+"_"+maplng+"_"+mapzoom+"_"+maptypeid; var exp = new Date(); //set new date object exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 90)); //set it 30 days ahead // // console.log("cookie:"+cookiestring); setCookie("yycbeerlastpos",cookiestring,exp); } catch(e) { // alert('The browser you are using is not a fully functional browser,some features may not be available.'); } } function setCookie(name,value,expires) { document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires.toGMTString()); } function toggleLayer() { $("#layeron").toggleClass('layeron layeroff'); if( layer.getMap() ){ layer.setMap(null); }else{ layer.setMap(map); } } function toggletips() { $("#mtipson").toggleClass('layeron layeroff'); if( layer.getMap() ){ layer.setMap(null); }else{ layer.setMap(map); } } var tipObj = null; var offset = {x: 20,y: 20}; function poponly() { window.scrollTo(0,0); google.maps.event.trigger(allMarkers[0],'click'); } function dobounds() { } function popmapbyid(id) { // map.setZoom(17); // setTimeout("map.setZoom(16)",1000); var index = id; google.maps.event.trigger(allMarkers[index],'click'); } (function ($) { "use strict"; var markerIcon = { anchor: new google.maps.Point(22,16),url: '/images/marker.png' } setTimeout("getsetcookie()",10000); function mainMap() { function locationData(locationURL,locationCategory,locationImg,locationTitle,locationAddress,locationPhone,locationStarRating,locationRevievsCounter,tagline) { if (locationCategory.length <4) {locationCategory ='Brewery';} return ('
' + locationCategory + '

' + locationTitle + '

'+ tagline +'
' + locationAddress + '' + locationPhone + '' + locationRevievsCounter + ' Taps' + '
') } function locationDatamini(locationURL,locationCategory,locationImg,locationTitle,locationAddress,locationPhone,locationStarRating,locationRevievsCounter,tagline) { if (locationCategory=="Alcohol In City Parks") { if (locationRevievsCounter !=="0") { console.log("pkbid"); var pkbid= "#" + locationRevievsCounter + " p.bookings"; console.log("pkbid",pkbid); var pv = $(pkbid).html(); } else { console.log("pkbid=00"); } if (pv == "undefined" || pv == undefined || !pv) { pv = "Visit The #YYCParkBeers For Booking Details." } return ('
' + locationCategory + '

' + locationTitle + '

'+ tagline +'
' + locationAddress + '' + pv + '
'); } else{ return ('
' + locationCategory + '

' + locationTitle + '

'+ tagline +'
' + locationAddress + '' + locationPhone + '
') } } minilocs = [ //poi-map starts [locationDatamini('/noticed_venue/Confluence_Distilling/51.0212758/-114.0533179/6/Craft_Beer_Calgary/','Top Spot','/images/pois/confluence_distilling_calgary.png','Confluence Distilling'," 507 36th AVE SE,Calgary ","(587)771-1286","5","0","Distillery in the heart of Calgary,handcrafting small-batch Gin\'s and more! Visit the Distillery for a craft cocktail,or grab a limited release spirit."),51.0212758,-114.0533179,4,{ anchor: new google.maps.Point(22,16),url: 'http://yycbeer.ca/mapicons/bar_coktail.png' }], ]; //events map. one at a time function eventlocationData(locationURL,locationCategory,locationImg,locationTitle,locationAddress,locationPhone,locationStarRating,locationRevievsCounter,tagline) { return ('
' + locationCategory + '

' + locationTitle + '

'+ tagline +'
' + locationAddress + 'Visit Poutine With A Purpose!
') } eventlocations = [ ]; //end events map locations = [ [locationData('/calgary_brewery_profile/3/Annex_Ale_Project/','Pints,Fills,Cans','/markerbacking.asp?status=3&id=3','Annex Ale Project'," 4323 1st St. S.E. ","403-475-4492","5","6","A small brewery for big talk,bold plans,and potential (mis)adventure."),51.0147994,-114.0617491,0,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=3&status=3'},'Annex Ale Project',3,51.0147994,-114.0617491,3 ], [locationData('/calgary_brewery_profile/46/Cabin_Brewing_Company/','Pints,Fills,Cans,more','/markerbacking.asp?status=3&id=46','Cabin Brewing Company'," 505 36 Ave SE ","403-244-3331","5","8","WELCOME TO THE CABIN"),51.021213,-114.0535758,1,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=46&status=3'},'Cabin Brewing Company',3,51.021213,-114.0535758,46 ], [locationData('/calgary_brewery_profile/24/Common_Crown_Brewing_Co/','Pints,Fills,Cans','/markerbacking.asp?status=3&id=24','Common Crown Brewing Co'," 943 28 St NE ","(587) 356-4275","5","0",""),51.0611523,-113.9940515,2,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=24&status=3'},'Common Crown Brewing Co',3,51.0611523,-113.9940515,24 ], [locationData('/calgary_brewery_profile/44/Eighty-Eight_Brewing_Company/','Fills,Pints,Bottles,Merch','/markerbacking.asp?status=3&id=44','Eighty-Eight Brewing Company'," 1070 - 2600 Portland St SE ","403-452-5880","5","32","In the spirit of Calgary '88"),51.031135,-114.0322188,3,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=44&status=3'},'Eighty-Eight Brewing Company',3,51.031135,-114.0322188,44 ], [locationData('/calgary_brewery_profile/43/OT_Brewing_Company/','Brewery & Taproom','/markerbacking.asp?status=3&id=43','OT Brewing Company'," 1155 44 Ave SE ","403-816-4575","5","14","Focusing on perfectly drinkable lagers and hazy hoppy beers in Calgary,AB. "),51.013479,-114.0386392,4,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=43&status=3'},'OT Brewing Company',3,51.013479,-114.0386392,43 ], [locationData('/calgary_brewery_profile/16/Prairie_Dog_Brewing/','Resto,Brewpub','/markerbacking.asp?status=3&id=16','Prairie Dog Brewing'," 105 58 Ave SE ","403-407-2448","5","4","NOW OPEN! A BREWPUB LIKE NOTHING ELSE IN CALGARY"),51.0010782,-114.0632749,5,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=16&status=3'},'Prairie Dog Brewing',3,51.0010782,-114.0632749,16 ], [locationData('/calgary_brewery_profile/75/SunnyCider/','Cider House','/markerbacking.asp?status=3&id=75','SunnyCider'," 1-3300 14 Avenue NE ","4036069007","5","12","Raising community spirits one glass at a time"),51.0652406,-113.9872035,6,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=75&status=3'},'SunnyCider',3,51.0652406,-113.9872035,75 ], [locationData('/calgary_brewery_profile/1/Tool_Shed_Brewing_Co/','Fills,Pints,Cans,Merch,Tours','/markerbacking.asp?status=3&id=1','Tool Shed Brewing Co.'," 801 30 St NE ","(403) 775-1749","5","6","We make handcrafted beer,best served with a story!"),51.0596614,-113.9897405,7,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=1&status=3'},'Tool Shed Brewing Co.',3,51.0596614,-113.9897405,1 ], [locationData('/calgary_brewery_profile/32/Trolley_5_Restaurant_and_Brewery/','Brewery Restaurant','/markerbacking.asp?status=3&id=32','Trolley 5 Restaurant and Brewery'," 728 17th Avenue SW ","403-454-3731","5","7","Your Community Brewpub - Born and Raised."),51.0378382,-114.0785796,8,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=32&status=3'},'Trolley 5 Restaurant and Brewery',3,51.0378382,-114.0785796,32 ], [locationData('/calgary_brewery_profile/53/6_Corners_Brewery/','','/markerbacking.asp?status=2&id=53','6 Corners Brewery'," 109 Southbank Blvd ","(403) 850-5702","5","1","opening soon"),50.7048418,-113.945156,9,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=53&status=2'},'6 Corners Brewery',2,50.7048418,-113.945156,53 ], [locationData('/calgary_brewery_profile/82/Balzac_Craft_Brewing_Company/','','/markerbacking.asp?status=2&id=82','Balzac Craft Brewing Company'," #305 401 Coopers Blvd ","403-650-1181","5","0","opening Spring of 2019"),51.2573607,-114.0231515,10,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=82&status=2'},'Balzac Craft Brewing Company',2,51.2573607,-114.0231515,82 ], [locationData('/calgary_brewery_profile/67/Banff_Ave_Brewing_Co/','Resto,Taproom','/markerbacking.asp?status=2&id=67','Banff Ave. Brewing Co.'," 110 Banff Ave ","(403) 762-1003","5","0","...it's all about the beer"),51.1748828,-115.5705477,11,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=67&status=2'},'Banff Ave. Brewing Co.',2,51.1748828,-115.5705477,67 ], [locationData('/calgary_brewery_profile/19/Big_Rock_Brewery/','full service brewery','/markerbacking.asp?status=2&id=19','Big Rock Brewery'," 5555 - 76TH AVE SE ","(403) 720-3239","5","0","Brewed Daily. Come and taste our craft."),50.984735,-113.955871,12,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=19&status=2'},'Big Rock Brewery',2,50.984735,-113.955871,19 ], [locationData('/calgary_brewery_profile/20/Boiling_Oar_Brewing_Company/','','/markerbacking.asp?status=2&id=20','Boiling Oar Brewing Company'," 7930 51 Street SE ","1 403-903-5003","5","0","GOOD PEOPLE. GOOD BEER."),50.981592,-113.959561,13,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=20&status=2'},'Boiling Oar Brewing Company',2,50.981592,-113.959561,20 ], [locationData('/calgary_brewery_profile/6/Born_Colorado_Brewing/','Pints,Merch','/markerbacking.asp?status=2&id=6','Born Colorado Brewing'," 414 36 Ave SE ","(403) 247-0295","5","5","Born in Colorado Crafted in Calgary"),51.0216313,-114.0542496,14,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=6&status=2'},'Born Colorado Brewing',2,51.0216313,-114.0542496,6 ], [locationData('/calgary_brewery_profile/72/Bow_River_Brewing/','Tap,offsales','/markerbacking.asp?status=2&id=72','Bow River Brewing'," 5769 4 St SE #110 ","(403) 917-1088","5","7","Bow River Brewing is a craft brewery in Calgary close to the Chinook Centre and Blackfoot Inn."),51.0025917,-114.0538859,15,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=72&status=2'},'Bow River Brewing',2,51.0025917,-114.0538859,72 ], [locationData('/calgary_brewery_profile/58/Brauerei_Fahr/','Ask','/markerbacking.asp?status=2&id=58','Brauerei Fahr'," 123 Kennedy Drive SE ","403-614-3337","5","0","Now Open"),50.672625,-114.278559,16,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=58&status=2'},'Brauerei Fahr',2,50.672625,-114.278559,58 ], [locationData('/calgary_brewery_profile/21/Brewsters_Brewing_Company/','Brew Pub and Restaurant','/markerbacking.asp?status=2&id=21','Brewsters Brewing Company'," 5519 53 St SE ","403-723-2739","5","12","BETTER TOGETHER"),51.0033554,-113.9574421,17,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=21&status=2'},'Brewsters Brewing Company',2,51.0033554,-113.9574421,21 ], [locationData('/calgary_brewery_profile/68/Canmore_Brewing_Company/','Taproom','/markerbacking.asp?status=2&id=68','Canmore Brewing Company'," 1460 Railway Ave ","(403) 678-2337","5","4","Craft beer in the heart of Canmore."),51.094509,-115.356934,18,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=68&status=2'},'Canmore Brewing Company',2,51.094509,-115.356934,68 ], [locationData('/calgary_brewery_profile/7/Citizen_Brewing_Company/','Resto,fills,Cans,Merch','/markerbacking.asp?status=2&id=7','Citizen Brewing Company'," 227 35th Ave. N.E ","403-474-HOPS","5","5","PRESERVATIVE FREE,UNFILTERED,UNPASTEURIZED,UNCOMPROMISED"),51.0839916,-114.0583494,19,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=7&status=2'},'Citizen Brewing Company',2,51.0839916,-114.0583494,7 ], [locationData('/calgary_brewery_profile/23/Cold_Garden_Beverage_Company/','Pints,Fills,Lounge','/markerbacking.asp?status=2&id=23','Cold Garden Beverage Company'," 1100 11 St SE ","403-764-2653","5","10","Inglewood based micro-brewery and tasting room"),51.039746,-114.036862,20,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=23&status=2'},'Cold Garden Beverage Company',2,51.039746,-114.036862,23 ], [locationData('/calgary_brewery_profile/66/Coulee_Brew_Co/','Resto,Fills,Everyting','/markerbacking.asp?status=2&id=66','Coulee Brew Co.'," 4085 2 Ave S ","(403) 394-2337","5","8","Coulee Brew tap house/grill is a full-service pub style restaurant"),49.6976632,-112.779975,21,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=66&status=2'},'Coulee Brew Co.',2,49.6976632,-112.779975,66 ], [locationData('/calgary_brewery_profile/73/Cowtown_Brewing_Company/','','/markerbacking.asp?status=2&id=73','Cowtown Brewing Company'," 1806 20 St ","(403) 415-4151","5","2","HND KRFTD IN ALTA"),51.659345,-114.137497,22,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=73&status=2'},'Cowtown Brewing Company',2,51.659345,-114.137497,73 ], [locationData('/calgary_brewery_profile/45/Establishment_Brewing_Company/','Pints,Fills','/markerbacking.asp?status=2&id=45','Establishment Brewing Company'," 4407 1 Street Southeast ","","5","8","ALE TO THE PEOPLE"),51.0142906,-114.062347,23,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=45&status=2'},'Establishment Brewing Company',2,51.0142906,-114.062347,45 ], [locationData('/calgary_brewery_profile/8/Evil_Corporation_Brewing/','Now Open','/markerbacking.asp?status=2&id=8','Evil Corporation Brewing'," 1220 20 Ave SE ","","5","8","it's here"),51.036029,-114.036145,24,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=8&status=2'},'Evil Corporation Brewing',2,51.036029,-114.036145,8 ], [locationData('/calgary_brewery_profile/74/Field_and_Forge_Brewing_Co/','Off-Sales','/markerbacking.asp?status=2&id=74','Field & Forge Brewing Co'," 3775 61 Avenue ","(403) 227-7402","5","6","Taproom Now Open"),52.0206872,-113.9810931,25,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=74&status=2'},'Field & Forge Brewing Co',2,52.0206872,-113.9810931,74 ], [locationData('/calgary_brewery_profile/54/Fitzsimmons_Brewing_Company/','','/markerbacking.asp?status=2&id=54','Fitzsimmons Brewing Company'," 4 - 220 East Lake Blvd ","(587) 892-2739","5","0",""),51.2899356,-113.9913816,26,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=54&status=2'},'Fitzsimmons Brewing Company',2,51.2899356,-113.9913816,54 ], [locationData('/calgary_brewery_profile/105/Four_Dogs_Brewing_Company/','taproom','/markerbacking.asp?status=2&id=105','Four Dogs Brewing Company'," 1205 1St SW Calgary ","403-874-2681","5","10","FOUR DOGS,FOUR BEERS,FOR LOVE"),51.0412767,-114.0660002,27,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=105&status=2'},'Four Dogs Brewing Company',2,51.0412767,-114.0660002,105 ], [locationData('/calgary_brewery_profile/14/Freehold_Brewing_Co/','No Taproom','/markerbacking.asp?status=2&id=14','Freehold Brewing Co.'," Calgary ","4036718358","5","0","A NEW KIND OF CRAFT BEER"),51.12861,-114.1137329,28,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=14&status=2'},'Freehold Brewing Co.',2,51.12861,-114.1137329,14 ], [locationData('/calgary_brewery_profile/11/Good_Mood_Brewery/','Pints,Cans,Fills','/markerbacking.asp?status=2&id=11','Good Mood Brewery'," 2123 - 4416 64 Ave SE ","403-452-1806","5","6","Good friends,good mood,good beer!"),50.9969983,-113.9722406,29,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=11&status=2'},'Good Mood Brewery',2,50.9969983,-113.9722406,11 ], [locationData('/calgary_brewery_profile/33/Half_Hitch_Brewing_Company/','pints,cans,resto','/markerbacking.asp?status=2&id=33','Half Hitch Brewing Company'," 10 Griffin Industrial Point #1 ","(403) 988-4214","5","12"," "),51.1835573,-114.4537135,30,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=33&status=2'},'Half Hitch Brewing Company',2,51.1835573,-114.4537135,33 ], [locationData('/calgary_brewery_profile/26/High_Line_Brewing/','','/markerbacking.asp?status=2&id=26','High Line Brewing'," #113 - 1318 9th Avenue S.E ","587-786-2337","5","0","LOCALLY BREWED AND CRAFTED IN INGLEWOOD"),51.0408886,-114.0330473,31,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=26&status=2'},'High Line Brewing',2,51.0408886,-114.0330473,26 ], [locationData('/calgary_brewery_profile/59/High_River_Brewing_Company/','Fills,Pints,Cans','/markerbacking.asp?status=2&id=59','High River Brewing Company'," 510 21 St SE ","(403) 649-2002","5","4","High River Brewing Company | Flowing Soon"),50.5773141,-113.8334382,32,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=59&status=2'},'High River Brewing Company',2,50.5773141,-113.8334382,59 ], [locationData('/calgary_brewery_profile/39/Inner_City_Brewing/','Fills,Pints,Snacks','/markerbacking.asp?status=2&id=39','Inner City Brewing'," 816 11 Ave SW ","(587) 880-8600","5","8","Inner City is a place of unexpected connections."),51.0431119,-114.0799427,33,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=39&status=2'},'Inner City Brewing',2,51.0431119,-114.0799427,39 ], [locationData('/calgary_brewery_profile/27/Last_Best_Brewing_and_Distillery/','','/markerbacking.asp?status=2&id=27','Last Best Brewing and Distillery'," 607 11th Ave SW ","587-353-7387","5","16","CREATING A COMMUNITY-FOCUSED BEER CULTURE"),51.0426948,-114.0744823,34,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=27&status=2'},'Last Best Brewing and Distillery',2,51.0426948,-114.0744823,27 ], [locationData('/calgary_brewery_profile/35/Last_Spike_Brewing/','Brew for Hire','/markerbacking.asp?status=2&id=35','Last Spike Brewing'," 5840 76 Ave SE #40 ","5875784447","5","0","Opening soon"),50.985179,-113.9466564,35,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=35&status=2'},'Last Spike Brewing',2,50.985179,-113.9466564,35 ], [locationData('/calgary_brewery_profile/36/Legend_7_Brewing/','Fills,Pints,Bottles,Resto','/markerbacking.asp?status=2&id=36','Legend 7 Brewing'," 4025 9 St SE ","(587)-355-3105","5","8","Tap Room and Restaurant Now Open!"),51.018751,-114.040662,36,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=36&status=2'},'Legend 7 Brewing',2,51.018751,-114.040662,36 ], [locationData('/calgary_brewery_profile/42/Marda_Loop_Brewing_Company_Inc/','','/markerbacking.asp?status=2&id=42','Marda Loop Brewing Company Inc.'," 3523 18 St SW ","403-585-8087","5","6",""),51.0223457,-114.1051801,37,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=42&status=2'},'Marda Loop Brewing Company Inc.',2,51.0223457,-114.1051801,42 ], [locationData('/calgary_brewery_profile/9/New_Level_Brewing/','Taproom','/markerbacking.asp?status=2&id=9','New Level Brewing'," Unit 4140 - 7005 Fairmount Dr SE ","403-764-4359","5","8","Take it to a New Level"),50.9920124,-114.0656316,38,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=9&status=2'},'New Level Brewing',2,50.9920124,-114.0656316,9 ], [locationData('/calgary_brewery_profile/87/Newell_Brewing_Company/','','/markerbacking.asp?status=2&id=87','Newell Brewing Company'," 112 - 328 7th Street East ","4037932378","5","0","Diversity In Our Heritage,Diversity In Our Beer"),50.565648,-111.882645,39,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=87&status=2'},'Newell Brewing Company',2,50.565648,-111.882645,87 ], [locationData('/calgary_brewery_profile/10/Ol_Beautiful_Brewing_Co/','Fills,Pints,Snacks','/markerbacking.asp?status=2&id=10','Ol` Beautiful Brewing Co.'," 1103 12 St SE ","403-978-4721","5","8","Now Open! - WE PUT CRAFT FIRST"),51.03958,-114.036338,40,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=10&status=2'},'Ol` Beautiful Brewing Co.',2,51.03958,-114.036338,10 ], [locationData('/calgary_brewery_profile/64/Olds_College_Brewery/','Taproom','/markerbacking.asp?status=2&id=64','Olds College Brewery'," 4500 50 Street ","(403) 556-8293","5","6",""),51.7889795,-114.0930925,41,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=64&status=2'},'Olds College Brewery',2,51.7889795,-114.0930925,64 ], [locationData('/calgary_brewery_profile/61/Origin_Malting_and_Brewing_Co/','Fills,Pints,Cans,Tours,Merch','/markerbacking.asp?status=2&id=61','Origin Malting & Brewing Co.'," 60 Spruce Park Dr ","(403) 902-0868","5","1","Local Barley to Beer."),51.0318856,-113.388457599,42,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=61&status=2'},'Origin Malting & Brewing Co.',2,51.0318856,-113.388457599,61 ], [locationData('/calgary_brewery_profile/47/Paradise_Beverage_Company/','','/markerbacking.asp?status=2&id=47','Paradise Beverage Company'," 1319 Edmonton Trail NE ","403-277-7099","5","8","Some new is brewing. Coming soon."),51.063985,-114.056618,43,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=47&status=2'},'Paradise Beverage Company',2,51.063985,-114.056618,47 ], [locationData('/calgary_brewery_profile/70/Piston_Broke_Brewing/','','/markerbacking.asp?status=2&id=70','Piston Broke Brewing'," 350 9th St E ","","5","0","Brooks,Alberta's first craft brewery"),50.56635,-111.87857,44,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=70&status=2'},'Piston Broke Brewing',2,50.56635,-111.87857,70 ], [locationData('/calgary_brewery_profile/13/Railyard_Brewing/','Taproom','/markerbacking.asp?status=2&id=13','Railyard Brewing'," 10301 19 Street Northeast #Unit 121 ","403-465-4831","5","4","Welcome to Railyard,where science and art collide."),51.146557,-114.013922,45,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=13&status=2'},'Railyard Brewing',2,51.146557,-114.013922,13 ], [locationData('/calgary_brewery_profile/41/Rapid_Ascent/','','/markerbacking.asp?status=2&id=41','Rapid Ascent'," 107 10985 38 St NE ","(403) 214-9813","5","8","Now Open"),51.1528306,-113.9780222,46,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=41&status=2'},'Rapid Ascent',2,51.1528306,-113.9780222,41 ], [locationData('/calgary_brewery_profile/79/Sheepdog_Brewing/','','/markerbacking.asp?status=2&id=79','Sheepdog Brewing'," 112-105 Bow Meadows Cresent ","4035427800","5","10","opening Friday June 7th at 1pm"),51.07628,-115.320288,47,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=79&status=2'},'Sheepdog Brewing',2,51.07628,-115.320288,79 ], [locationData('/calgary_brewery_profile/100/Solutions_Brewing/','Contract','/markerbacking.asp?status=2&id=100','Solutions Brewing'," Calgary ","","5","0","Crafting (Beer) Solutions One Batch at a Time"),51.105537,-114.107906,48,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=100&status=2'},'Solutions Brewing',2,51.105537,-114.107906,100 ], [locationData('/calgary_brewery_profile/37/The_Dandy_Brewing_Company_And_Tasting_Room/','Brewery Restaurant','/markerbacking.asp?status=2&id=37','The Dandy Brewing Company And Tasting Room'," 2003 11 St SE ","403-769-9399","5","20",""),51.035139,-114.0371571,49,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=37&status=2'},'The Dandy Brewing Company And Tasting Room',2,51.035139,-114.0371571,37 ], [locationData('/calgary_brewery_profile/69/The_Grizzly_Paw_Brewing_Company/','Resto','/markerbacking.asp?status=2&id=69','The Grizzly Paw Brewing Company'," 622 8 St ","(403) 678-9983","5","4","Rustic,mountain-view pub pairing its own microbrews with elevated Canadian bar fare,plus a patio."),51.0885855,-115.3451317,50,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=69&status=2'},'The Grizzly Paw Brewing Company',2,51.0885855,-115.3451317,69 ], [locationData('/calgary_brewery_profile/88/Tower_Brewing_Company/','Contract Brewer','/markerbacking.asp?status=2&id=88','Tower Brewing Company'," 5750 76 Ave SE ","(250) 217-2949","5","0","coming soon"),50.98542,-113.950303,51,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=88&status=2'},'Tower Brewing Company',2,50.98542,-113.950303,88 ], [locationData('/calgary_brewery_profile/60/Township_24_Brewery/','Offsales','/markerbacking.asp?status=2&id=60','Township 24 Brewery'," 210 - 100 Rainbow Road ","4039219145","5","0","Putting Local On The Map."),51.0252767,-113.8405356,52,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=60&status=2'},'Township 24 Brewery',2,51.0252767,-113.8405356,60 ], [locationData('/calgary_brewery_profile/38/Two_House_Brewing/','Taproom','/markerbacking.asp?status=2&id=38','Two House Brewing'," 1901 10th Ave SW Calgary ","(403) 287-0215","5","3","New Location Now Open"),51.0443439,-114.1043747,53,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=38&status=2'},'Two House Brewing',2,51.0443439,-114.1043747,38 ], [locationData('/calgary_brewery_profile/40/Uncommon_Cider_Co/','Taproom','/markerbacking.asp?status=2&id=40','Uncommon Cider Co'," 3915 Manchester Rd SE ","","5","9","Uncompromising. Fermented in Calgary."),51.0187972,-114.0595335,54,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=40&status=2'},'Uncommon Cider Co',2,51.0187972,-114.0595335,40 ], [locationData('/calgary_brewery_profile/80/Valley_Brewing/','Taproom','/markerbacking.asp?status=2&id=80','Valley Brewing'," 242 3 Ave W ","403-821-3666","5","10","Drumheller's only micro brewery near downtown. Great patio beside a wonderful park."),51.4640001,-112.7113933,55,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=80&status=2'},'Valley Brewing',2,51.4640001,-112.7113933,80 ], [locationData('/calgary_brewery_profile/5/Village_Brewery/','Brewery Taproom','/markerbacking.asp?status=2&id=5','Village Brewery'," 5000 12A Street SE ","403-243-3327","5","7","Gathering people around community,one or two beers at a time."),51.0094443,-114.0352996,56,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=5&status=2'},'Village Brewery',2,51.0094443,-114.0352996,5 ], [locationData('/calgary_brewery_profile/4/Wild_Rose_Brewery_Ltd/','pints and off sales','/markerbacking.asp?status=2&id=4','Wild Rose Brewery Ltd'," 4580 Quesnay Wood Dr SW ","(403) 727-5451","5","6","'Strong and Free',Wildrose is worth tasting."),51.0144733,-114.1227383,57,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=4&status=2'},'Wild Rose Brewery Ltd',2,51.0144733,-114.1227383,4 ], [locationData('/calgary_brewery_profile/99/XhAle_Brew_Co/','contract','/markerbacking.asp?status=2&id=99','XhAle Brew Co'," Calgary ","4038280669","5","0","Provocative beer for conscious thinkers & drinkers"),51.109537,-114.108906,58,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=99&status=2'},'XhAle Brew Co',2,51.109537,-114.108906,99 ], [locationData('/calgary_brewery_profile/18/Zero_Issue_Brewing/','','/markerbacking.asp?status=2&id=18','Zero Issue Brewing'," 4210 12 St NE ","(403) 889-9740","5","8",""),51.0893382,-114.0316046,59,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=18&status=2'},'Zero Issue Brewing',2,51.0893382,-114.0316046,18 ], [locationData('/calgary_brewery_profile/62/948_Brewing/','','/markerbacking.asp?status=1&id=62','948 Brewing'," 541 Kingsview Way SE Unit 104 ","(403) 948-2337","5","8","Nano brewery in Airdrie,Alberta"),51.2612882,-113.9974705,60,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=62&status=1'},'948 Brewing',1,51.2612882,-113.9974705,62 ], [locationData('/calgary_brewery_profile/2/Banded_Peak_Brewing/','Pints,Fills,Cans','/markerbacking.asp?status=1&id=2','Banded Peak Brewing'," 119 - 519 34 Avenue Southeast ","(403) 283-5133","5","9","Pouring beer across Calgary! Taproom is open Wednesday to Sunday."),51.022842,-114.0516512,61,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=2&status=1'},'Banded Peak Brewing',1,51.022842,-114.0516512,2 ], [locationData('/calgary_brewery_profile/103/Best_of_Kin/','Brewery','/markerbacking.asp?status=1&id=103','Best of Kin'," 1059 14 St SW ","(825) 413-4233","5","8","Best of Kin Social"),51.043435,-114.094982,62,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=103&status=1'},'Best of Kin',1,51.043435,-114.094982,103 ], [locationData('/calgary_brewery_profile/86/Big_Beaver_Brewing/','','/markerbacking.asp?status=1&id=86','Big Beaver Brewing'," 1013 - 200 Southridge Drive Okotoks AB ","4035619309","5","0","Born in the prairies. Brewed in the city."),50.7079151,-113.9754608,63,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=86&status=1'},'Big Beaver Brewing',1,50.7079151,-113.9754608,86 ], [locationData('/calgary_brewery_profile/98/Bitter_Sisters_Brewing_Co/','','/markerbacking.asp?status=1&id=98','Bitter Sisters Brewing Co'," 510 Heritage Dr SW ","(403) 287-8811","5","12","Beer Makes The Bitter Better. NOW OPEN!"),50.9802172,-114.07571,64,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=98&status=1'},'Bitter Sisters Brewing Co',1,50.9802172,-114.07571,98 ], [locationData('/calgary_brewery_profile/94/Bragg_Creek_Brewing/','BrewPub','/markerbacking.asp?status=1&id=94','Bragg Creek Brewing'," Somewhere ","403-836-7629","5","0","Coming Soon,From the banks of the Elbow River"),50.952315,-114.5675053,65,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=94&status=1'},'Bragg Creek Brewing',1,50.952315,-114.5675053,94 ], [locationData('/calgary_brewery_profile/92/Buffalo_9_Brewing/','Contract Brewer','/markerbacking.asp?status=1&id=92','Buffalo 9 Brewing'," Contracting ","4039921606","5","0","There's Always Time For A Great Beer"),51.1157875,-114.1116526,66,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=92&status=1'},'Buffalo 9 Brewing',1,51.1157875,-114.1116526,92 ], [locationData('/calgary_brewery_profile/34/Burn_Block_Social/','','/markerbacking.asp?status=1&id=34','Burn Block Social'," 1217B 9 Ave SE ","587-893-2337","5","8","Formerly Revival Brewcade"),51.0415675,-114.0357889,67,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=34&status=1'},'Burn Block Social',1,51.0415675,-114.0357889,34 ], [locationData('/calgary_brewery_profile/50/Delta_Brewery/','Coming Soon','/markerbacking.asp?status=1&id=50','Delta Brewery'," Somewhere ","","5","0","Nano Brewery - Not Opened Yet"),51.2854723,-114.0716046,68,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=50&status=1'},'Delta Brewery',1,51.2854723,-114.0716046,50 ], [locationData('/calgary_brewery_profile/101/functionBrewery/','contract','/markerbacking.asp?status=1&id=101','functionBrewery'," ","","5","0",""),0,0,69,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=101&status=1'},'functionBrewery',1,0,0,101 ], [locationData('/calgary_brewery_profile/25/Goat_Locker_Brewing_Company/','In Stores/Pubs Only','/markerbacking.asp?status=1&id=25','Goat Locker Brewing Company'," 209 9a St NW ","403-831-7067","5","0","Proudly Craft Brewed in Alberta"),51.115703,-114.1057717,70,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=25&status=1'},'Goat Locker Brewing Company',1,51.115703,-114.1057717,25 ], [locationData('/calgary_brewery_profile/55/Hard_Knox_Brewery/','Fills,pints','/markerbacking.asp?status=1&id=55','Hard Knox Brewery'," 445 1ave ","(403) 800-5603","5","0","Taproom now open"),50.688794,-114.224779,71,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=55&status=1'},'Hard Knox Brewery',1,50.688794,-114.224779,55 ], [locationData('/calgary_brewery_profile/57/Hubtown_Brewing/','','/markerbacking.asp?status=1&id=57','Hubtown Brewing'," 41 Elizabeth St ","","5","0","Planned"),50.7254262,-113.9777061,72,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=57&status=1'},'Hubtown Brewing',1,50.7254262,-113.9777061,57 ], [locationData('/calgary_brewery_profile/76/Into_The_Wild_Brewing_Company/','','/markerbacking.asp?status=1&id=76','Into The Wild Brewing Company'," Somewhere ","","5","0",""),51.109537,-114.108906,73,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=76&status=1'},'Into The Wild Brewing Company',1,51.109537,-114.108906,76 ], [locationData('/calgary_brewery_profile/83/Juno_Brewing_Company/','','/markerbacking.asp?status=1&id=83','Juno Brewing Company'," Somewhere ","14067301500","5","0","Unknown"),50.4239005,-113.2772889,74,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=83&status=1'},'Juno Brewing Company',1,50.4239005,-113.2772889,83 ], [locationData('/calgary_brewery_profile/77/Long_Hop_Brewing_Company/','','/markerbacking.asp?status=1&id=77','Long Hop Brewing Company'," Somewhere ","","5","0",""),51.109837,-114.108986,75,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=77&status=1'},'Long Hop Brewing Company',1,51.109837,-114.108986,77 ], [locationData('/calgary_brewery_profile/84/New_Era_Brewing_Inc/','','/markerbacking.asp?status=1&id=84','New Era Brewing Inc.'," ","","5","0","coming soon"),51.1083102,-114.1211149,76,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=84&status=1'},'New Era Brewing Inc.',1,51.1083102,-114.1211149,84 ], [locationData('/calgary_brewery_profile/91/Oldman_River_Brewing/','BrewPub','/markerbacking.asp?status=1&id=91','Oldman River Brewing'," 101 Breckenridge Ave ","(403) 751-0017","5","8","GOOD,HONEST BEER."),49.5868508,-114.1625932,77,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=91&status=1'},'Oldman River Brewing',1,49.5868508,-114.1625932,91 ], [locationData('/calgary_brewery_profile/95/One_For_The_Road_Brewing_Company/','','/markerbacking.asp?status=1&id=95','One For The Road Brewing Company'," ","403 861-4353","5","0","Non-Alcoholic Craft Beer"),51.1102857,-114.1237394,78,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=95&status=1'},'One For The Road Brewing Company',1,51.1102857,-114.1237394,95 ], [locationData('/calgary_brewery_profile/12/Paddy_s_Barbecue_and_Brewery/','Restaurant & Brewery','/markerbacking.asp?status=1&id=12','Paddy`s Barbecue & Brewery'," 3610 Burnsland Road SE ","403-651-7150","5","4","Paddy's has closed down - Permanently"),51.0228699,-114.0576988,79,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=12&status=1'},'Paddy`s Barbecue & Brewery',1,51.0228699,-114.0576988,12 ], [locationData('/calgary_brewery_profile/71/Rocky_View_Brewing_Company/','','/markerbacking.asp?status=1&id=71','Rocky View Brewing Company'," Somewhere ","403-710-8518","5","0","Nano Brewery located just west of Calgary,dedicated to crafting exceptional beer one batch at a time."),51.1751129,-114.2809515,80,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=71&status=1'},'Rocky View Brewing Company',1,51.1751129,-114.2809515,71 ], [locationData('/calgary_brewery_profile/102/South_Block_Barbecue_and_Brewing_Co/','Brewpub','/markerbacking.asp?status=1&id=102','South Block Barbecue & Brewing Co.'," 2437 4 St SW ","(403) 764-4227","5","8",""),51.030835,-114.071678,81,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=102&status=1'},'South Block Barbecue & Brewing Co.',1,51.030835,-114.071678,102 ], [locationData('/calgary_brewery_profile/93/Spectrum_Ale_Works/','Taproom','/markerbacking.asp?status=1&id=93','Spectrum Ale Works'," 3500 9 Ave N ","","5","14","SPECTRUM ALE WORKS is a microbrewery located in Lethbridge,Alberta."),49.712648,-112.788979,82,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=93&status=1'},'Spectrum Ale Works',1,49.712648,-112.788979,93 ], [locationData('/calgary_brewery_profile/104/Stonyslope_Brewing_Company/','Brewpub','/markerbacking.asp?status=1&id=104','Stonyslope Brewing Company'," 9620 Elbow Dr SW #20 ","","5","8",""),50.9690128,-114.0839338,83,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=104&status=1'},'Stonyslope Brewing Company',1,50.9690128,-114.0839338,104 ], [locationData('/calgary_brewery_profile/89/Stronghold_Brewing_Co/','','/markerbacking.asp?status=1&id=89','Stronghold Brewing Co'," 230 24th Street ","(403) 635-9381","5","9","Welcome to #drinkcityclub "),49.72543,-113.4076614,84,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=89&status=1'},'Stronghold Brewing Co',1,49.72543,-113.4076614,89 ], [locationData('/calgary_brewery_profile/97/Tailgunner_Brewing_Company/','','/markerbacking.asp?status=1&id=97','Tailgunner Brewing Company'," 1602 10 Ave SW ","(825)407-8599","5","0",""),51.0443815,-114.0969096,85,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=97&status=1'},'Tailgunner Brewing Company',1,51.0443815,-114.0969096,97 ], [locationData('/calgary_brewery_profile/85/The_Bruch_Brewing_Company/','','/markerbacking.asp?status=1&id=85','The Bruch Brewing Company'," 200-208 Barclay Parade SW ","","5","0","Bruch Brewery and Bar Brewery in Calgary brewing organic and gluten free kombucha beer"),51.0530822,-114.0668126,86,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=85&status=1'},'The Bruch Brewing Company',1,51.0530822,-114.0668126,85 ], [locationData('/calgary_brewery_profile/78/The_Pass_Beer_Company/','BrewPub','/markerbacking.asp?status=1&id=78','The Pass Beer Company'," 10801 20th Ave ","4034320404","5","0","Coming Soon"),49.6176641,-114.4616263,87,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=78&status=1'},'The Pass Beer Company',1,49.6176641,-114.4616263,78 ], [locationData('/calgary_brewery_profile/65/Theoretically_Brewing_Company_Ltd/','Taproom','/markerbacking.asp?status=1&id=65','Theoretically Brewing Company Ltd.'," 1263 2 Ave S ","(403) 715-5140","5","8","We are the best-kept secret in Lethbridge! "),49.6976418,-112.8258722,88,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=65&status=1'},'Theoretically Brewing Company Ltd.',1,49.6976418,-112.8258722,65 ], [locationData('/calgary_brewery_profile/81/Two_Pillars_Brewery/','Taproom','/markerbacking.asp?status=1&id=81','Two Pillars Brewery'," 910 Centre St N ","","5","12","Opening May 1st 2020!"),51.060275,-114.062281,89,{ anchor: new google.maps.Point(22,16),url: '/custommarker.asp?id=81&status=1'},'Two Pillars Brewery',1,51.060275,-114.062281,81 ] ]; var cooks = getCookie("yycbeerlastpos"); // console.log(cooks); if (cooks !="") { cooks = cooks.split("_"); var cookz = Number(cooks[2]); var cooklat = Number(cooks[0]); var cooklon = Number(cooks[1]); //if (cooklat > 52 || cooklat < 50) { //cooklat = 51.0228354; //} //if (cooklon < -115 || cooklat > -112) { //cooklon = -114.0536417 //} } else { var cookz = 13; var cooklat = 51.0228354; var cooklon = -114.0536417; } map = new google.maps.Map(document.getElementById('map-main'),{ zoom: cookz, scrollwheel: true, center: new google.maps.LatLng(cooklat,cooklon), mapTypeId: google.maps.MapTypeId.ROADMAP, zoomControl: false, mapTypeControl: false, scaleControl: false, panControl: false, fullscreenControl: true, navigationControl: false, streetViewControl: false, animation: google.maps.Animation.BOUNCE, gestureHandling: 'greedy', styles: [{ "featureType": "administrative", "elementType": "labels.text.fill", "stylers": [{ "color": "#444444" }] }] }); dobounds(); map.addListener('center_changed',function() { getsetcookie(); }); map.addListener('zoom_changed',function() { // console.log('Zoom: ' + map.getZoom()); getsetcookie(); var aoms = []; aoms = oms.getMarkers(); for(i = 0 ; i< aoms.length; i++) { //// console.log(oms.getMarkers()); } var zoom = map.getZoom(); for (i = 0; i < minilocs.length; i++) { //markers[i].setVisible(zoom <= 15); if (zoom >= 15) { allMarkersMin[i].setVisible(true); } else { } // console.log(zoom); //// console.log(allMarkersMin[i].setVisible()); // console.log(allMarkersMin[i]); } }); // // // // function openAllClusters() { var markers = oms.markersNearAnyOtherMarker(); $.each(markers,function (i,marker) { google.maps.event.trigger(markers[i],'spider_click'); }); setTimeout(openAllClusters,200); } setTimeout(openAllClusters,2000); // // // // var legend = document.createElement('div'); legend.id = 'legend'; var content = []; content.push('

'); legend.innerHTML = content.join(''); map.controls[google.maps.ControlPosition.LEFT_TOP].push(legend); legend.index = 1; layer = new google.maps.FusionTablesLayer({ map: map, heatmap: { enabled: false }, query: { select: "col2", from: "11WUGDwMb62zuS2NfmQS2rkqIzVBj388UfilKfYDv", where: "" }, options: { styleId: 2, templateId: 2 } }); // // console.log(layer); layer.setMap(null); var boxText = document.createElement("div"); boxText.className = 'map-box' var currentInfobox; var boxOptions = { content: boxText, disableAutoPan: true, alignBottom: true, maxWidth: 0, pixelOffset: new google.maps.Size(-145,-45), zIndex: null, boxStyle: { width: "260px" }, closeBoxMargin: "0", closeBoxURL: "", infoBoxClearance: new google.maps.Size(1,1), isHidden: false, pane: "floatPane", enableEventPropagation: false, }; var markerCluster,marker,i; var clusterStyles = [{ textColor: 'white', url: '', height: 50, width: 50 }]; var clusterStylesMin = [{ textColor: 'white', url: '', height: 5, width: 5 }]; var oms = new OverlappingMarkerSpiderfier(map,{ keepSpiderfied:true, markersWontMove: true,// we promise not to move any markers,allowing optimizations markersWontHide: true,// we promise not to change visibility of any markers,allowing optimizations basicFormatEvents: true // allow the library to skip calculating advanced formatting information }); for (i = 0; i < minilocs.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(minilocs[i][1],minilocs[i][2]), icon: minilocs[i][4], map: map }); allMarkersMin.push(marker); var ib = new InfoBox(); google.maps.event.addListener(ib,"domready",function () { cardRaining() }); google.maps.event.addListener(marker,'click',(function (marker,i) { return function () { ib.setOptions(boxOptions); boxText.innerHTML = minilocs[i][0]; ib.close(); ib.open(map,marker); currentInfobox = marker.id; var latLng = new google.maps.LatLng(minilocs[i][1],minilocs[i][2]); map.panTo(latLng); map.panBy(0,-180); google.maps.event.addListener(ib,'domready',function () { $('.infoBox-close').click(function (e) { e.preventDefault(); ib.close(); }); }); } })(marker,i)); } for (i = 0; i < eventlocations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(eventlocations[i][1],eventlocations[i][2]), icon: '/images/poutine-icon.png', name:eventlocations[i][5], adminstatus:eventlocations[i][6], lat:eventlocations[i][7], lng:eventlocations[i][8], id: i }); allMarkersEvent.push(marker); bounds.extend(marker.getPosition()); var ib = new InfoBox(); google.maps.event.addListener(ib,"domready",function () { cardRaining() }); oms.addMarker(marker); google.maps.event.addListener(marker,'click',(function (marker,i) { return function () { $("#legend").hide(); ib.setOptions(boxOptions); boxText.innerHTML = eventlocations[i][0]; ib.close(); ib.open(map,marker); currentInfobox = marker.id; var latLng = new google.maps.LatLng(eventlocations[i][1],eventlocations[i][2]); map.panTo(latLng); map.panBy(0,-180); google.maps.event.addListener(ib,'domready',function () { $('.infoBox-close').click(function (e) { e.preventDefault(); ib.close(); }); }); } })(marker,i)); } for (i = 0; i < locations.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1],locations[i][2]), icon: locations[i][4], name:locations[i][5], adminstatus:locations[i][6], lat:locations[i][7], lng:locations[i][8], id: i, bid:locations[i][9] }); allMarkers.push(marker); bounds.extend(marker.getPosition()); var ib = new InfoBox(); google.maps.event.addListener(ib,"domready",function () { cardRaining() }); oms.addMarker(marker); google.maps.event.addListener(marker,'click',(function (marker,i) { return function () { // console.log('pop marker action.'); pophandler(locations[i][9]); $("#legend").hide(); ib.setOptions(boxOptions); boxText.innerHTML = locations[i][0]; ib.close(); ib.open(map,marker); currentInfobox = marker.id; var latLng = new google.maps.LatLng(locations[i][1],locations[i][2]); map.panTo(latLng); map.panBy(0,-180); google.maps.event.addListener(ib,'domready',function () { $('.infoBox-close').click(function (e) { e.preventDefault(); ib.close(); }); }); } })(marker,i)); } var coptions = { imagePath: 'images/', styles: clusterStyles, minClusterSize: 4, extra:'drew is extra' }; var optionsmin = { imagePath: 'images/', styles: clusterStylesMin, minClusterSize: 1000 }; // markerCluster = new MarkerClusterer(map,allMarkersMin,optionsmin); markerCluster = new MarkerClusterer(map,allMarkers,coptions); google.maps.event.addDomListener(window,"resize",function () { var center = map.getCenter(); google.maps.event.trigger(map,"resize"); map.setCenter(center); }); $('.nextmap-nav').click(function (e) { e.preventDefault(); map.setZoom(17); var index = currentInfobox; if (index + 1 < allMarkers.length) { google.maps.event.trigger(allMarkers[index + 1],'click'); } else { google.maps.event.trigger(allMarkers[0],'click'); } }); $('.prevmap-nav').click(function (e) { e.preventDefault(); map.setZoom(15); if (typeof (currentInfobox) == "undefined") { google.maps.event.trigger(allMarkers[allMarkers.length - 1],'click'); } else { var index = currentInfobox; if (index - 1 < 0) { google.maps.event.trigger(allMarkers[allMarkers.length - 1],'click'); } else { google.maps.event.trigger(allMarkers[index - 1],'click'); } } }); $('.map-item').click(function (e) { e.preventDefault(); map.setZoom(15); var index = currentInfobox; var marker_index = parseInt($(this).attr('href').split('#')[1],10); google.maps.event.trigger(allMarkers[marker_index],"click"); if ($(this).hasClass("scroll-top-map")){ $('html,body').animate({ scrollTop: $(".map-container").offset().top+ "-80px" },500) } else if ($(window).width()<1064){ $('html,body').animate({ scrollTop: $(".map-container").offset().top+ "-80px" },500) } }); var zoomControlDiv = document.createElement('div'); var zoomControl = new ZoomControl(zoomControlDiv,map); function ZoomControl(controlDiv,map) { zoomControlDiv.index = 1; map.controls[google.maps.ControlPosition.RIGHT_CENTER].push(zoomControlDiv); controlDiv.style.padding = '5px'; var controlWrapper = document.createElement('div'); controlDiv.appendChild(controlWrapper); var zoomInButton = document.createElement('div'); zoomInButton.className = "mapzoom-in"; controlWrapper.appendChild(zoomInButton); var zoomOutButton = document.createElement('div'); zoomOutButton.className = "mapzoom-out"; controlWrapper.appendChild(zoomOutButton); google.maps.event.addDomListener(zoomInButton,'click',function () { map.setZoom(map.getZoom() + 1); }); google.maps.event.addDomListener(zoomOutButton,'click',function () { map.setZoom(map.getZoom() - 1); }); } var infolocs = [ //["",51.0454191,-114.0715827,4,{ anchor: new google.maps.Point(22,16),url: 'http://yycbeer.ca/mapicons/restaurant.png' }], //["",51.045363,-114.0916535,4,{ anchor: new google.maps.Point(22,16),url: 'http://yycbeer.ca/mapicons/restaurant.png' }], //["",51.0359131,-114.0615035,4,{ anchor: new google.maps.Point(22,16),url: 'http://yycbeer.ca/mapicons/cycling.png' }], ]; for (i = 0; i < infolocs.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(infolocs[i][1],infolocs[i][2]), icon: infolocs[i][4], map: map }); google.map.addListener('center_changed',function() { getsetcookie(); }); google.maps.event.addListener(marker,'click',function(e){ var keys = Object.keys(e); var x,y; for (var i = 0; i < keys.length; i++) { // console.log(e[keys[i]]); if (MouseEvent.prototype.isPrototypeOf(e[keys[i]])) { x = e[keys[i]].clientX; y = e[keys[i]].clientY; } } // console.log('clientx '+eval(e.va)); //deleteTooltip(e); injectTooltip(e,"test",x,y); }); //overlay.setMap(null); } } map = document.getElementById('map-main'); //map.fitBounds(bounds); // // console.log("bounds"); // // console.log(bounds); if (typeof (map) != 'undefined' && map != null) { google.maps.event.addDomListener(window,'load',mainMap); } function singleMap() { var myLatLng = { lng: $('#singleMap').data('longitude'), lat: $('#singleMap').data('latitude'), }; var smarkerIcon = { anchor: new google.maps.Point(22,16),url: $('#singleMap').data('icon') } var single_map = new google.maps.Map(document.getElementById('singleMap'),{ zoom: 14, center: myLatLng, scrollwheel: false, zoomControl: false, mapTypeControl: false, scaleControl: false, panControl: false, navigationControl: false, streetViewControl: false, styles: [{ "featureType": "landscape", "elementType": "all", "stylers": [{ "color": "#f2f2f2" }] }] }); var marker = new google.maps.Marker({ position: myLatLng, map: single_map, icon: smarkerIcon, gestureHandling: 'greedy', title: 'Our Location' }); function locationDatamini(locationURL,locationCategory,locationImg,locationTitle,locationAddress,locationPhone,locationStarRating,locationRevievsCounter,tagline) { if (locationCategory=="Alcohol In City Parks") { return ('
!!' + locationCategory + '

' + locationTitle + '

'+ tagline +'
' + locationAddress + '' + locationPhone + '
'); } else{ return ('
' + locationCategory + '

' + locationTitle + '

'+ tagline +'
' + locationAddress + '' + locationPhone + '
'); } } allMarkersMin = []; minilocs = [ //poi-map starts [locationDatamini('/noticed_venue/Confluence_Distilling/51.0212758/-114.0533179/6/Craft_Beer_Calgary/','Top Spot','/images/pois/confluence_distilling_calgary.png','Confluence Distilling'," 507 36th AVE SE,Calgary ","(587)771-1286","5","0","Distillery in the heart of Calgary,handcrafting small-batch Gin\'s and more! Visit the Distillery for a craft cocktail,or grab a limited release spirit."),51.0212758,-114.0533179,4,{ anchor: new google.maps.Point(22,16),url: 'http://yycbeer.ca/mapicons/bar_coktail.png' }], ]; var i=0; for (i = 0; i < minilocs.length; i++) { marker = new google.maps.Marker({ position: new google.maps.LatLng(minilocs[i][1],minilocs[i][2]), icon: minilocs[i][4], map: single_map }); allMarkersMin.push(marker); var ib = new InfoBox(); google.maps.event.addListener(ib,"domready",function () { cardRaining() }); google.maps.event.addListener(marker,'click',(function (marker,i) { return function () { ib.setOptions(boxOptions); boxText.innerHTML = minilocs[i][0]; ib.close(); ib.open(single_map,marker); currentInfobox = marker.id; var latLng = new google.maps.LatLng(minilocs[i][1],minilocs[i][2]); single_map.panTo(latLng); single_map.panBy(0,-180); google.maps.event.addListener(ib,'domready',function () { $('.infoBox-close').click(function (e) { e.preventDefault(); ib.close(); }); }); } })(marker,i)); } var zoomControlDiv = document.createElement('div'); var zoomControl = new ZoomControl(zoomControlDiv,single_map); function ZoomControl(controlDiv,single_map) { zoomControlDiv.index = 1; single_map.controls[google.maps.ControlPosition.RIGHT_CENTER].push(zoomControlDiv); controlDiv.style.padding = '5px'; var controlWrapper = document.createElement('div'); controlDiv.appendChild(controlWrapper); var zoomInButton = document.createElement('div'); zoomInButton.className = "mapzoom-in"; controlWrapper.appendChild(zoomInButton); var zoomOutButton = document.createElement('div'); zoomOutButton.className = "mapzoom-out"; controlWrapper.appendChild(zoomOutButton); google.maps.event.addDomListener(zoomInButton,'click',function () { single_map.setZoom(single_map.getZoom() + 1); }); google.maps.event.addDomListener(zoomOutButton,'click',function () { single_map.setZoom(single_map.getZoom() - 1); }); } } var single_map = document.getElementById('singleMap'); if (typeof (single_map) != 'undefined' && single_map != null) { google.maps.event.addDomListener(window,'load',singleMap); } })(this.jQuery); var coordPropName = null; function injectTooltip(event,data,x,y){ if(!tipObj && event){ //create the tooltip object tipObj = document.createElement("div"); tipObj.style.width = '100px'; tipObj.style.height = '40px'; tipObj.style.background = "white"; tipObj.style.borderRadius = "5px"; tipObj.style.padding = "10px"; tipObj.style.fontFamily = "Arial,Helvetica"; tipObj.style.textAlign = "center"; tipObj.innerHTML = data; // console.log('tip attempt'); //fix for the version issue eventPropNames = Object.keys(event); if(!coordPropName){ //discover the name of the prop with MouseEvent // console.log(eval(Object.keys)); // console.log(Object.keys("va")); for(var i in eventPropNames){ var name = eventPropNames[i]; // console.log(name); if(event[name] instanceof MouseEvent){ coordPropName = name; // console.log("--> mouse event in",coordPropName) break; } } } tipObj.style.zIndex = "8"; if(coordPropName){ //position it // console.log('propname='+coordPropName); tipObj.style.position = "fixed"; tipObj.style.top = event[coordPropName].clientY + window.scrollY + offset.y + "px"; tipObj.style.left = event[coordPropName].clientX + window.scrollX + offset.x + "px"; //add it to the body document.body.appendChild(tipObj); }else { tipObj.style.position = "fixed"; tipObj.style.top = y + "px"; tipObj.style.left = x + "px"; document.body.appendChild(tipObj); // console.log(x+' x '+y); // console.log(tipObj); } } } /******************************************************************** * moveTooltip(e) * update the position of the tooltip based on the event data ********************************************************************/ function moveTooltip(event){ if(tipObj && event && coordPropName){ //position it tipObj.style.top = event[coordPropName].clientY + window.scrollY + offset.y + "px"; tipObj.style.left = event[coordPropName].clientX + window.scrollX + offset.x + "px"; } } /******************************************************************** * deleteTooltip(e) * delete the tooltip if it exists in the DOM ********************************************************************/ function deleteTooltip(event){ if(tipObj){ //delete the tooltip if it exists in the DOM document.body.removeChild(tipObj); tipObj = null; } } function handler(e) { e = e || window.event; var pageX = e.pageX; var pageY = e.pageY; // IE 8 if (pageX === undefined) { pageX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; pageY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } //// console.log(pageX,pageY); } // attach handler to the click event of the document if (document.attachEvent) document.attachEvent('mousemove',handler); else document.addEventListener('mousemove',handler); function pophandler(bid) { // console.log('zoomed on icon'); $.get( "/ajax/mpz/?"+bid,function( data ) { // console.log( data ); }); outterpophandler(bid); // console.log(bid); } // function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i