function addMarkers(){ mySelect = document.getElementById('selection'); Canton = [];Douglasville = [];Atlanta = [];Chamblee = [];Decatur = [];Stone_Mountain = [];Martinez = [];Alpharetta = [];Savannah = [];Morrow = [];Augusta = [];mySelect.options[mySelect.options.length] = new Option("Alpharetta schools",'all=Alpharetta'); 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("Canton schools",'all=Canton'); mySelect.options[mySelect.options.length] = new Option("Chamblee schools",'all=Chamblee'); 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("Martinez schools",'all=Martinez'); mySelect.options[mySelect.options.length] = new Option("Morrow schools",'all=Morrow'); mySelect.options[mySelect.options.length] = new Option("Savannah schools",'all=Savannah'); mySelect.options[mySelect.options.length] = new Option("Stone Mountain schools",'all=Stone_Mountain'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Canton[Canton.length] = createMarker(new GPoint(-84.53511500,34.16088600),"
American Heritage Academy
2126 Sixes Road
Canton, GA 30114
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("American Heritage Academy",'Canton=' + Canton.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.76031800,33.71524800),"
Ashford Academy Montessori
3321 W Stewarts Mill Road
Douglasville, GA 30135
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ashford Academy Montessori",'Douglasville=' + Douglasville.length); Atlanta[Atlanta.length] = createMarker(new GPoint(-84.42134600,33.84156900),"
Atlanta Speech School
3160 Northside Parkway Nw
Atlanta, GA 30327
Co-ed school, NS-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Atlanta Speech School",'Atlanta=' + Atlanta.length); Atlanta[Atlanta.length] = createMarker(new GPoint(-84.38692000,33.83022700),"
The Cathedral Preschool
2744 Peachtree Road Nw
Atlanta, GA 30305
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Cathedral Preschool",'Atlanta=' + Atlanta.length); Chamblee[Chamblee.length] = createMarker(new GPoint(-84.28920000,33.88920000),"
Cross And Crown Day School
4276 Chamblee Dunwoody Road A
Chamblee, GA 30341
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cross And Crown Day School",'Chamblee=' + Chamblee.length); Decatur[Decatur.length] = createMarker(new GPoint(-84.29251600,33.77572100),"
Decatur First Umc Weekday Childrens Ministries
300 E Ponce De Leon Avenue
Decatur, GA 30030
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Decatur First Umc Weekday Childrens Ministries",'Decatur=' + Decatur.length); Atlanta[Atlanta.length] = createMarker(new GPoint(-84.42560700,33.75816500),"
The Edelman Center
350 Spelman Lane Sw Box 89
Atlanta, GA 30314
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Edelman Center",'Atlanta=' + Atlanta.length); Stone_Mountain[Stone_Mountain.length] = createMarker(new GPoint(-84.19656000,33.76341000),"
Love And Grace Christian Academy
1125 S Hairston Road
Stone Mountain, GA 30088
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Love And Grace Christian Academy",'Stone_Mountain=' + Stone_Mountain.length); Martinez[Martinez.length] = createMarker(new GPoint(-82.09135600,33.52398900),"
Martinez Montessori Academy
3765 Old Petersburg Road
Martinez, GA 30907
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Martinez Montessori Academy",'Martinez=' + Martinez.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); Alpharetta[Alpharetta.length] = createMarker(new GPoint(-84.27948500,34.01747400),"
Mount Pisgah Christian School
9820 Nesbit Ferry Road
Alpharetta, GA 30022
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount Pisgah Christian School",'Alpharetta=' + Alpharetta.length); Savannah[Savannah.length] = createMarker(new GPoint(-81.11199100,32.04962900),"
Ramah Junior Academy
3400 Florence Street
Savannah, GA 31405
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ramah Junior Academy",'Savannah=' + Savannah.length); Atlanta[Atlanta.length] = createMarker(new GPoint(-84.42230000,33.86230000),"
St Annes Day School
3098 Saint Annes Lane Nw
Atlanta, GA 30327
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Annes Day School",'Atlanta=' + Atlanta.length); Morrow[Morrow.length] = createMarker(new GPoint(-84.31827900,33.59849200),"
Treetop Learning Academy
5754 Attucks Blvd
Morrow, GA 30260
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Treetop Learning Academy",'Morrow=' + Morrow.length); Augusta[Augusta.length] = createMarker(new GPoint(-82.01948400,33.41829900),"
Walden Hall Montessori
2030 Lumpkin Road
Augusta, GA 30906
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Walden Hall Montessori",'Augusta=' + Augusta.length); Atlanta[Atlanta.length] = createMarker(new GPoint(-84.48891200,33.74709000),"
Worthy's Christian Academy
330 Lynhurst Drive Sw
Atlanta, GA 30311
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Worthy's Christian Academy",'Atlanta=' + Atlanta.length); map.removeOverlays(Alpharetta); map.removeOverlays(Atlanta); map.removeOverlays(Augusta); map.removeOverlays(Canton); map.removeOverlays(Chamblee); map.removeOverlays(Decatur); map.removeOverlays(Douglasville); map.removeOverlays(Martinez); map.removeOverlays(Morrow); map.removeOverlays(Savannah); map.removeOverlays(Stone_Mountain); setTimeout(function(){map.addOverlays(Alpharetta)},1000); setTimeout(function(){map.addOverlays(Atlanta)},1000); setTimeout(function(){map.addOverlays(Augusta)},1000); setTimeout(function(){map.addOverlays(Canton)},1000); setTimeout(function(){map.addOverlays(Chamblee)},1000); setTimeout(function(){map.addOverlays(Decatur)},1000); setTimeout(function(){map.addOverlays(Douglasville)},1000); setTimeout(function(){map.addOverlays(Martinez)},1000); setTimeout(function(){map.addOverlays(Morrow)},1000); setTimeout(function(){map.addOverlays(Savannah)},1000); setTimeout(function(){map.addOverlays(Stone_Mountain)},1000); maxLng = -81.11199100; maxLat = 34.16088600; minLng = -84.76031800; minLat = 32.04962900; 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(Alpharetta); map.removeOverlays(Atlanta); map.removeOverlays(Augusta); map.removeOverlays(Canton); map.removeOverlays(Chamblee); map.removeOverlays(Decatur); map.removeOverlays(Douglasville); map.removeOverlays(Martinez); map.removeOverlays(Morrow); map.removeOverlays(Savannah); 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(Canton);map.removeOverlays(Alpharetta); map.removeOverlays(Atlanta); map.removeOverlays(Augusta); map.removeOverlays(Canton); map.removeOverlays(Chamblee); map.removeOverlays(Decatur); map.removeOverlays(Douglasville); map.removeOverlays(Martinez); map.removeOverlays(Morrow); map.removeOverlays(Savannah); map.removeOverlays(Stone_Mountain); map.addOverlays(Alpharetta); centerByArray(Alpharetta, false, false); cntMarker += Alpharetta.length; map.addOverlays(Atlanta); centerByArray(Atlanta, false, false); cntMarker += Atlanta.length; map.addOverlays(Augusta); centerByArray(Augusta, false, false); cntMarker += Augusta.length; map.addOverlays(Canton); centerByArray(Canton, false, false); cntMarker += Canton.length; map.addOverlays(Chamblee); centerByArray(Chamblee, false, false); cntMarker += Chamblee.length; map.addOverlays(Decatur); centerByArray(Decatur, false, false); cntMarker += Decatur.length; map.addOverlays(Douglasville); centerByArray(Douglasville, false, false); cntMarker += Douglasville.length; map.addOverlays(Martinez); centerByArray(Martinez, false, false); cntMarker += Martinez.length; map.addOverlays(Morrow); centerByArray(Morrow, false, false); cntMarker += Morrow.length; map.addOverlays(Savannah); centerByArray(Savannah, false, false); cntMarker += Savannah.length; map.addOverlays(Stone_Mountain); centerByArray(Stone_Mountain, false, false); cntMarker += Stone_Mountain.length; centerByArray(Canton,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///7843,35370,7843,7545,7595,35373,7954,8058,35020,35370,7640,7656,35017,8029,35019,7909,7804,8069,/all'); //window.open('/map.php?type=2&schools=7843,35370,7843,7545,7595,35373,7954,8058,35020,35370,7640,7656,35017,8029,35019,7909,7804,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; }