function addMarkers(){ mySelect = document.getElementById('selection'); Birmingham = [];Bessemer = [];Concord = [];Hueytown = [];Rock_Creek = [];Hoover = [];Fairfield = [];Gardendale = [];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("Concord schools",'all=Concord'); mySelect.options[mySelect.options.length] = new Option("Fairfield schools",'all=Fairfield'); mySelect.options[mySelect.options.length] = new Option("Gardendale schools",'all=Gardendale'); mySelect.options[mySelect.options.length] = new Option("Hoover schools",'all=Hoover'); mySelect.options[mySelect.options.length] = new Option("Hueytown schools",'all=Hueytown'); mySelect.options[mySelect.options.length] = new Option("Rock Creek schools",'all=Rock_Creek'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.76044400,33.51348900),"
The Altamont School
4801 Altamont Road South
Birmingham, AL 35222
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Altamont School",'Birmingham=' + Birmingham.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.78837600,33.49964600),"
Arlington School
1312 22nd Street S
Birmingham, AL 35205
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Arlington School",'Birmingham=' + Birmingham.length); Bessemer[Bessemer.length] = createMarker(new GPoint(-86.99187300,33.35571200),"
Bessemer Academy
1705 4th Ave Sw
Bessemer, AL 35023
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bessemer Academy",'Bessemer=' + Bessemer.length); Bessemer[Bessemer.length] = createMarker(new GPoint(-86.96704700,33.36573800),"
Brentwood Christian Academy
831 Eastern Valley Road
Bessemer, AL 35020
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brentwood Christian Academy",'Bessemer=' + Bessemer.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.75993900,33.41589500),"
Briarwood Christian School
2204 Briarwood Way
Birmingham, AL 35243
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Briarwood Christian School",'Birmingham=' + Birmingham.length); Concord[Concord.length] = createMarker(new GPoint(-87.05733600,33.46468300),"
Calvary At Home Christian School
7570 15th Street Road
Concord, AL 35023
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary At Home Christian School",'Concord=' + Concord.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.88518700,33.49209400),"
Central Park Christian Schools
1900 43rd Street W
Birmingham, AL 35208
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Park Christian Schools",'Birmingham=' + Birmingham.length); Hueytown[Hueytown.length] = createMarker(new GPoint(-86.98580400,33.42388500),"
Deeper Life Academy & Daycare
2800 N. 19th St. North
Hueytown, AL 35023
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Deeper Life Academy & Daycare",'Hueytown=' + Hueytown.length); Bessemer[Bessemer.length] = createMarker(new GPoint(-87.01426300,33.34947900),"
Flint Hill Christian School
1630 Powder Plant Road
Bessemer, AL 35022
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Flint Hill Christian School",'Bessemer=' + Bessemer.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.88297700,33.57646800),"
Gloryland Christian Academy
1829 Circlewood Drive
Birmingham, AL 35214
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gloryland Christian Academy",'Birmingham=' + Birmingham.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.68666300,33.62649600),"
Good Samaritan Baptist School
1526 Huffman Road
Birmingham, AL 35215
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Good Samaritan Baptist School",'Birmingham=' + Birmingham.length); Rock_Creek[Rock_Creek.length] = createMarker(new GPoint(-87.08319000,33.48590500),"
Harvest Christian School
7303 Taylors Ferry Rd
Rock Creek, AL 35023
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harvest Christian School",'Rock_Creek=' + Rock_Creek.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.73053600,33.54910100),"
Higdon Hill School
6869 5th Avenue S
Birmingham, AL 35212
Co-ed school, 5-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Higdon Hill School",'Birmingham=' + Birmingham.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.88166900,33.51017100),"
Holy Family Catholic High School
2001 19th St Ensley
Birmingham, AL 35218
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Family Catholic High School",'Birmingham=' + Birmingham.length); Hoover[Hoover.length] = createMarker(new GPoint(-86.79522800,33.38879900),"
Hoover Christian School
2113 Old Rocky Ridge Rd.
Hoover, AL 35216
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hoover Christian School",'Hoover=' + Hoover.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.64569300,33.54885700),"
Jefferson Christian Academy
1500 Heritage Place Drive
Birmingham, AL 35210
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jefferson Christian Academy",'Birmingham=' + Birmingham.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.89370000,33.50720000),"
Jesus Christ Christian School
2820 Avenue E
Birmingham, AL 35218
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jesus Christ Christian School",'Birmingham=' + Birmingham.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.83209600,33.44239200),"
John Carroll Catholic High School
300 Lakeshore Parkway
Birmingham, AL 35209
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("John Carroll Catholic High School",'Birmingham=' + Birmingham.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.75640000,33.53750000),"
Maranathan Academy
Po Box 320321
Birmingham, AL 35232
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Maranathan Academy",'Birmingham=' + Birmingham.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.87636300,33.48845200),"
Miracle Deliverance Temple Learning Academy
28 S Park Road Sw
Birmingham, AL 35211
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Miracle Deliverance Temple Learning Academy",'Birmingham=' + Birmingham.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.63726700,33.65242200),"
Mountain View Baptist School
5568 Chalkville Road
Birmingham, AL 35235
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mountain View Baptist School",'Birmingham=' + Birmingham.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.68939900,33.60311800),"
Parkway Christian Academy
959 Huffman Road
Birmingham, AL 35215
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parkway Christian Academy",'Birmingham=' + Birmingham.length); Fairfield[Fairfield.length] = createMarker(new GPoint(-86.91402300,33.49164700),"
Restoration Academy
Po Box 714 4600 Carnegie Avenue
Fairfield, AL 35064
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Restoration Academy",'Fairfield=' + Fairfield.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.75627300,33.54925500),"
Rushton School
5201 Messer Airport Highway
Birmingham, AL 35212
Co-ed school, 6-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rushton School",'Birmingham=' + Birmingham.length); Hoover[Hoover.length] = createMarker(new GPoint(-86.83310700,33.41539900),"
Shades Mtn. Christian School
2290 Old Tyler Road
Hoover, AL 35226
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shades Mtn. Christian School",'Hoover=' + Hoover.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.74603300,33.50665000),"
Spring Valley School
Po Box 131431
Birmingham, AL 35213
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Spring Valley School",'Birmingham=' + Birmingham.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.80543500,33.50338700),"
The Sunshine School At Children's Hospital
1600 7th Avenue S
Birmingham, AL 35233
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Sunshine School At Children's Hospital",'Birmingham=' + Birmingham.length); Gardendale[Gardendale.length] = createMarker(new GPoint(-86.81947200,33.69048100),"
Tabernacle Christian School
2649 Decatur Highway
Gardendale, AL 35071
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tabernacle Christian School",'Gardendale=' + Gardendale.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.80450300,33.50504500),"
Uab Psychiatric Prog. Hosp. School
1713 6th Avenue S.
Birmingham, AL 35294
Co-ed school, 7-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Uab Psychiatric Prog. Hosp. School",'Birmingham=' + Birmingham.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.80543500,33.50338700),"
Vaughn School The
1600 7th Ave S Ste 500
Birmingham, AL 35226
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Vaughn School The",'Birmingham=' + Birmingham.length); Bessemer[Bessemer.length] = createMarker(new GPoint(-86.95180000,33.40730000),"
Victory Christian Academy
Po Box 171 3100 Dartmouth Avenue
Bessemer, AL 35020
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Victory Christian Academy",'Bessemer=' + Bessemer.length); Birmingham[Birmingham.length] = createMarker(new GPoint(-86.71431000,33.63139600),"
Winewood Christian School Inc
2974 Winewood Road
Birmingham, AL 35215
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Winewood Christian School Inc",'Birmingham=' + Birmingham.length); } // End addStateMarkers JavaScript Function // 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].getPoint().x; var markLat = myArray[i].getPoint().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].getPoint().x; maxLat = myArray[0].getPoint().y; minLng = myArray[0].getPoint().x; minLat = myArray[0].getPoint().y; } // Recenter map based on global max/mins function reCenterMap() { 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,11); /* 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) { var myVal = selection.options[selection.selectedIndex].value; 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('nearby_schools.php') == -1) window.open(location.href + '/map/' + showArray); else window.open('/search/////2/' + showArray); map.removeOverlays(Bessemer); map.removeOverlays(Birmingham); map.removeOverlays(Concord); map.removeOverlays(Fairfield); map.removeOverlays(Gardendale); map.removeOverlays(Hoover); map.removeOverlays(Hueytown); map.removeOverlays(Rock_Creek); 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(Birmingham);map.removeOverlays(Bessemer); map.removeOverlays(Birmingham); map.removeOverlays(Concord); map.removeOverlays(Fairfield); map.removeOverlays(Gardendale); map.removeOverlays(Hoover); map.removeOverlays(Hueytown); map.removeOverlays(Rock_Creek); map.addOverlays(Bessemer); centerByArray(Bessemer, false, false); cntMarker += Bessemer.length; map.addOverlays(Birmingham); centerByArray(Birmingham, false, false); cntMarker += Birmingham.length; map.addOverlays(Concord); centerByArray(Concord, false, false); cntMarker += Concord.length; map.addOverlays(Fairfield); centerByArray(Fairfield, false, false); cntMarker += Fairfield.length; map.addOverlays(Gardendale); centerByArray(Gardendale, false, false); cntMarker += Gardendale.length; map.addOverlays(Hoover); centerByArray(Hoover, false, false); cntMarker += Hoover.length; map.addOverlays(Hueytown); centerByArray(Hueytown, false, false); cntMarker += Hueytown.length; map.addOverlays(Rock_Creek); centerByArray(Rock_Creek, false, false); cntMarker += Rock_Creek.length; centerByArray(Birmingham,true, false); 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'); //window.open('/map.php?type=1&schools=&school_level=2&radius=&zipcode=&school_type_search=&school_type_code='); } } function createMarker(point, label, icon) { var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }