function addMarkers() { mySelect = document.getElementById('selection'); Woodstock = [];Ball_Ground = [];Canton = [];Holly_Springs = [];Waleska = [];Acworth = [];mySelect.options[mySelect.options.length] = new Option("Acworth schools",'all=Acworth'); mySelect.options[mySelect.options.length] = new Option("Ball Ground schools",'all=Ball_Ground'); mySelect.options[mySelect.options.length] = new Option("Canton schools",'all=Canton'); mySelect.options[mySelect.options.length] = new Option("Holly Springs schools",'all=Holly_Springs'); mySelect.options[mySelect.options.length] = new Option("Waleska schools",'all=Waleska'); mySelect.options[mySelect.options.length] = new Option("Woodstock schools",'all=Woodstock'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.43973541,34.10976410),"
Arnold Mill Elementary School
710 Arnold Mill Road
Woodstock, GA 30188

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arnold Mill Elementary School",'Woodstock=' + Woodstock.length); Ball_Ground[Ball_Ground.length] = createMarker(new GPoint(-84.37736511,34.34051895),"
Ball Ground Elementary School
480 Old Canton Road
Ball Ground, GA 30107

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ball Ground Elementary School",'Ball_Ground=' + Ball_Ground.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.57444763,34.13556290),"
Bascomb Elementary School
1335 Wyngate Parkway
Woodstock, GA 30189

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bascomb Elementary School",'Woodstock=' + Woodstock.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.56092834,34.11447144),"
Booth Middle School
6550 Putnam Ford Road
Woodstock, GA 30189

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Booth Middle School",'Woodstock=' + Woodstock.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.59000397,34.12954330),"
Boston Elementary School
105 Othello Drive
Woodstock, GA 30189

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Boston Elementary School",'Woodstock=' + Woodstock.length); Canton[Canton.length] = createMarker(new GPoint(-84.41497040,34.24077225),"
Buffington Elementary School
4568 Cumming Highway
Canton, GA 30115

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buffington Elementary School",'Canton=' + Canton.length); Canton[Canton.length] = createMarker(new GPoint(-84.49967957,34.23808289),"
Canton Elementary School
712 Marietta Highway
Canton, GA 30114

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Canton Elementary School",'Canton=' + Canton.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.56907654,34.09831238),"
Carmel Elementary School
2275 Bascomb-carmel Road
Woodstock, GA 30189

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carmel Elementary School",'Woodstock=' + Woodstock.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.56127167,34.11334610),"
Chapman Intermediate School
6500 Putnam Ford Road
Woodstock, GA 30189

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Chapman Intermediate School",'Woodstock=' + Woodstock.length); Canton[Canton.length] = createMarker(new GPoint(-84.50016785,34.23485947),"
Cherokee High School
930 Marietta Highway
Canton, GA 30114

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cherokee High School",'Canton=' + Canton.length); Canton[Canton.length] = createMarker(new GPoint(-84.48833466,34.33163452),"
Clayton Elementary School
221 Upper Burris Road
Canton, GA 30114

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clayton Elementary School",'Canton=' + Canton.length); Canton[Canton.length] = createMarker(new GPoint(-84.33437000,34.23462500),"
Creekland Middle School
1555 Owens Store Rd
Canton, GA 30115

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Creekland Middle School",'Canton=' + Canton.length); Holly_Springs[Holly_Springs.length] = createMarker(new GPoint(-84.35664368,34.23471832),"
Crossroads Alternative Middle/high
3921 Holly Springs Parkway
Holly Springs, GA 30142

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crossroads Alternative Middle/high",'Holly_Springs=' + Holly_Springs.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.56127167,34.11479568),"
Etowah High School
6565 Putnam Ford Road
Woodstock, GA 30189

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Etowah High School",'Woodstock=' + Woodstock.length); Canton[Canton.length] = createMarker(new GPoint(-84.28749084,34.23831940),"
Free Home Elementary School
12525 Cumming Highway
Canton, GA 30115

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Free Home Elementary School",'Canton=' + Canton.length); Canton[Canton.length] = createMarker(new GPoint(-84.53341800,34.19526100),"
Freedom Middle School
10550 Bells Ferry Road
Canton, GA 30114

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Freedom Middle School",'Canton=' + Canton.length); Canton[Canton.length] = createMarker(new GPoint(-84.42194366,34.17209625),"
Hickory Flat Elementary School
2755 East Cherokee Drive
Canton, GA 30115

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hickory Flat Elementary School",'Canton=' + Canton.length); Canton[Canton.length] = createMarker(new GPoint(-84.47396851,34.17134094),"
Holly Springs Elementary School
1965 Hickory Rd.
Canton, GA 30115

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holly Springs Elementary School",'Canton=' + Canton.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.49440002,34.13049698),"
Johnston Elementary School
2031 East Cherokee Drive
Woodstock, GA 30188

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Johnston Elementary School",'Woodstock=' + Woodstock.length); Canton[Canton.length] = createMarker(new GPoint(-84.53726959,34.19295502),"
Liberty Elementary School
10500 Bells Ferry Road
Canton, GA 30114

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liberty Elementary School",'Canton=' + Canton.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.47053528,34.10614014),"
Little River Elementary School
3170 Trickum Road
Woodstock, GA 30188

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Little River Elementary School",'Woodstock=' + Woodstock.length); Canton[Canton.length] = createMarker(new GPoint(-84.35832977,34.24788666),"
Macedonia Elementary School
10370 East Cherokee Drive
Canton, GA 30115

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Macedonia Elementary School",'Canton=' + Canton.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.40538025,34.13875580),"
Mountain Road Elementary School
615 Mountain Road
Woodstock, GA 30188

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mountain Road Elementary School",'Woodstock=' + Woodstock.length); Waleska[Waleska.length] = createMarker(new GPoint(-84.61309814,34.37892151),"
Mountainbrook Psychoeducational Program
471 Grady Street
Waleska, GA 30183

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mountainbrook Psychoeducational Program",'Waleska=' + Waleska.length); Acworth[Acworth.length] = createMarker(new GPoint(-84.61334991,34.09553146),"
Oak Grove Elementary School
6118 Woodstock Road
Acworth, GA 30102

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak Grove Elementary School",'Acworth=' + Acworth.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.55106100,34.10668800),"
Polaris Evening School
2010 Towne Lake Hills South Dr
Woodstock, GA 30189

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Polaris Evening School",'Woodstock=' + Woodstock.length); Waleska[Waleska.length] = createMarker(new GPoint(-84.52964783,34.33763504),"
R. M. Moore Elementary School
1375 Puckett Road
Waleska, GA 30183

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("R. M. Moore Elementary School",'Waleska=' + Waleska.length); Canton[Canton.length] = createMarker(new GPoint(-84.48905182,34.26026535),"
Ralph Bunche Center
400 Belletta Drive
Canton, GA 30114

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ralph Bunche Center",'Canton=' + Canton.length); Canton[Canton.length] = createMarker(new GPoint(-84.42678833,34.16934586),"
Rusk Middle School
4695 Hickory Road
Canton, GA 30115

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rusk Middle School",'Canton=' + Canton.length); Canton[Canton.length] = createMarker(new GPoint(-84.42883301,34.16896820),"
Sequoyah High School
4485 Hickory Road
Canton, GA 30115

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sequoyah High School",'Canton=' + Canton.length); Canton[Canton.length] = createMarker(new GPoint(-84.54589600,34.17200000),"
Sixes Elementary School
20 Ridge Road
Canton, GA 30114

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sixes Elementary School",'Canton=' + Canton.length); Canton[Canton.length] = createMarker(new GPoint(-84.51811218,34.21523285),"
Teasley Middle School
8871 Knox Bridge Highway
Canton, GA 30114

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Teasley Middle School",'Canton=' + Canton.length); Canton[Canton.length] = createMarker(new GPoint(-84.48331451,34.25010681),"
Tippens Elementary School
8 Glenwood Street.
Canton, GA 30114

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tippens Elementary School",'Canton=' + Canton.length); Canton[Canton.length] = createMarker(new GPoint(-84.47079400,34.23952000),"
William G. Hasty, Sr. Elementary School
205 Brown Industrial Parkway
Canton, GA 30114

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("William G. Hasty, Sr. Elementary School",'Canton=' + Canton.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.51827240,34.10359192),"
Woodstock Elementary School
230 Rope Mill Road
Woodstock, GA 30188

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodstock Elementary School",'Woodstock=' + Woodstock.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.54397583,34.10226059),"
Woodstock High School
2010 Towne Lake Hills South Dr
Woodstock, GA 30189

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodstock High School",'Woodstock=' + Woodstock.length); Woodstock[Woodstock.length] = createMarker(new GPoint(-84.54396820,34.10227585),"
Woodstock Middle School
2000 Towne Lake Hills South Dr
Woodstock, GA 30189

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Woodstock Middle School",'Woodstock=' + Woodstock.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,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) { 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(Acworth); map.removeOverlays(Ball_Ground); map.removeOverlays(Canton); map.removeOverlays(Holly_Springs); map.removeOverlays(Waleska); map.removeOverlays(Woodstock); 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(Woodstock);map.removeOverlays(Acworth); map.removeOverlays(Ball_Ground); map.removeOverlays(Canton); map.removeOverlays(Holly_Springs); map.removeOverlays(Waleska); map.removeOverlays(Woodstock); map.addOverlays(Acworth); centerByArray(Acworth, false, false); cntMarker += Acworth.length; map.addOverlays(Ball_Ground); centerByArray(Ball_Ground, false, false); cntMarker += Ball_Ground.length; map.addOverlays(Canton); centerByArray(Canton, false, false); cntMarker += Canton.length; map.addOverlays(Holly_Springs); centerByArray(Holly_Springs, false, false); cntMarker += Holly_Springs.length; map.addOverlays(Waleska); centerByArray(Waleska, false, false); cntMarker += Waleska.length; map.addOverlays(Woodstock); centerByArray(Woodstock, false, false); cntMarker += Woodstock.length; centerByArray(Woodstock,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'); } }