function addMarkers() { mySelect = document.getElementById('selection'); Douglasville = [];Lithia_Springs = [];Villa_Rica = [];Winston = [];mySelect.options[mySelect.options.length] = new Option("Douglasville schools",'all=Douglasville'); mySelect.options[mySelect.options.length] = new Option("Lithia Springs schools",'all=Lithia_Springs'); mySelect.options[mySelect.options.length] = new Option("Villa Rica schools",'all=Villa_Rica'); mySelect.options[mySelect.options.length] = new Option("Winston schools",'all=Winston'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.79246521,33.68204117),"
Alexander High School
6500 Alexander Parkway
Douglasville, GA 30135

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alexander High School",'Douglasville=' + Douglasville.length); Lithia_Springs[Lithia_Springs.length] = createMarker(new GPoint(-84.65740204,33.79599380),"
Annette Winn Elementary School
3536 Bankhead Highway
Lithia Springs, GA 30122

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Annette Winn Elementary School",'Lithia_Springs=' + Lithia_Springs.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.75379181,33.71168518),"
Arbor Station Elementary School
9999 Parkway South
Douglasville, GA 30135

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arbor Station Elementary School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.70418549,33.77474976),"
Beulah Elementary School
1150 Burnt Hickory Road
Douglasville, GA 30134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Beulah Elementary School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.80532837,33.67345047),"
Bill Arp Elementary School
4841 Highway 5
Douglasville, GA 30135

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bill Arp Elementary School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.78170013,33.72540283),"
Bright Star Elementary School
6300 John West Road
Douglasville, GA 30134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bright Star Elementary School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.72850037,33.75444412),"
Burnett Elementary School
8277 Connally Drive
Douglasville, GA 30134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Burnett Elementary School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.71616364,33.69635773),"
Chapel Hill Elementary School
3991 Chapel Hill Road
Douglasville, GA 30135

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chapel Hill Elementary School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.72038269,33.67238235),"
Chapel Hill High School
4899 Chapel Hill Road
Douglasville, GA 30135

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chapel Hill High School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.71616364,33.69641495),"
Chapel Hill Middle School
3989 Chapel Hill Road
Douglasville, GA 30135

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Chapel Hill Middle School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.69780731,33.73391342),"
Chestnut Log Middle School
2544 Pope Road
Douglasville, GA 30135

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Chestnut Log Middle School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.83345795,33.81217957),"
Crossroads High School
4895 Chapel Hill Road
Douglasville, GA 30135

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crossroads High School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.83345795,33.81217957),"
Crossroads Middle School
8335 Duralee Lane
Douglasville, GA 30134

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crossroads Middle School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.76723480,33.68073654),"
Dorsett Shoals Elementary School
5866 Dorsett Shoals Road
Douglasville, GA 30135

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dorsett Shoals Elementary School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.74912400,33.75018000),"
Douglas County High School
8705 Campbellton Street
Douglasville, GA 30134

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Douglas County High School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.72824097,33.75475693),"
Eastside Elementary School
8266 Connally Drive
Douglasville, GA 30134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eastside Elementary School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.65947723,33.72303391),"
Factory Shoals Elementary School
3046 Fairburn Road
Douglasville, GA 30135

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Factory Shoals Elementary School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.84702301,33.61820984),"
Fairplay Middle School
8311 Highway 166
Douglasville, GA 30135

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fairplay Middle School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.72104645,33.67120361),"
Holly Springs Elementary School
4909 West Chapel Hill Road
Douglasville, GA 30135

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holly Springs Elementary School",'Douglasville=' + Douglasville.length); Lithia_Springs[Lithia_Springs.length] = createMarker(new GPoint(-84.66162109,33.75422668),"
Lithia Springs Comprehensive High School
2520 East County Line Road
Lithia Springs, GA 30122

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lithia Springs Comprehensive High School",'Lithia_Springs=' + Lithia_Springs.length); Lithia_Springs[Lithia_Springs.length] = createMarker(new GPoint(-84.66087341,33.78845978),"
Lithia Springs Elementary School
6946 Florence Drive
Lithia Springs, GA 30122

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lithia Springs Elementary School",'Lithia_Springs=' + Lithia_Springs.length); Villa_Rica[Villa_Rica.length] = createMarker(new GPoint(-84.87895966,33.73154449),"
Mirror Lake Elementary School
2613 Tyson Road
Villa Rica, GA 30180

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mirror Lake Elementary School",'Villa_Rica=' + Villa_Rica.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.68074036,33.74135208),"
Mount Carmel Elementary School
2356 Fairburn Road
Douglasville, GA 30135

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mount Carmel Elementary School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.65065765,33.70783234),"
New Manchester Elementary School
2242 Old Lower River Road
Douglasville, GA 30135

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Manchester Elementary School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.78455100,33.76136900),"
North Douglas Elementary School
1630 Dorris Road
Douglasville, GA 30134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Douglas Elementary School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.84646606,33.61781693),"
South Douglas Elementary School
8299 Highway 166
Douglasville, GA 30135

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Douglas Elementary School",'Douglasville=' + Douglasville.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.74732971,33.75827789),"
Stewart Middle School
8138 Malone Street
Douglasville, GA 30134

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Stewart Middle School",'Douglasville=' + Douglasville.length); Lithia_Springs[Lithia_Springs.length] = createMarker(new GPoint(-84.66145325,33.75394821),"
Sweetwater Elementary School
2505 East County Line Road
Lithia Springs, GA 30122

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sweetwater Elementary School",'Lithia_Springs=' + Lithia_Springs.length); Lithia_Springs[Lithia_Springs.length] = createMarker(new GPoint(-84.66116333,33.78753662),"
Turner Middle School
7101 Junior High Drive
Lithia Springs, GA 30122

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Turner Middle School",'Lithia_Springs=' + Lithia_Springs.length); Winston[Winston.length] = createMarker(new GPoint(-84.81906128,33.72897720),"
Winston Elementary School
7465 Highway 78
Winston, GA 30187

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Winston Elementary School",'Winston=' + Winston.length); Douglasville[Douglasville.length] = createMarker(new GPoint(-84.77308655,33.69509125),"
Yeager Middle School
4000 Kings Highway
Douglasville, GA 30135

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Yeager Middle School",'Douglasville=' + Douglasville.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(Douglasville); map.removeOverlays(Lithia_Springs); map.removeOverlays(Villa_Rica); map.removeOverlays(Winston); 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(Douglasville);map.removeOverlays(Douglasville); map.removeOverlays(Lithia_Springs); map.removeOverlays(Villa_Rica); map.removeOverlays(Winston); map.addOverlays(Douglasville); centerByArray(Douglasville, false, false); cntMarker += Douglasville.length; map.addOverlays(Lithia_Springs); centerByArray(Lithia_Springs, false, false); cntMarker += Lithia_Springs.length; map.addOverlays(Villa_Rica); centerByArray(Villa_Rica, false, false); cntMarker += Villa_Rica.length; map.addOverlays(Winston); centerByArray(Winston, false, false); cntMarker += Winston.length; centerByArray(Douglasville,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'); } }