function addMarkers(){ mySelect = document.getElementById('selection'); Atlanta = [];Gainesville = [];Roswell = [];Augusta = [];Macon = [];Marietta = [];Decatur = [];Senoia = [];Rabun_Gap = [];Tallulah_Falls = [];Perry = [];College_Park = [];mySelect.options[mySelect.options.length] = new Option("Atlanta schools",'all=Atlanta'); mySelect.options[mySelect.options.length] = new Option("Augusta schools",'all=Augusta'); mySelect.options[mySelect.options.length] = new Option("College Park schools",'all=College_Park'); mySelect.options[mySelect.options.length] = new Option("Decatur schools",'all=Decatur'); mySelect.options[mySelect.options.length] = new Option("Gainesville schools",'all=Gainesville'); mySelect.options[mySelect.options.length] = new Option("Macon schools",'all=Macon'); mySelect.options[mySelect.options.length] = new Option("Marietta schools",'all=Marietta'); mySelect.options[mySelect.options.length] = new Option("Perry schools",'all=Perry'); mySelect.options[mySelect.options.length] = new Option("Rabun Gap schools",'all=Rabun_Gap'); mySelect.options[mySelect.options.length] = new Option("Roswell schools",'all=Roswell'); mySelect.options[mySelect.options.length] = new Option("Senoia schools",'all=Senoia'); mySelect.options[mySelect.options.length] = new Option("Tallulah Falls schools",'all=Tallulah_Falls'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Atlanta[Atlanta.length] = createMarker(new GPoint(-84.42629700,33.84496000),"
Atlanta Girls' School
3254 Northside Parkway NW
Atlanta, GA 30327
All-girls school, 6-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Atlanta Girls' School",'Atlanta=' + Atlanta.length); Atlanta[Atlanta.length] = createMarker(new GPoint(-84.30255900,33.98375500),"
Brandon Hall School
1701 Brandon Hall Drive
Atlanta, GA 30350
Co-ed school, 4-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brandon Hall School",'Atlanta=' + Atlanta.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-83.86276000,34.26094000),"
Brenau Academy
500 Washington Street Se
Gainesville, GA 30501
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brenau Academy",'Gainesville=' + Gainesville.length); Roswell[Roswell.length] = createMarker(new GPoint(-84.31352800,34.01839100),"
Brimarsh Academy
1565 Holcomb Bridge Rd
Roswell, GA 30076
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brimarsh Academy",'Roswell=' + Roswell.length); Atlanta[Atlanta.length] = createMarker(new GPoint(-84.38587400,33.76439300),"
Canterbury School
360 Peachtree St NE
Atlanta, GA 30308
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Canterbury School",'Atlanta=' + Atlanta.length); Augusta[Augusta.length] = createMarker(new GPoint(-82.00772100,33.48985500),"
Curtis Baptist School (pk-12)
2230 Broad St
Augusta, GA 30901
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Curtis Baptist School (pk-12)",'Augusta=' + Augusta.length); Augusta[Augusta.length] = createMarker(new GPoint(-82.00738200,33.45392000),"
Ebenezer Sda School
1699 Olive Road
Augusta, GA 30604
Co-ed school, 1-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ebenezer Sda School",'Augusta=' + Augusta.length); Macon[Macon.length] = createMarker(new GPoint(-83.66633900,32.80623700),"
Ernest Saloom Academy
1441 Williamson Rd
Macon, GA 31206
Co-ed school, 8-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ernest Saloom Academy",'Macon=' + Macon.length); Marietta[Marietta.length] = createMarker(new GPoint(-84.52776000,34.01081900),"
Lafayette Academy
2417 Canton Rd
Marietta, GA 30066
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lafayette Academy",'Marietta=' + Marietta.length); Decatur[Decatur.length] = createMarker(new GPoint(-84.29246300,33.76051800),"
Lullwater School Inc
705 South Candler Street
Decatur, GA 30030
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lullwater School Inc",'Decatur=' + Decatur.length); Senoia[Senoia.length] = createMarker(new GPoint(-84.58830300,33.29721900),"
Peachtree Baptist Academy
6675 Highway 16
Senoia, GA 30276
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Peachtree Baptist Academy",'Senoia=' + Senoia.length); Rabun_Gap[Rabun_Gap.length] = createMarker(new GPoint(-83.39088800,34.96181200),"
Rabun-Gap Nacoochee School
339 Nacoochee Drive
Rabun Gap, GA 30568
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rabun-Gap Nacoochee School",'Rabun_Gap=' + Rabun_Gap.length); Tallulah_Falls[Tallulah_Falls.length] = createMarker(new GPoint(-83.39083900,34.72804000),"
Tallulah Falls School
PO Box 249
Tallulah Falls, GA 30573
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tallulah Falls School",'Tallulah_Falls=' + Tallulah_Falls.length); Atlanta[Atlanta.length] = createMarker(new GPoint(-84.44761100,33.86422800),"
Trinity School, Inc
4301 Northside Pkwy Nw
Atlanta, GA 30327
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity School, Inc",'Atlanta=' + Atlanta.length); Perry[Perry.length] = createMarker(new GPoint(-83.73120000,32.46300000),"
The Westfield Schools
Po Box 2300
Perry, GA 31069
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Westfield Schools",'Perry=' + Perry.length); Augusta[Augusta.length] = createMarker(new GPoint(-82.04377100,33.48863300),"
Westminster Schools Of Augusta
3067 Wheeler Road
Augusta, GA 30909
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westminster Schools Of Augusta",'Augusta=' + Augusta.length); College_Park[College_Park.length] = createMarker(new GPoint(-84.44334900,33.66266300),"
Woodward Academy
1662 Rugby Avenue
College Park, GA 30337
Co-ed school, -
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodward Academy",'College_Park=' + College_Park.length); Macon[Macon.length] = createMarker(new GPoint(-83.70723600,32.80293500),"
World Of Faith Christian Academy
5028 Bloomfield Road
Macon, GA 31206
Co-ed school, -
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("World Of Faith Christian Academy",'Macon=' + Macon.length); map.removeOverlays(Atlanta); map.removeOverlays(Augusta); map.removeOverlays(College_Park); map.removeOverlays(Decatur); map.removeOverlays(Gainesville); map.removeOverlays(Macon); map.removeOverlays(Marietta); map.removeOverlays(Perry); map.removeOverlays(Rabun_Gap); map.removeOverlays(Roswell); map.removeOverlays(Senoia); map.removeOverlays(Tallulah_Falls); setTimeout(function(){map.addOverlays(Atlanta)},1000); setTimeout(function(){map.addOverlays(Augusta)},1000); setTimeout(function(){map.addOverlays(College_Park)},1000); setTimeout(function(){map.addOverlays(Decatur)},1000); setTimeout(function(){map.addOverlays(Gainesville)},1000); setTimeout(function(){map.addOverlays(Macon)},1000); setTimeout(function(){map.addOverlays(Marietta)},1000); setTimeout(function(){map.addOverlays(Perry)},1000); setTimeout(function(){map.addOverlays(Rabun_Gap)},1000); setTimeout(function(){map.addOverlays(Roswell)},1000); setTimeout(function(){map.addOverlays(Senoia)},1000); setTimeout(function(){map.addOverlays(Tallulah_Falls)},1000); maxLng = -82.00738200; maxLat = 34.96181200; minLng = -84.58830300; minLat = 32.46300000; reCenterMap(); } // 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//////' + showArray); map.removeOverlays(Atlanta); map.removeOverlays(Augusta); map.removeOverlays(College_Park); map.removeOverlays(Decatur); map.removeOverlays(Gainesville); map.removeOverlays(Macon); map.removeOverlays(Marietta); map.removeOverlays(Perry); map.removeOverlays(Rabun_Gap); map.removeOverlays(Roswell); map.removeOverlays(Senoia); map.removeOverlays(Tallulah_Falls); 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(Atlanta);map.removeOverlays(Atlanta); map.removeOverlays(Augusta); map.removeOverlays(College_Park); map.removeOverlays(Decatur); map.removeOverlays(Gainesville); map.removeOverlays(Macon); map.removeOverlays(Marietta); map.removeOverlays(Perry); map.removeOverlays(Rabun_Gap); map.removeOverlays(Roswell); map.removeOverlays(Senoia); map.removeOverlays(Tallulah_Falls); map.addOverlays(Atlanta); centerByArray(Atlanta, false, false); cntMarker += Atlanta.length; map.addOverlays(Augusta); centerByArray(Augusta, false, false); cntMarker += Augusta.length; map.addOverlays(College_Park); centerByArray(College_Park, false, false); cntMarker += College_Park.length; map.addOverlays(Decatur); centerByArray(Decatur, false, false); cntMarker += Decatur.length; map.addOverlays(Gainesville); centerByArray(Gainesville, false, false); cntMarker += Gainesville.length; map.addOverlays(Macon); centerByArray(Macon, false, false); cntMarker += Macon.length; map.addOverlays(Marietta); centerByArray(Marietta, false, false); cntMarker += Marietta.length; map.addOverlays(Perry); centerByArray(Perry, false, false); cntMarker += Perry.length; map.addOverlays(Rabun_Gap); centerByArray(Rabun_Gap, false, false); cntMarker += Rabun_Gap.length; map.addOverlays(Roswell); centerByArray(Roswell, false, false); cntMarker += Roswell.length; map.addOverlays(Senoia); centerByArray(Senoia, false, false); cntMarker += Senoia.length; map.addOverlays(Tallulah_Falls); centerByArray(Tallulah_Falls, false, false); cntMarker += Tallulah_Falls.length; centerByArray(Atlanta,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///7541,7570,7648,8043,7571,7679,7779,8039,7906,7984,7541,7570,7591,8018,7648,7672,8043,8054,7807,8057,7779,8039,7906,7576,7885,/all'); //window.open('/map.php?type=2&schools=7541,7570,7648,8043,7571,7679,7779,8039,7906,7984,7541,7570,7591,8018,7648,7672,8043,8054,7807,8057,7779,8039,7906,7576,7885,&school_level=&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; }