function addMarkers(){ mySelect = document.getElementById('selection'); Monroeville = [];Jasper = [];Mobile = [];Alexander_City = [];Phenix_City = [];Montgomery = [];Enterprise = [];Gadsden = [];Anniston = [];Dothan = [];Hanceville = [];Selma = [];Birmingham = [];Bessemer = [];Huntsville = [];Deatsville = [];Bay_Minette = [];Brewton = [];Tanner = [];Andalusia = [];Opp = [];Marion = [];Rainsville = [];Muscle_Shoals = [];Evergreen = [];Tuscaloosa = [];Boaz = [];Wadley = [];mySelect.options[mySelect.options.length] = new Option("Alexander City Schools",'all=Alexander_City'); mySelect.options[mySelect.options.length] = new Option("Andalusia Schools",'all=Andalusia'); mySelect.options[mySelect.options.length] = new Option("Anniston Schools",'all=Anniston'); mySelect.options[mySelect.options.length] = new Option("Bay Minette Schools",'all=Bay_Minette'); mySelect.options[mySelect.options.length] = new Option("Bessemer Schools",'all=Bessemer'); mySelect.options[mySelect.options.length] = new Option("Birmingham Schools",'all=Birmingham'); mySelect.options[mySelect.options.length] = new Option("Boaz Schools",'all=Boaz'); mySelect.options[mySelect.options.length] = new Option("Brewton Schools",'all=Brewton'); mySelect.options[mySelect.options.length] = new Option("Deatsville Schools",'all=Deatsville'); mySelect.options[mySelect.options.length] = new Option("Dothan Schools",'all=Dothan'); mySelect.options[mySelect.options.length] = new Option("Enterprise Schools",'all=Enterprise'); mySelect.options[mySelect.options.length] = new Option("Evergreen Schools",'all=Evergreen'); mySelect.options[mySelect.options.length] = new Option("Gadsden Schools",'all=Gadsden'); mySelect.options[mySelect.options.length] = new Option("Hanceville Schools",'all=Hanceville'); mySelect.options[mySelect.options.length] = new Option("Huntsville Schools",'all=Huntsville'); mySelect.options[mySelect.options.length] = new Option("Jasper Schools",'all=Jasper'); mySelect.options[mySelect.options.length] = new Option("Marion Schools",'all=Marion'); mySelect.options[mySelect.options.length] = new Option("Mobile Schools",'all=Mobile'); mySelect.options[mySelect.options.length] = new Option("Monroeville Schools",'all=Monroeville'); mySelect.options[mySelect.options.length] = new Option("Montgomery Schools",'all=Montgomery'); mySelect.options[mySelect.options.length] = new Option("Muscle Shoals Schools",'all=Muscle_Shoals'); mySelect.options[mySelect.options.length] = new Option("Opp Schools",'all=Opp'); mySelect.options[mySelect.options.length] = new Option("Phenix City Schools",'all=Phenix_City'); mySelect.options[mySelect.options.length] = new Option("Rainsville Schools",'all=Rainsville'); mySelect.options[mySelect.options.length] = new Option("Selma Schools",'all=Selma'); mySelect.options[mySelect.options.length] = new Option("Tanner Schools",'all=Tanner'); mySelect.options[mySelect.options.length] = new Option("Tuscaloosa Schools",'all=Tuscaloosa'); mySelect.options[mySelect.options.length] = new Option("Wadley Schools",'all=Wadley'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); var tmpLatLng=0; var tmpLen=0; tmpLatLng=new GLatLng(31.48044000000000153,-87.3325320000000004); tmpLen=Monroeville.length; Monroeville[tmpLen] = createMarker(tmpLatLng,"
Alabama Southern Community College
2800 South Alabama Avenue
Monroeville, AL 36460

[ View School Profile ]
",iconGr); Monroeville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Alabama Southern Community College",'Monroeville=' + Monroeville.length); tmpLatLng=new GLatLng(33.74596100000000120,-87.0494379999999949); tmpLen=Jasper.length; Jasper[tmpLen] = createMarker(tmpLatLng,"
Bevill State Community College
1411 Indiana Avenue
Jasper, AL 35501

[ View School Profile ]
",iconGr); Jasper[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Bevill State Community College",'Jasper=' + Jasper.length); tmpLatLng=new GLatLng(30.69386499999999884,-88.0557840000000027); tmpLen=Mobile.length; Mobile[tmpLen] = createMarker(tmpLatLng,"
Bishop State Community College
351 North Broad Street
Mobile, AL 36603

[ View School Profile ]
",iconGr); Mobile[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Bishop State Community College",'Mobile=' + Mobile.length); tmpLatLng=new GLatLng(32.93184200000000316,-85.9493899999999939); tmpLen=Alexander_City.length; Alexander_City[tmpLen] = createMarker(tmpLatLng,"
Central Alabama Community College
1675 Cherokee Rd
Alexander City, AL 35010

[ View School Profile ]
",iconGr); Alexander_City[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Central Alabama Community College",'Alexander_City=' + Alexander_City.length); tmpLatLng=new GLatLng(32.42706799999999844,-85.0294370000000014); tmpLen=Phenix_City.length; Phenix_City[tmpLen] = createMarker(tmpLatLng,"
Chattahoochee Valley Community College
2602 College Dr
Phenix City, AL 36869

[ View School Profile ]
",iconGr); Phenix_City[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Chattahoochee Valley Community College",'Phenix_City=' + Phenix_City.length); tmpLatLng=new GLatLng(32.37993800000000277,-86.3477539999999947); tmpLen=Montgomery.length; Montgomery[tmpLen] = createMarker(tmpLatLng,"
Community College Of Air Force
130 W Maxwell Blvd
Montgomery, AL 36112

[ View School Profile ]
",iconGr); Montgomery[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Community College Of Air Force",'Montgomery=' + Montgomery.length); tmpLatLng=new GLatLng(31.30045700000000152,-85.8356529999999935); tmpLen=Enterprise.length; Enterprise[tmpLen] = createMarker(tmpLatLng,"
Enterprise-ozark Community College
600 Plaza Dr
Enterprise, AL 36330

[ View School Profile ]
",iconGr); Enterprise[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Enterprise-ozark Community College",'Enterprise=' + Enterprise.length); tmpLatLng=new GLatLng(33.99529700000000076,-85.9900710000000003); tmpLen=Gadsden.length; Gadsden[tmpLen] = createMarker(tmpLatLng,"
Gadsden State Community College
1001 George Wallace Dr
Gadsden, AL 35902

[ View School Profile ]
",iconGr); Gadsden[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Gadsden State Community College",'Gadsden=' + Gadsden.length); tmpLatLng=new GLatLng(33.62410400000000265,-85.8032639999999986); tmpLen=Anniston.length; Anniston[tmpLen] = createMarker(tmpLatLng,"
Gadsden State Community College-ayers Campus
1801 Coleman Road
Anniston, AL 36207

[ View School Profile ]
",iconGr); Anniston[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Gadsden State Community College-ayers Campus",'Anniston=' + Anniston.length); tmpLatLng=new GLatLng(31.32356199999999901,-85.4888370000000037); tmpLen=Dothan.length; Dothan[tmpLen] = createMarker(tmpLatLng,"
George C Wallace Community College-dothan
1141 Wallace Drive
Dothan, AL 36303

[ View School Profile ]
",iconGr); Dothan[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("George C Wallace Community College-dothan",'Dothan=' + Dothan.length); tmpLatLng=new GLatLng(34.07353700000000174,-86.7788869999999974); tmpLen=Hanceville.length; Hanceville[tmpLen] = createMarker(tmpLatLng,"
George C Wallace State Community College-hancevill
801 Main St Nw
Hanceville, AL 35077

[ View School Profile ]
",iconGr); Hanceville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("George C Wallace State Community College-hancevill",'Hanceville=' + Hanceville.length); tmpLatLng=new GLatLng(32.44398699999999991,-87.0145349999999950); tmpLen=Selma.length; Selma[tmpLen] = createMarker(tmpLatLng,"
George C Wallace State Community College-selma
3000 Earl Goodwin Parkway
Selma, AL 36703

[ View School Profile ]
",iconGr); Selma[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("George C Wallace State Community College-selma",'Selma=' + Selma.length); tmpLatLng=new GLatLng(32.34796099999999796,-86.3415379999999998); tmpLen=Montgomery.length; Montgomery[tmpLen] = createMarker(tmpLatLng,"
H Councill Trenholm State Technical College
1225 Air Base Blvd
Montgomery, AL 36108

[ View School Profile ]
",iconGr); Montgomery[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("H Councill Trenholm State Technical College",'Montgomery=' + Montgomery.length); tmpLatLng=new GLatLng(32.32720599999999677,-86.2409329999999982); tmpLen=Montgomery.length; Montgomery[tmpLen] = createMarker(tmpLatLng,"
H Councill Trenholm State Technical College-patter
3920 Troy Hwy
Montgomery, AL 36116

[ View School Profile ]
",iconGr); Montgomery[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("H Councill Trenholm State Technical College-patter",'Montgomery=' + Montgomery.length); tmpLatLng=new GLatLng(33.46950799999999759,-86.8265980000000041); tmpLen=Birmingham.length; Birmingham[tmpLen] = createMarker(tmpLatLng,"
Herzing College
280 West Valley Ave
Birmingham, AL 35209

[ View School Profile ]
",iconGr); Birmingham[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Herzing College",'Birmingham=' + Birmingham.length); tmpLatLng=new GLatLng(33.42706299999999686,-86.7012150000000048); tmpLen=Bessemer.length; Bessemer[tmpLen] = createMarker(tmpLatLng,"
Itt Technical Institute-bessemer
6270 Park South Drive
Bessemer, AL 35022

[ View School Profile ]
",iconRd); Bessemer[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Itt Technical Institute-bessemer",'Bessemer=' + Bessemer.length); tmpLatLng=new GLatLng(34.77021299999999826,-86.5724819999999937); tmpLen=Huntsville.length; Huntsville[tmpLen] = createMarker(tmpLatLng,"
J F Drake State Technical College
3421 Meridian St N
Huntsville, AL 35811

[ View School Profile ]
",iconGr); Huntsville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("J F Drake State Technical College",'Huntsville=' + Huntsville.length); tmpLatLng=new GLatLng(32.58229899999999901,-86.3910879999999963); tmpLen=Deatsville.length; Deatsville[tmpLen] = createMarker(tmpLatLng,"
J F Ingram State Technical College
5375 Ingram Rd
Deatsville, AL 36022

[ View School Profile ]
",iconGr); Deatsville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("J F Ingram State Technical College",'Deatsville=' + Deatsville.length); tmpLatLng=new GLatLng(30.85091999999999856,-87.7765830000000022); tmpLen=Bay_Minette.length; Bay_Minette[tmpLen] = createMarker(tmpLatLng,"
James H Faulkner State Community College
1900 Us Hwy 31 S
Bay Minette, AL 36507

[ View School Profile ]
",iconGr); Bay_Minette[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("James H Faulkner State Community College",'Bay_Minette=' + Bay_Minette.length); tmpLatLng=new GLatLng(31.10068100000000157,-87.0846399999999931); tmpLen=Brewton.length; Brewton[tmpLen] = createMarker(tmpLatLng,"
Jefferson Davis Community College
220 Alco Dr
Brewton, AL 36426

[ View School Profile ]
",iconGr); Brewton[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Jefferson Davis Community College",'Brewton=' + Brewton.length); tmpLatLng=new GLatLng(33.64780199999999865,-86.7098890000000039); tmpLen=Birmingham.length; Birmingham[tmpLen] = createMarker(tmpLatLng,"
Jefferson State Community College
2601 Carson Rd
Birmingham, AL 35215

[ View School Profile ]
",iconGr); Birmingham[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Jefferson State Community College",'Birmingham=' + Birmingham.length); tmpLatLng=new GLatLng(34.73140000000000071,-86.9700090000000045); tmpLen=Tanner.length; Tanner[tmpLen] = createMarker(tmpLatLng,"
John C Calhoun State Community College
6250 U S Highway 31 N
Tanner, AL 35671

[ View School Profile ]
",iconGr); Tanner[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("John C Calhoun State Community College",'Tanner=' + Tanner.length); tmpLatLng=new GLatLng(33.36872400000000027,-86.9943200000000018); tmpLen=Bessemer.length; Bessemer[tmpLen] = createMarker(tmpLatLng,"
Lawson State Community College-bessemer Campus
1100 9th Ave Sw
Bessemer, AL 35022

[ View School Profile ]
",iconGr); Bessemer[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Lawson State Community College-bessemer Campus",'Bessemer=' + Bessemer.length); tmpLatLng=new GLatLng(33.44910699999999792,-86.8890909999999934); tmpLen=Birmingham.length; Birmingham[tmpLen] = createMarker(tmpLatLng,"
Lawson State Community College-birmingham Campus
3060 Wilson Rd Sw
Birmingham, AL 35221

[ View School Profile ]
",iconGr); Birmingham[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Lawson State Community College-birmingham Campus",'Birmingham=' + Birmingham.length); tmpLatLng=new GLatLng(31.32295200000000079,-86.4520480000000048); tmpLen=Andalusia.length; Andalusia[tmpLen] = createMarker(tmpLatLng,"
Lurleen B Wallace Community College
1000 Dannelly Blvd.
Andalusia, AL 36420

[ View School Profile ]
",iconGr); Andalusia[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Lurleen B Wallace Community College",'Andalusia=' + Andalusia.length); tmpLatLng=new GLatLng(31.28489400000000131,-86.2553750000000007); tmpLen=Opp.length; Opp[tmpLen] = createMarker(tmpLatLng,"
Lurleen B Wallace Community College-macarthur Camp
1708 N Main St
Opp, AL 36467

[ View School Profile ]
",iconGr); Opp[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Lurleen B Wallace Community College-macarthur Camp",'Opp=' + Opp.length); tmpLatLng=new GLatLng(32.62258899999999783,-87.3182110000000051); tmpLen=Marion.length; Marion[tmpLen] = createMarker(tmpLatLng,"
Marion Military Institute
1101 Washington St
Marion, AL 36756

[ View School Profile ]
",iconGr); Marion[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Marion Military Institute",'Marion=' + Marion.length); tmpLatLng=new GLatLng(34.49406100000000208,-85.8473659999999938); tmpLen=Rainsville.length; Rainsville[tmpLen] = createMarker(tmpLatLng,"
Northeast Alabama Community College
Hwy 35
Rainsville, AL 35986

[ View School Profile ]
",iconGr); Rainsville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Northeast Alabama Community College",'Rainsville=' + Rainsville.length); tmpLatLng=new GLatLng(34.73968899999999848,-87.6794289999999989); tmpLen=Muscle_Shoals.length; Muscle_Shoals[tmpLen] = createMarker(tmpLatLng,"
Northwest Shoals Community College-muscle Shoals
800 George Wallace Blvd
Muscle Shoals, AL 35661

[ View School Profile ]
",iconGr); Muscle_Shoals[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Northwest Shoals Community College-muscle Shoals",'Muscle_Shoals=' + Muscle_Shoals.length); tmpLatLng=new GLatLng(32.36847900000000066,-86.1277379999999936); tmpLen=Montgomery.length; Montgomery[tmpLen] = createMarker(tmpLatLng,"
Prince Institute Of Professional Studies Inc
7735 Atlanta Hwy
Montgomery, AL 36117

[ View School Profile ]
",iconRd); Montgomery[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Prince Institute Of Professional Studies Inc",'Montgomery=' + Montgomery.length); tmpLatLng=new GLatLng(31.45755000000000123,-86.9654500000000041); tmpLen=Evergreen.length; Evergreen[tmpLen] = createMarker(tmpLatLng,"
Reid State Technical College
I65 And Hwy 83
Evergreen, AL 36401

[ View School Profile ]
",iconGr); Evergreen[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Reid State Technical College",'Evergreen=' + Evergreen.length); tmpLatLng=new GLatLng(30.67276199999999875,-88.1440280000000058); tmpLen=Mobile.length; Mobile[tmpLen] = createMarker(tmpLatLng,"
Remington College-mobile Campus
828 Downtowner Loop W
Mobile, AL 36609

[ View School Profile ]
",iconRd); Mobile[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Remington College-mobile Campus",'Mobile=' + Mobile.length); tmpLatLng=new GLatLng(33.12763000000000346,-87.5536730000000034); tmpLen=Tuscaloosa.length; Tuscaloosa[tmpLen] = createMarker(tmpLatLng,"
Shelton State Community College
9500 Old Greensboro Rd
Tuscaloosa, AL 35405

[ View School Profile ]
",iconGr); Tuscaloosa[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Shelton State Community College",'Tuscaloosa=' + Tuscaloosa.length); tmpLatLng=new GLatLng(34.20156800000000174,-86.1682349999999956); tmpLen=Boaz.length; Boaz[tmpLen] = createMarker(tmpLatLng,"
Snead State Community College
220 North Walnut Street
Boaz, AL 35957

[ View School Profile ]
",iconGr); Boaz[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Snead State Community College",'Boaz=' + Boaz.length); tmpLatLng=new GLatLng(32.34200100000000333,-86.2171589999999952); tmpLen=Montgomery.length; Montgomery[tmpLen] = createMarker(tmpLatLng,"
South University-montgomery
5355 Vaughn Road
Montgomery, AL 36116

[ View School Profile ]
",iconRd); Montgomery[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("South University-montgomery",'Montgomery=' + Montgomery.length); tmpLatLng=new GLatLng(33.12662300000000215,-85.5711770000000058); tmpLen=Wadley.length; Wadley[tmpLen] = createMarker(tmpLatLng,"
Southern Union State Community College
750 Roberts St
Wadley, AL 36276

[ View School Profile ]
",iconGr); Wadley[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Southern Union State Community College",'Wadley=' + Wadley.length); tmpLatLng=new GLatLng(33.47080199999999905,-86.8294489999999967); tmpLen=Birmingham.length; Birmingham[tmpLen] = createMarker(tmpLatLng,"
Virginia College-birmingham
65 Bagby Dr
Birmingham, AL 35209

[ View School Profile ]
",iconRd); Birmingham[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Virginia College-birmingham",'Birmingham=' + Birmingham.length); tmpLatLng=new GLatLng(34.71129100000000278,-86.6028799999999989); tmpLen=Huntsville.length; Huntsville[tmpLen] = createMarker(tmpLatLng,"
Virginia College-huntsville
2800 Bob Wallace Ave
Huntsville, AL 35805

[ View School Profile ]
",iconRd); Huntsville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Virginia College-huntsville",'Huntsville=' + Huntsville.length); map.removeOverlays(Alexander_City); map.removeOverlays(Andalusia); map.removeOverlays(Anniston); map.removeOverlays(Bay_Minette); map.removeOverlays(Bessemer); map.removeOverlays(Birmingham); map.removeOverlays(Boaz); map.removeOverlays(Brewton); map.removeOverlays(Deatsville); map.removeOverlays(Dothan); map.removeOverlays(Enterprise); map.removeOverlays(Evergreen); map.removeOverlays(Gadsden); map.removeOverlays(Hanceville); map.removeOverlays(Huntsville); map.removeOverlays(Jasper); map.removeOverlays(Marion); map.removeOverlays(Mobile); map.removeOverlays(Monroeville); map.removeOverlays(Montgomery); map.removeOverlays(Muscle_Shoals); map.removeOverlays(Opp); map.removeOverlays(Phenix_City); map.removeOverlays(Rainsville); map.removeOverlays(Selma); map.removeOverlays(Tanner); map.removeOverlays(Tuscaloosa); map.removeOverlays(Wadley); setTimeout(function(){map.addOverlays(Alexander_City)},1000); setTimeout(function(){map.addOverlays(Andalusia)},1000); setTimeout(function(){map.addOverlays(Anniston)},1000); setTimeout(function(){map.addOverlays(Bay_Minette)},1000); setTimeout(function(){map.addOverlays(Bessemer)},1000); setTimeout(function(){map.addOverlays(Birmingham)},1000); setTimeout(function(){map.addOverlays(Boaz)},1000); setTimeout(function(){map.addOverlays(Brewton)},1000); setTimeout(function(){map.addOverlays(Deatsville)},1000); setTimeout(function(){map.addOverlays(Dothan)},1000); setTimeout(function(){map.addOverlays(Enterprise)},1000); setTimeout(function(){map.addOverlays(Evergreen)},1000); setTimeout(function(){map.addOverlays(Gadsden)},1000); setTimeout(function(){map.addOverlays(Hanceville)},1000); setTimeout(function(){map.addOverlays(Huntsville)},1000); setTimeout(function(){map.addOverlays(Jasper)},1000); setTimeout(function(){map.addOverlays(Marion)},1000); setTimeout(function(){map.addOverlays(Mobile)},1000); setTimeout(function(){map.addOverlays(Monroeville)},1000); setTimeout(function(){map.addOverlays(Montgomery)},1000); setTimeout(function(){map.addOverlays(Muscle_Shoals)},1000); setTimeout(function(){map.addOverlays(Opp)},1000); setTimeout(function(){map.addOverlays(Phenix_City)},1000); setTimeout(function(){map.addOverlays(Rainsville)},1000); setTimeout(function(){map.addOverlays(Selma)},1000); setTimeout(function(){map.addOverlays(Tanner)},1000); setTimeout(function(){map.addOverlays(Tuscaloosa)},1000); setTimeout(function(){map.addOverlays(Wadley)},1000); getPoly("","state","","AL");} // End addStateMarkers JavaScript Function //open all when map is defined function openAll() { if (map) { selectChange("all"); } else { setTimeout("openAll()",200); } } // Takes an array of markers and centers/zooms map based on marker range function centerByArray(myArray, recenter, newMaxMin){ if (newMaxMin == true) reMaxMin(myArray); for (var i = 0; i < myArray.length; i++){ var markLng = myArray[i].point.x; var markLat = myArray[i].point.y; if (markLat > maxLat) maxLat = markLat; if (markLng > maxLng) maxLng = markLng; if (markLat < minLat) minLat = markLat; if (markLng < minLng) minLng = markLng; } if (recenter) reCenterMap(); } // Reinit max/mins function reMaxMin(myArray){ maxLng = myArray[0].point.x; maxLat = myArray[0].point.y; minLng = myArray[0].point.x; minLat = myArray[0].point.y; } // Recenter map based on global max/mins function reCenterMap(){ //alert('#' + minLat + '#' + minLng + '#' + maxLat + '#' + maxLng); var bounds = new GLatLngBounds(); bounds.extend(new GLatLng(minLat, minLng)); bounds.extend(new GLatLng(maxLat, maxLng)); var center_lat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) / 2.0; var center_lng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) / 2.0; var center = new GLatLng(center_lat, center_lng); var zoom = map.getBoundsZoomLevel(bounds); map.setCenter(center,zoom); //map.setCenter(center,10); /* var center = new GPoint( (maxLng + minLng)/2, (maxLat+minLat)/2 ); var delta = new GSize(maxLng - minLng, maxLat - minLat); var minZoom = map.spec.getLowestZoomLevel(center, delta, map.viewSize); if (minZoom < 4) minZoom = 4; // Lowest possible zoom is 4 map.centerAndZoom(center, minZoom); */ } // Fires when drop down list of schools changes function selectChange(selection) { if (selection.options) { var _openNewWindow=true; var myVal = selection.options[selection.selectedIndex].value; } else { var _openNewWindow=false; var myVal=selection; } map.closeInfoWindow(); // Add entire array based on variable type if (myVal.indexOf('all') != -1 && myVal != 'all'){ var temp = myVal.split('='); var showArray = temp[1]; // If Array is > X amount of markers, then open in a new page if (eval(showArray).length > 20) // New window depends on whether or not we're on the search page if (location.href.indexOf('schools-by-distance') == -1) window.open(location.href + '/map/all'); else window.open('/search////all'); map.removeOverlays(Alexander_City); map.removeOverlays(Andalusia); map.removeOverlays(Anniston); map.removeOverlays(Bay_Minette); map.removeOverlays(Bessemer); map.removeOverlays(Birmingham); map.removeOverlays(Boaz); map.removeOverlays(Brewton); map.removeOverlays(Deatsville); map.removeOverlays(Dothan); map.removeOverlays(Enterprise); map.removeOverlays(Evergreen); map.removeOverlays(Gadsden); map.removeOverlays(Hanceville); map.removeOverlays(Huntsville); map.removeOverlays(Jasper); map.removeOverlays(Marion); map.removeOverlays(Mobile); map.removeOverlays(Monroeville); map.removeOverlays(Montgomery); map.removeOverlays(Muscle_Shoals); map.removeOverlays(Opp); map.removeOverlays(Phenix_City); map.removeOverlays(Rainsville); map.removeOverlays(Selma); map.removeOverlays(Tanner); map.removeOverlays(Tuscaloosa); map.removeOverlays(Wadley); map.addOverlays(eval(showArray)); centerByArray(eval(showArray), true, true); // Center and zoom on set of markers } // Add individual markers if (myVal.indexOf('all') == -1 && myVal != 'all' && myVal.length) { var temp = myVal.split('='); var myArray = temp[0]; var myIndex = parseInt(temp[1]) - 1; document.getElementById('map').width = "750"; map.removeOverlay(eval(myArray)[myIndex]); map.addOverlay(eval(myArray)[myIndex]); GEvent.trigger(eval(myArray)[myIndex],'click'); } // Show all markers if (myVal == 'all') { cntMarker = 0; reMaxMin(Monroeville);map.removeOverlays(Alexander_City); map.removeOverlays(Andalusia); map.removeOverlays(Anniston); map.removeOverlays(Bay_Minette); map.removeOverlays(Bessemer); map.removeOverlays(Birmingham); map.removeOverlays(Boaz); map.removeOverlays(Brewton); map.removeOverlays(Deatsville); map.removeOverlays(Dothan); map.removeOverlays(Enterprise); map.removeOverlays(Evergreen); map.removeOverlays(Gadsden); map.removeOverlays(Hanceville); map.removeOverlays(Huntsville); map.removeOverlays(Jasper); map.removeOverlays(Marion); map.removeOverlays(Mobile); map.removeOverlays(Monroeville); map.removeOverlays(Montgomery); map.removeOverlays(Muscle_Shoals); map.removeOverlays(Opp); map.removeOverlays(Phenix_City); map.removeOverlays(Rainsville); map.removeOverlays(Selma); map.removeOverlays(Tanner); map.removeOverlays(Tuscaloosa); map.removeOverlays(Wadley); map.addOverlays(Alexander_City); centerByArray(Alexander_City, false, false); cntMarker += Alexander_City.length; map.addOverlays(Andalusia); centerByArray(Andalusia, false, false); cntMarker += Andalusia.length; map.addOverlays(Anniston); centerByArray(Anniston, false, false); cntMarker += Anniston.length; map.addOverlays(Bay_Minette); centerByArray(Bay_Minette, false, false); cntMarker += Bay_Minette.length; map.addOverlays(Bessemer); centerByArray(Bessemer, false, false); cntMarker += Bessemer.length; map.addOverlays(Birmingham); centerByArray(Birmingham, false, false); cntMarker += Birmingham.length; map.addOverlays(Boaz); centerByArray(Boaz, false, false); cntMarker += Boaz.length; map.addOverlays(Brewton); centerByArray(Brewton, false, false); cntMarker += Brewton.length; map.addOverlays(Deatsville); centerByArray(Deatsville, false, false); cntMarker += Deatsville.length; map.addOverlays(Dothan); centerByArray(Dothan, false, false); cntMarker += Dothan.length; map.addOverlays(Enterprise); centerByArray(Enterprise, false, false); cntMarker += Enterprise.length; map.addOverlays(Evergreen); centerByArray(Evergreen, false, false); cntMarker += Evergreen.length; map.addOverlays(Gadsden); centerByArray(Gadsden, false, false); cntMarker += Gadsden.length; map.addOverlays(Hanceville); centerByArray(Hanceville, false, false); cntMarker += Hanceville.length; map.addOverlays(Huntsville); centerByArray(Huntsville, false, false); cntMarker += Huntsville.length; map.addOverlays(Jasper); centerByArray(Jasper, false, false); cntMarker += Jasper.length; map.addOverlays(Marion); centerByArray(Marion, false, false); cntMarker += Marion.length; map.addOverlays(Mobile); centerByArray(Mobile, false, false); cntMarker += Mobile.length; map.addOverlays(Monroeville); centerByArray(Monroeville, false, false); cntMarker += Monroeville.length; map.addOverlays(Montgomery); centerByArray(Montgomery, false, false); cntMarker += Montgomery.length; map.addOverlays(Muscle_Shoals); centerByArray(Muscle_Shoals, false, false); cntMarker += Muscle_Shoals.length; map.addOverlays(Opp); centerByArray(Opp, false, false); cntMarker += Opp.length; map.addOverlays(Phenix_City); centerByArray(Phenix_City, false, false); cntMarker += Phenix_City.length; map.addOverlays(Rainsville); centerByArray(Rainsville, false, false); cntMarker += Rainsville.length; map.addOverlays(Selma); centerByArray(Selma, false, false); cntMarker += Selma.length; map.addOverlays(Tanner); centerByArray(Tanner, false, false); cntMarker += Tanner.length; map.addOverlays(Tuscaloosa); centerByArray(Tuscaloosa, false, false); cntMarker += Tuscaloosa.length; map.addOverlays(Wadley); centerByArray(Wadley, false, false); cntMarker += Wadley.length; reCenterMap(); //if (cntMarker > 20) // New window depends on whether or not we're on the search page if (location.href.indexOf('schools-by-distance') == -1) window.open(location.href + '/map/all'); else window.open('/search////all'); } } function createMarker(point, label, icon){ var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }