function addMarkers() { mySelect = document.getElementById('selection'); Bentonville = [];Rogers = [];Decatur = [];Lowell = [];Garfield = [];Gentry = [];Gravette = [];Springdale = [];Siloam_Springs = [];Pea_Ridge = [];mySelect.options[mySelect.options.length] = new Option("Bentonville schools",'all=Bentonville'); mySelect.options[mySelect.options.length] = new Option("Decatur schools",'all=Decatur'); mySelect.options[mySelect.options.length] = new Option("Garfield schools",'all=Garfield'); mySelect.options[mySelect.options.length] = new Option("Gentry schools",'all=Gentry'); mySelect.options[mySelect.options.length] = new Option("Gravette schools",'all=Gravette'); mySelect.options[mySelect.options.length] = new Option("Lowell schools",'all=Lowell'); mySelect.options[mySelect.options.length] = new Option("Pea Ridge schools",'all=Pea_Ridge'); mySelect.options[mySelect.options.length] = new Option("Rogers schools",'all=Rogers'); mySelect.options[mySelect.options.length] = new Option("Siloam Springs schools",'all=Siloam_Springs'); mySelect.options[mySelect.options.length] = new Option("Springdale schools",'all=Springdale'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Bentonville[Bentonville.length] = createMarker(new GPoint(-94.18921661,36.37443542),"
Apple Glen Elementary School
1801 Orchard Lane
Bentonville, AR 72712

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Apple Glen Elementary School",'Bentonville=' + Bentonville.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.17206573,36.28556442),"
Bellview Elementary School
5400 Bellview Rd.
Rogers, AR 72756

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bellview Elementary School",'Rogers=' + Rogers.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.06580353,36.34329987),"
Benton County School Of Art
6 Halsted Circle
Rogers, AR 72756

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Benton County School Of Art",'Rogers=' + Rogers.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.15877533,36.33453751),"
Benton County School Of Arts
2005 S. 12th St.
Rogers, AR 72758

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Benton County School Of Arts",'Rogers=' + Rogers.length); Bentonville[Bentonville.length] = createMarker(new GPoint(-94.19702911,36.35125351),"
Bentonville High School
1901 Se J Street
Bentonville, AR 72712

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bentonville High School",'Bentonville=' + Bentonville.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.13562775,36.31503296),"
Bonnie Grimes Elementary School
1801 S. 13 St.
Rogers, AR 72756

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bonnie Grimes Elementary School",'Rogers=' + Rogers.length); Bentonville[Bentonville.length] = createMarker(new GPoint(-94.22860900,36.31762600),"
Central Park At Morning Star
1400 Sw Liberty Ave
Bentonville, AR 72712

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Park At Morning Star",'Bentonville=' + Bentonville.length); Decatur[Decatur.length] = createMarker(new GPoint(-94.45700073,36.33670044),"
Decatur Elementary School
P.o. Box 97
Decatur, AR 72722

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Decatur Elementary School",'Decatur=' + Decatur.length); Decatur[Decatur.length] = createMarker(new GPoint(-94.45700073,36.33670044),"
Decatur High School
P.o. Box 97
Decatur, AR 72722

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Decatur High School",'Decatur=' + Decatur.length); Decatur[Decatur.length] = createMarker(new GPoint(-94.46066800,36.33720900),"
Decatur Middle School
P.o. Box 97
Decatur, AR 72722

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Decatur Middle School",'Decatur=' + Decatur.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.10991669,36.31163788),"
Eastside Elementary School
505 E. New Hope Rd.
Rogers, AR 72756

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eastside Elementary School",'Rogers=' + Rogers.length); Bentonville[Bentonville.length] = createMarker(new GPoint(-94.24859619,36.37218094),"
Elm Tree Elementary School
101 Elm Tree Lane
Bentonville, AR 72712

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Elm Tree Elementary School",'Bentonville=' + Bentonville.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.13513184,36.31864548),"
Elmwood Jr. High School
1600 S. 13 St.
Rogers, AR 72756

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elmwood Jr. High School",'Rogers=' + Rogers.length); Lowell[Lowell.length] = createMarker(new GPoint(-94.12902500,36.19617800),"
Elza R. Tucker Elem. School
121 School Ave.
Lowell, AR 72745

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Elza R. Tucker Elem. School",'Lowell=' + Lowell.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.12336731,36.33226395),"
Frank Tillery Elementary School
621 W. Elm St.
Rogers, AR 72756

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Frank Tillery Elementary School",'Rogers=' + Rogers.length); Garfield[Garfield.length] = createMarker(new GPoint(-93.97360992,36.44766998),"
Garfield Elementary School
Highway 62 N.
Garfield, AR 72732

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Garfield=' + Garfield.length); Gentry[Gentry.length] = createMarker(new GPoint(-94.49427032,36.25801468),"
Gentry High School
201 S. Giles Ave.
Gentry, AR 72734

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gentry High School",'Gentry=' + Gentry.length); Gentry[Gentry.length] = createMarker(new GPoint(-94.48758698,36.26533890),"
Gentry Intermediate School
201 S. Giles Ave.
Gentry, AR 72734

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gentry Intermediate School",'Gentry=' + Gentry.length); Gentry[Gentry.length] = createMarker(new GPoint(-94.49436951,36.25687790),"
Gentry Middle School
201 S. Giles Ave.
Gentry, AR 72734

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Gentry Middle School",'Gentry=' + Gentry.length); Gentry[Gentry.length] = createMarker(new GPoint(-94.48758698,36.26533890),"
Gentry Primary School
201 S.giles Ave.
Gentry, AR 72734

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gentry Primary School",'Gentry=' + Gentry.length); Gravette[Gravette.length] = createMarker(new GPoint(-94.44776917,36.41704559),"
Glen A. Duffy Elementary School
601 El Paso St Se
Gravette, AR 72736

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glen A. Duffy Elementary School",'Gravette=' + Gravette.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.14321136,36.34230042),"
Grace Hill Elementary School
901 N. Dixieland Rd.
Rogers, AR 72756

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Grace Hill Elementary School",'Rogers=' + Rogers.length); Gravette[Gravette.length] = createMarker(new GPoint(-94.44631195,36.41846466),"
Gravette High School
607 Dallas St Se
Gravette, AR 72736

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gravette High School",'Gravette=' + Gravette.length); Gravette[Gravette.length] = createMarker(new GPoint(-94.44667053,36.41846466),"
Gravette Junior High School
605 Dallas St Se
Gravette, AR 72736

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Gravette Junior High School",'Gravette=' + Gravette.length); Gravette[Gravette.length] = createMarker(new GPoint(-94.44532776,36.41846466),"
Gravette Upper Elementary School
500 8th Ave Se
Gravette, AR 72736

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Gravette Upper Elementary School",'Gravette=' + Gravette.length); Springdale[Springdale.length] = createMarker(new GPoint(-94.16034300,36.20866700),"
Hunt Elementary School
3511 Silent Grove Rd
Springdale, AR 72762

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hunt Elementary School",'Springdale=' + Springdale.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.15189362,36.35033035),"
Joe Mathias Elementary School
1609 N. 24 St.
Rogers, AR 72756

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Joe Mathias Elementary School",'Rogers=' + Rogers.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.11789703,36.29922867),"
Jones Elementary School
2926 S. First St.
Rogers, AR 72756

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jones Elementary School",'Rogers=' + Rogers.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.11789703,36.29940414),"
Kirksey Middle School
2922 S. First St.
Rogers, AR 72756

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kirksey Middle School",'Rogers=' + Rogers.length); Bentonville[Bentonville.length] = createMarker(new GPoint(-94.21219635,36.38660812),"
Lincoln Junior High School
1206 Leopard Lane
Bentonville, AR 72712

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lincoln Junior High School",'Bentonville=' + Bentonville.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.13427734,36.34272003),"
Lingle Middle School
901 N. 13 St.
Rogers, AR 72756

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lingle Middle School",'Rogers=' + Rogers.length); Lowell[Lowell.length] = createMarker(new GPoint(-94.13448334,36.25783539),"
Lowell Elementary School
202 Mcclure Rd.
Lowell, AR 72745

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lowell Elementary School",'Lowell=' + Lowell.length); Bentonville[Bentonville.length] = createMarker(new GPoint(-94.20500100,36.35686000),"
Mary Mae Jones Elem. School
500 Se 14th Street
Bentonville, AR 72712

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mary Mae Jones Elem. School",'Bentonville=' + Bentonville.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.12213135,36.34102249),"
Northside Elementary School
807 N. Sixth St.
Rogers, AR 72756

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northside Elementary School",'Rogers=' + Rogers.length); Siloam_Springs[Siloam_Springs.length] = createMarker(new GPoint(-94.54557037,36.19014740),"
Northside Elementary School
501 West Elgin
Siloam Springs, AR 72761

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northside Elementary School",'Siloam_Springs=' + Siloam_Springs.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.14332581,36.33876038),"
Oakdale Jr. High School
1302 S Mountie Blvd
Rogers, AR 72758

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Oakdale Jr. High School",'Rogers=' + Rogers.length); Bentonville[Bentonville.length] = createMarker(new GPoint(-94.21246338,36.37313843),"
Old High Middle School
406 N W Second St
Bentonville, AR 72712

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Old High Middle School",'Bentonville=' + Bentonville.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.11068200,36.29443200),"
Old Wire Elementary School
3001 S. Old Wire Rd.
Rogers, AR 72756

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Old Wire Elementary School",'Rogers=' + Rogers.length); Pea_Ridge[Pea_Ridge.length] = createMarker(new GPoint(-94.12492371,36.45666122),"
Pea Ridge Elementary School
781 W. Pickens Road
Pea Ridge, AR 72751

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pea Ridge Elementary School",'Pea_Ridge=' + Pea_Ridge.length); Pea_Ridge[Pea_Ridge.length] = createMarker(new GPoint(-94.12492371,36.45666122),"
Pea Ridge High School
781 W. Pickens Road
Pea Ridge, AR 72751

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pea Ridge High School",'Pea_Ridge=' + Pea_Ridge.length); Pea_Ridge[Pea_Ridge.length] = createMarker(new GPoint(-94.12492371,36.45666122),"
Pea Ridge Middle School
781 W. Pickens Road
Pea Ridge, AR 72751

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pea Ridge Middle School",'Pea_Ridge=' + Pea_Ridge.length); Bentonville[Bentonville.length] = createMarker(new GPoint(-94.21149445,36.37498093),"
R.e. Baker Elementary School
301 Nw Third St
Bentonville, AR 72712

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("R.e. Baker Elementary School",'Bentonville=' + Bentonville.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.17380524,36.34191513),"
Reagan Elementary School
3904 W. Olive St.
Rogers, AR 72756

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Reagan Elementary School",'Rogers=' + Rogers.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.14467621,36.30116653),"
Rogers High School
1302 S Mountie Blvd
Rogers, AR 72758

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rogers High School",'Rogers=' + Rogers.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.12177277,36.32386017),"
Rogers High School Sophomore Campus
1114 S. Mountie Blvd
Rogers, AR 72756

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rogers High School Sophomore Campus",'Rogers=' + Rogers.length); Siloam_Springs[Siloam_Springs.length] = createMarker(new GPoint(-94.55748749,36.18172836),"
Siloam Springs High School
1500 West Jefferson
Siloam Springs, AR 72761

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Siloam Springs High School",'Siloam_Springs=' + Siloam_Springs.length); Siloam_Springs[Siloam_Springs.length] = createMarker(new GPoint(-94.54116821,36.19623566),"
Siloam Springs Middle School
1500 North Mt. Olive
Siloam Springs, AR 72761

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Siloam Springs Middle School",'Siloam_Springs=' + Siloam_Springs.length); Siloam_Springs[Siloam_Springs.length] = createMarker(new GPoint(-94.54267120,36.17786407),"
Southside East Elementary School
850 S. Wright
Siloam Springs, AR 72761

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southside East Elementary School",'Siloam_Springs=' + Siloam_Springs.length); Siloam_Springs[Siloam_Springs.length] = createMarker(new GPoint(-94.54453278,36.17747879),"
Southside West Elementary School
825 South Maple
Siloam Springs, AR 72761

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Southside West Elementary School",'Siloam_Springs=' + Siloam_Springs.length); Bentonville[Bentonville.length] = createMarker(new GPoint(-94.24142456,36.37191772),"
Spring Hill Middle School
3400 Highway 72w
Bentonville, AR 72712

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Spring Hill Middle School",'Bentonville=' + Bentonville.length); Bentonville[Bentonville.length] = createMarker(new GPoint(-94.21688843,36.38365555),"
Sugar Creek Elementary School
1102 Bella Vista Rd
Bentonville, AR 72712

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sugar Creek Elementary School",'Bentonville=' + Bentonville.length); Bentonville[Bentonville.length] = createMarker(new GPoint(-94.21712494,36.38157272),"
Thomas Jefferson Elementary School
810 Bella Vista Rd
Bentonville, AR 72712

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thomas Jefferson Elementary School",'Bentonville=' + Bentonville.length); Bentonville[Bentonville.length] = createMarker(new GPoint(-94.19180298,36.37312698),"
Washington Junior High School
1501 Ne Wildcat Way
Bentonville, AR 72712

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Washington Junior High School",'Bentonville=' + Bentonville.length); Rogers[Rogers.length] = createMarker(new GPoint(-94.14998627,36.32657623),"
Westside Elementary School
2200 W. Oak St.
Rogers, AR 72756

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westside Elementary School",'Rogers=' + Rogers.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(Bentonville); map.removeOverlays(Decatur); map.removeOverlays(Garfield); map.removeOverlays(Gentry); map.removeOverlays(Gravette); map.removeOverlays(Lowell); map.removeOverlays(Pea_Ridge); map.removeOverlays(Rogers); map.removeOverlays(Siloam_Springs); map.removeOverlays(Springdale); 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(Bentonville);map.removeOverlays(Bentonville); map.removeOverlays(Decatur); map.removeOverlays(Garfield); map.removeOverlays(Gentry); map.removeOverlays(Gravette); map.removeOverlays(Lowell); map.removeOverlays(Pea_Ridge); map.removeOverlays(Rogers); map.removeOverlays(Siloam_Springs); map.removeOverlays(Springdale); map.addOverlays(Bentonville); centerByArray(Bentonville, false, false); cntMarker += Bentonville.length; map.addOverlays(Decatur); centerByArray(Decatur, false, false); cntMarker += Decatur.length; map.addOverlays(Garfield); centerByArray(Garfield, false, false); cntMarker += Garfield.length; map.addOverlays(Gentry); centerByArray(Gentry, false, false); cntMarker += Gentry.length; map.addOverlays(Gravette); centerByArray(Gravette, false, false); cntMarker += Gravette.length; map.addOverlays(Lowell); centerByArray(Lowell, false, false); cntMarker += Lowell.length; map.addOverlays(Pea_Ridge); centerByArray(Pea_Ridge, false, false); cntMarker += Pea_Ridge.length; map.addOverlays(Rogers); centerByArray(Rogers, false, false); cntMarker += Rogers.length; map.addOverlays(Siloam_Springs); centerByArray(Siloam_Springs, false, false); cntMarker += Siloam_Springs.length; map.addOverlays(Springdale); centerByArray(Springdale, false, false); cntMarker += Springdale.length; centerByArray(Bentonville,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'); } }