function addMarkers() { mySelect = document.getElementById('selection'); Wagener = [];Langley = [];Aiken = [];Belvedere = [];Graniteville = [];Clearwater = [];Gloverville = [];New_Ellenton = [];N_Augusta = [];Jackson = [];Bath = [];North_Augusta = [];Ridge_Spring = [];Monetta = [];Warrenville = [];mySelect.options[mySelect.options.length] = new Option("Aiken schools",'all=Aiken'); mySelect.options[mySelect.options.length] = new Option("Bath schools",'all=Bath'); mySelect.options[mySelect.options.length] = new Option("Belvedere schools",'all=Belvedere'); mySelect.options[mySelect.options.length] = new Option("Clearwater schools",'all=Clearwater'); mySelect.options[mySelect.options.length] = new Option("Gloverville schools",'all=Gloverville'); mySelect.options[mySelect.options.length] = new Option("Graniteville schools",'all=Graniteville'); mySelect.options[mySelect.options.length] = new Option("Jackson schools",'all=Jackson'); mySelect.options[mySelect.options.length] = new Option("Langley schools",'all=Langley'); mySelect.options[mySelect.options.length] = new Option("Monetta schools",'all=Monetta'); mySelect.options[mySelect.options.length] = new Option("N Augusta schools",'all=N_Augusta'); mySelect.options[mySelect.options.length] = new Option("New Ellenton schools",'all=New_Ellenton'); mySelect.options[mySelect.options.length] = new Option("North Augusta schools",'all=North_Augusta'); mySelect.options[mySelect.options.length] = new Option("Ridge Spring schools",'all=Ridge_Spring'); mySelect.options[mySelect.options.length] = new Option("Wagener schools",'all=Wagener'); mySelect.options[mySelect.options.length] = new Option("Warrenville schools",'all=Warrenville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Wagener[Wagener.length] = createMarker(new GPoint(-81.40380096,33.65660095),"
A L Corbett Middle School
P. O .box 188
Wagener, SC 29164

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("A L Corbett Middle School",'Wagener=' + Wagener.length); Langley[Langley.length] = createMarker(new GPoint(-81.84408100,33.51794400),"
Aiken County Career & Technical Center
P O Box 1830
Langley, SC 29834

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aiken County Career & Technical Center",'Langley=' + Langley.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.76790619,33.52689362),"
Aiken Elementary School
2050 Pine Log Rd.
Aiken, SC 29801

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Aiken Elementary School",'Aiken=' + Aiken.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.71746063,33.57984161),"
Aiken High/aiken High Annex
449 Rutland Drive
Aiken, SC 29801

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aiken High/aiken High Annex",'Aiken=' + Aiken.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.69034576,33.58011246),"
Aiken Middle School
101 Gator Lane
Aiken, SC 29801

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Aiken Middle School",'Aiken=' + Aiken.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.72016600,33.56674400),"
Aiken Performing Arts Academy (charter)
363 Laurens Street
Aiken, SC 29802

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aiken Performing Arts Academy (charter)",'Aiken=' + Aiken.length); Belvedere[Belvedere.length] = createMarker(new GPoint(-81.93787384,33.52822113),"
Belvedere Elementary School
201 Rhomboid Place
Belvedere, SC 29841

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Belvedere Elementary School",'Belvedere=' + Belvedere.length); Graniteville[Graniteville.length] = createMarker(new GPoint(-81.81781006,33.57001495),"
Byrd Elementary School
1 Willis Circle
Graniteville, SC 29829

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Byrd Elementary School",'Graniteville=' + Graniteville.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.71377563,33.48216629),"
Chukker Creek Elementary School
1830 Chukker Creek Road
Aiken, SC 29803

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chukker Creek Elementary School",'Aiken=' + Aiken.length); Clearwater[Clearwater.length] = createMarker(new GPoint(-81.89219666,33.49660110),"
Clearwater Elementary School
P O Box 397
Clearwater, SC 29822

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clearwater Elementary School",'Clearwater=' + Clearwater.length); Wagener[Wagener.length] = createMarker(new GPoint(-81.36426544,33.64730072),"
Cyril B Busbee Elementary School
236 Main Street So.
Wagener, SC 29164

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cyril B Busbee Elementary School",'Wagener=' + Wagener.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.67475891,33.55002975),"
East Aiken Elementary School
223 Old Wagener Road
Aiken, SC 29801

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Aiken Elementary School",'Aiken=' + Aiken.length); Gloverville[Gloverville.length] = createMarker(new GPoint(-81.82730103,33.52479935),"
Gloverville Elementary School
P O Box 220
Gloverville, SC 29828

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gloverville Elementary School",'Gloverville=' + Gloverville.length); New_Ellenton[New_Ellenton.length] = createMarker(new GPoint(-81.67874146,33.40770340),"
Greendale Elementary School
505 South Boundary Ave.
New Ellenton, SC 29809

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greendale Elementary School",'New_Ellenton=' + New_Ellenton.length); N_Augusta[N_Augusta.length] = createMarker(new GPoint(-81.98359680,33.51131439),"
Hammond Hill Elementary School
901 W Woodlawn Ave
N Augusta, SC 29841

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hammond Hill Elementary School",'N_Augusta=' + N_Augusta.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.67544556,33.64611816),"
J D Lever Elementary School
2404 Columbia Hwy
Aiken, SC 29801

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("J D Lever Elementary School",'Aiken=' + Aiken.length); Jackson[Jackson.length] = createMarker(new GPoint(-81.79370880,33.34254837),"
Jackson Middle School
8217 Atomic Road
Jackson, SC 29831

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Jackson Middle School",'Jackson=' + Jackson.length); Bath[Bath.length] = createMarker(new GPoint(-81.86910248,33.50439835),"
Jefferson Elementary School
P O Box 340
Bath, SC 29816

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Bath=' + Bath.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.72035980,33.56673050),"
Kennedy/lloyd Charter School
363 Laurens Street
Aiken, SC 29802

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kennedy/lloyd Charter School",'Aiken=' + Aiken.length); Langley[Langley.length] = createMarker(new GPoint(-81.84410095,33.51770020),"
Langley Bath Clearwater Middle School
Post Office Box 2070
Langley, SC 29834

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Langley Bath Clearwater Middle School",'Langley=' + Langley.length); Graniteville[Graniteville.length] = createMarker(new GPoint(-81.80705261,33.56742477),"
Leavelle Mccampbell Middle School
82 Canal Street
Graniteville, SC 29829

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Leavelle Mccampbell Middle School",'Graniteville=' + Graniteville.length); Langley[Langley.length] = createMarker(new GPoint(-81.84410095,33.51770020),"
Midland Valley High School
P O Box 2010
Langley, SC 29834

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Midland Valley High School",'Langley=' + Langley.length); Graniteville[Graniteville.length] = createMarker(new GPoint(-81.84353638,33.53015518),"
Midland Valley Preparatory School
2432 Jefferson Davis Hig
Graniteville, SC 29829

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Midland Valley Preparatory School",'Graniteville=' + Graniteville.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.71438599,33.52562714),"
Millbrook Elementary School
255 E. Pine Log Rd.
Aiken, SC 29803

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Millbrook Elementary School",'Aiken=' + Aiken.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.71387482,33.52552032),"
Minnie B Kennedy Middle School
274 E. Pine Log Rd.
Aiken, SC 29803

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Minnie B Kennedy Middle School",'Aiken=' + Aiken.length); North_Augusta[North_Augusta.length] = createMarker(new GPoint(-81.96023000,33.54257400),"
Mossy Creek Elementary School
421 West Five Notch Road
North Augusta, SC 29841

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mossy Creek Elementary School",'North_Augusta=' + North_Augusta.length); New_Ellenton[New_Ellenton.length] = createMarker(new GPoint(-81.68479919,33.39979935),"
New Ellenton Middle School
814 Main Street
New Ellenton, SC 29809

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("New Ellenton Middle School",'New_Ellenton=' + New_Ellenton.length); N_Augusta[N_Augusta.length] = createMarker(new GPoint(-81.96789551,33.49412537),"
North Augusta Elementary School
400 E Spring Grove Avenue
N Augusta, SC 29841

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Augusta Elementary School",'N_Augusta=' + N_Augusta.length); North_Augusta[North_Augusta.length] = createMarker(new GPoint(-81.97270966,33.53276825),"
North Augusta High School
2000 Knobcone Avenue
North Augusta, SC 29841

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Augusta High School",'North_Augusta=' + North_Augusta.length); N_Augusta[N_Augusta.length] = createMarker(new GPoint(-81.95214081,33.49841690),"
North Augusta Middle School
725 Old Edgefield Rd
N Augusta, SC 29841

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("North Augusta Middle School",'N_Augusta=' + N_Augusta.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.57569885,33.51431274),"
Oakwood- Windsor Elementary School
3773 Charleston Hwy.
Aiken, SC 29801

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakwood- Windsor Elementary School",'Aiken=' + Aiken.length); North_Augusta[North_Augusta.length] = createMarker(new GPoint(-81.97248077,33.52876663),"
Paul Knox Middle School
1804 Wells Road
North Augusta, SC 29841

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Paul Knox Middle School",'North_Augusta=' + North_Augusta.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.69015503,33.58028793),"
Pinecrest/north Aiken Elementary School
100 Bear Rock Rd.
Aiken, SC 29801

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pinecrest/north Aiken Elementary School",'Aiken=' + Aiken.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.82316589,33.37309647),"
Redcliffe Elementary School
6741 Atomic Road
Aiken, SC 29803

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Redcliffe Elementary School",'Aiken=' + Aiken.length); Ridge_Spring[Ridge_Spring.length] = createMarker(new GPoint(-81.65843201,33.84833908),"
Ridge Spring Monetta Elementary School
422 Hazzard Circle
Ridge Spring, SC 29129

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ridge Spring Monetta Elementary School",'Ridge_Spring=' + Ridge_Spring.length); Monetta[Monetta.length] = createMarker(new GPoint(-81.62556458,33.82207870),"
Ridge-spring Monetta High School
10 J. P. Kneece Dr.
Monetta, SC 29105

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ridge-spring Monetta High School",'Monetta=' + Monetta.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.71070862,33.56262589),"
Schofield Middle School
220 Sumter St
Aiken, SC 29801

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Schofield Middle School",'Aiken=' + Aiken.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.75736237,33.39495468),"
Silver Bluff High School
64 Desoto Drive
Aiken, SC 29803

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Silver Bluff High School",'Aiken=' + Aiken.length); Aiken[Aiken.length] = createMarker(new GPoint(-81.71472931,33.52521515),"
South Aiken High School
232 E. Pine Log Rd.
Aiken, SC 29803

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Aiken High School",'Aiken=' + Aiken.length); Wagener[Wagener.length] = createMarker(new GPoint(-81.36426544,33.64647293),"
Wagener Salley High School
272 Main Street So.
Wagener, SC 29164

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wagener Salley High School",'Wagener=' + Wagener.length); Warrenville[Warrenville.length] = createMarker(new GPoint(-81.78411102,33.52554703),"
Warrenville Elementary School
569 Howlandville Rd
Warrenville, SC 29851

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Warrenville Elementary School",'Warrenville=' + Warrenville.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(Aiken); map.removeOverlays(Bath); map.removeOverlays(Belvedere); map.removeOverlays(Clearwater); map.removeOverlays(Gloverville); map.removeOverlays(Graniteville); map.removeOverlays(Jackson); map.removeOverlays(Langley); map.removeOverlays(Monetta); map.removeOverlays(N_Augusta); map.removeOverlays(New_Ellenton); map.removeOverlays(North_Augusta); map.removeOverlays(Ridge_Spring); map.removeOverlays(Wagener); map.removeOverlays(Warrenville); 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(Wagener);map.removeOverlays(Aiken); map.removeOverlays(Bath); map.removeOverlays(Belvedere); map.removeOverlays(Clearwater); map.removeOverlays(Gloverville); map.removeOverlays(Graniteville); map.removeOverlays(Jackson); map.removeOverlays(Langley); map.removeOverlays(Monetta); map.removeOverlays(N_Augusta); map.removeOverlays(New_Ellenton); map.removeOverlays(North_Augusta); map.removeOverlays(Ridge_Spring); map.removeOverlays(Wagener); map.removeOverlays(Warrenville); map.addOverlays(Aiken); centerByArray(Aiken, false, false); cntMarker += Aiken.length; map.addOverlays(Bath); centerByArray(Bath, false, false); cntMarker += Bath.length; map.addOverlays(Belvedere); centerByArray(Belvedere, false, false); cntMarker += Belvedere.length; map.addOverlays(Clearwater); centerByArray(Clearwater, false, false); cntMarker += Clearwater.length; map.addOverlays(Gloverville); centerByArray(Gloverville, false, false); cntMarker += Gloverville.length; map.addOverlays(Graniteville); centerByArray(Graniteville, false, false); cntMarker += Graniteville.length; map.addOverlays(Jackson); centerByArray(Jackson, false, false); cntMarker += Jackson.length; map.addOverlays(Langley); centerByArray(Langley, false, false); cntMarker += Langley.length; map.addOverlays(Monetta); centerByArray(Monetta, false, false); cntMarker += Monetta.length; map.addOverlays(N_Augusta); centerByArray(N_Augusta, false, false); cntMarker += N_Augusta.length; map.addOverlays(New_Ellenton); centerByArray(New_Ellenton, false, false); cntMarker += New_Ellenton.length; map.addOverlays(North_Augusta); centerByArray(North_Augusta, false, false); cntMarker += North_Augusta.length; map.addOverlays(Ridge_Spring); centerByArray(Ridge_Spring, false, false); cntMarker += Ridge_Spring.length; map.addOverlays(Wagener); centerByArray(Wagener, false, false); cntMarker += Wagener.length; map.addOverlays(Warrenville); centerByArray(Warrenville, false, false); cntMarker += Warrenville.length; centerByArray(Wagener,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'); } }