function addMarkers(){ mySelect = document.getElementById('selection'); Decatur = [];Marietta = [];Hinesville = [];Macon = [];Buford = [];Brunswick = [];Douglasville = [];Atlanta = [];Stone_Mountain = [];Powder_Springs = [];Duluth = [];Rabun_Gap = [];Statesboro = [];Saint_Simons_Island = [];mySelect.options[mySelect.options.length] = new Option("Atlanta schools",'all=Atlanta'); mySelect.options[mySelect.options.length] = new Option("Brunswick schools",'all=Brunswick'); mySelect.options[mySelect.options.length] = new Option("Buford schools",'all=Buford'); mySelect.options[mySelect.options.length] = new Option("Decatur schools",'all=Decatur'); mySelect.options[mySelect.options.length] = new Option("Douglasville schools",'all=Douglasville'); mySelect.options[mySelect.options.length] = new Option("Duluth schools",'all=Duluth'); mySelect.options[mySelect.options.length] = new Option("Hinesville schools",'all=Hinesville'); 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("Powder Springs schools",'all=Powder_Springs'); mySelect.options[mySelect.options.length] = new Option("Rabun Gap schools",'all=Rabun_Gap'); mySelect.options[mySelect.options.length] = new Option("Saint Simons Island schools",'all=Saint_Simons_Island'); mySelect.options[mySelect.options.length] = new Option("Statesboro schools",'all=Statesboro'); mySelect.options[mySelect.options.length] = new Option("Stone Mountain schools",'all=Stone_Mountain'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Decatur[Decatur.length] = createMarker(new GPoint(-84.29463900,33.77446300),"
Decatur Presbyterian Children's Community
205 Sycamore Street
Decatur, GA 30030
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Decatur Presbyterian Children's Community",'Decatur=' + Decatur.length); Marietta[Marietta.length] = createMarker(new GPoint(-84.41800800,33.98933400),"
East Cobb Christian School
4616 Roswell Road
Marietta, GA 30062
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Cobb Christian School",'Marietta=' + Marietta.length); Hinesville[Hinesville.length] = createMarker(new GPoint(-81.60014400,31.84861900),"
First Presbyterian Christian Academy
308 E Court St
Hinesville, GA 31313
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Presbyterian Christian Academy",'Hinesville=' + Hinesville.length); Macon[Macon.length] = createMarker(new GPoint(-83.74907500,32.87173000),"
First Presbyterian Day School
5671 Calvin Drive
Macon, GA 31210
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Presbyterian Day School",'Macon=' + Macon.length); Buford[Buford.length] = createMarker(new GPoint(-83.98139000,34.04951500),"
Geneva Christian Academy
1420 Rock Springs Road
Buford, GA 30519
Co-ed school, 8-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Geneva Christian Academy",'Buford=' + Buford.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-81.53182400,31.23053700),"
Goldengate Christian Academy
5608 New Jesup Highway
Brunswick, GA 31523
Co-ed school, 1-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Goldengate Christian Academy",'Brunswick=' + Brunswick.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.71684600,33.70002700),"
Harvester Christian Academy
4241 Central Church Road
Douglasville, GA 30135
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harvester Christian Academy",'Douglasville=' + Douglasville.length); Atlanta[Atlanta.length] = createMarker(new GPoint(-84.31806400,33.81526300),"
Intown Community School
2059 Lavista Road Ne
Atlanta, GA 30329
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Intown Community School",'Atlanta=' + Atlanta.length); Stone_Mountain[Stone_Mountain.length] = createMarker(new GPoint(-84.22549800,33.79601600),"
Memorial Drive Presbyterian Community Children's P
5140 Memorial Drive
Stone Mountain, GA 30083
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Memorial Drive Presbyterian Community Children's P",'Stone_Mountain=' + Stone_Mountain.length); Powder_Springs[Powder_Springs.length] = createMarker(new GPoint(-84.68803000,33.94456400),"
Midway Covenant Christian School
4635 Dallas Highway
Powder Springs, GA 30127
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Midway Covenant Christian School",'Powder_Springs=' + Powder_Springs.length); Atlanta[Atlanta.length] = createMarker(new GPoint(-84.37163900,33.92469000),"
Mount Vernon Presbyterian School
471 Mt Vernon Highway
Atlanta, GA 30328
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount Vernon Presbyterian School",'Atlanta=' + Atlanta.length); Duluth[Duluth.length] = createMarker(new GPoint(-84.19176100,34.01327100),"
Perimeter Christian School
9500 Medlock Bridge Road
Duluth, GA 30097
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Perimeter Christian School",'Duluth=' + Duluth.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); Macon[Macon.length] = createMarker(new GPoint(-83.74577100,32.88959000),"
St Andrew's Montessori Preschool
501 Bass Road
Macon, GA 31210
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Andrew's Montessori Preschool",'Macon=' + Macon.length); Statesboro[Statesboro.length] = createMarker(new GPoint(-81.75332400,32.45419600),"
Trinity Christian School
571 E Main Street
Statesboro, GA 30461
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Christian School",'Statesboro=' + Statesboro.length); Saint_Simons_Island[Saint_Simons_Island.length] = createMarker(new GPoint(-81.34033100,31.28222600),"
The Whitefield School
48 Hampton Point Drive
Saint Simons Island, GA 31522
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Whitefield School",'Saint_Simons_Island=' + Saint_Simons_Island.length); map.removeOverlays(Atlanta); map.removeOverlays(Brunswick); map.removeOverlays(Buford); map.removeOverlays(Decatur); map.removeOverlays(Douglasville); map.removeOverlays(Duluth); map.removeOverlays(Hinesville); map.removeOverlays(Macon); map.removeOverlays(Marietta); map.removeOverlays(Powder_Springs); map.removeOverlays(Rabun_Gap); map.removeOverlays(Saint_Simons_Island); map.removeOverlays(Statesboro); map.removeOverlays(Stone_Mountain); setTimeout(function(){map.addOverlays(Atlanta)},1000); setTimeout(function(){map.addOverlays(Brunswick)},1000); setTimeout(function(){map.addOverlays(Buford)},1000); setTimeout(function(){map.addOverlays(Decatur)},1000); setTimeout(function(){map.addOverlays(Douglasville)},1000); setTimeout(function(){map.addOverlays(Duluth)},1000); setTimeout(function(){map.addOverlays(Hinesville)},1000); setTimeout(function(){map.addOverlays(Macon)},1000); setTimeout(function(){map.addOverlays(Marietta)},1000); setTimeout(function(){map.addOverlays(Powder_Springs)},1000); setTimeout(function(){map.addOverlays(Rabun_Gap)},1000); setTimeout(function(){map.addOverlays(Saint_Simons_Island)},1000); setTimeout(function(){map.addOverlays(Statesboro)},1000); setTimeout(function(){map.addOverlays(Stone_Mountain)},1000); maxLng = -81.34033100; maxLat = 34.96181200; minLng = -84.71684600; minLat = 31.23053700; 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(Brunswick); map.removeOverlays(Buford); map.removeOverlays(Decatur); map.removeOverlays(Douglasville); map.removeOverlays(Duluth); map.removeOverlays(Hinesville); map.removeOverlays(Macon); map.removeOverlays(Marietta); map.removeOverlays(Powder_Springs); map.removeOverlays(Rabun_Gap); map.removeOverlays(Saint_Simons_Island); map.removeOverlays(Statesboro); map.removeOverlays(Stone_Mountain); 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(Decatur);map.removeOverlays(Atlanta); map.removeOverlays(Brunswick); map.removeOverlays(Buford); map.removeOverlays(Decatur); map.removeOverlays(Douglasville); map.removeOverlays(Duluth); map.removeOverlays(Hinesville); map.removeOverlays(Macon); map.removeOverlays(Marietta); map.removeOverlays(Powder_Springs); map.removeOverlays(Rabun_Gap); map.removeOverlays(Saint_Simons_Island); map.removeOverlays(Statesboro); map.removeOverlays(Stone_Mountain); map.addOverlays(Atlanta); centerByArray(Atlanta, false, false); cntMarker += Atlanta.length; map.addOverlays(Brunswick); centerByArray(Brunswick, false, false); cntMarker += Brunswick.length; map.addOverlays(Buford); centerByArray(Buford, false, false); cntMarker += Buford.length; map.addOverlays(Decatur); centerByArray(Decatur, false, false); cntMarker += Decatur.length; map.addOverlays(Douglasville); centerByArray(Douglasville, false, false); cntMarker += Douglasville.length; map.addOverlays(Duluth); centerByArray(Duluth, false, false); cntMarker += Duluth.length; map.addOverlays(Hinesville); centerByArray(Hinesville, false, false); cntMarker += Hinesville.length; map.addOverlays(Macon); centerByArray(Macon, false, false); cntMarker += Macon.length; map.addOverlays(Marietta); centerByArray(Marietta, false, false); cntMarker += Marietta.length; map.addOverlays(Powder_Springs); centerByArray(Powder_Springs, false, false); cntMarker += Powder_Springs.length; map.addOverlays(Rabun_Gap); centerByArray(Rabun_Gap, false, false); cntMarker += Rabun_Gap.length; map.addOverlays(Saint_Simons_Island); centerByArray(Saint_Simons_Island, false, false); cntMarker += Saint_Simons_Island.length; map.addOverlays(Statesboro); centerByArray(Statesboro, false, false); cntMarker += Statesboro.length; map.addOverlays(Stone_Mountain); centerByArray(Stone_Mountain, false, false); cntMarker += Stone_Mountain.length; centerByArray(Decatur,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///7844,7844,7719,7740,7890,7697,7698,7906,8008,8016,7763,7763,7844,7844,7719,31156,7658,7740,7890,7697,7698,7951,7667,7818,7906,8008,8016,8069,/all'); //window.open('/map.php?type=2&schools=7844,7844,7719,7740,7890,7697,7698,7906,8008,8016,7763,7763,7844,7844,7719,31156,7658,7740,7890,7697,7698,7951,7667,7818,7906,8008,8016,8069,&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; }