function addMarkers() { mySelect = document.getElementById('selection'); Hartline = [];Ephrata = [];Moses_Lake = [];Coulee_City = [];Mattawa = [];Quincy = [];Grand_Coulee = [];Omak = [];Royal_City = [];Soap_Lake = [];Warden = [];Wilson_Creek = [];mySelect.options[mySelect.options.length] = new Option("Coulee City schools",'all=Coulee_City'); mySelect.options[mySelect.options.length] = new Option("Ephrata schools",'all=Ephrata'); mySelect.options[mySelect.options.length] = new Option("Grand Coulee schools",'all=Grand_Coulee'); mySelect.options[mySelect.options.length] = new Option("Hartline schools",'all=Hartline'); mySelect.options[mySelect.options.length] = new Option("Mattawa schools",'all=Mattawa'); mySelect.options[mySelect.options.length] = new Option("Moses Lake schools",'all=Moses_Lake'); mySelect.options[mySelect.options.length] = new Option("Omak schools",'all=Omak'); mySelect.options[mySelect.options.length] = new Option("Quincy schools",'all=Quincy'); mySelect.options[mySelect.options.length] = new Option("Royal City schools",'all=Royal_City'); mySelect.options[mySelect.options.length] = new Option("Soap Lake schools",'all=Soap_Lake'); mySelect.options[mySelect.options.length] = new Option("Warden schools",'all=Warden'); mySelect.options[mySelect.options.length] = new Option("Wilson Creek schools",'all=Wilson_Creek'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Hartline[Hartline.length] = createMarker(new GPoint(-119.10845947,47.68798065),"
Almira Coulee Hartline High School
P.o. Box 98
Hartline, WA 99135

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Almira Coulee Hartline High School",'Hartline=' + Hartline.length); Ephrata[Ephrata.length] = createMarker(new GPoint(-119.54967499,47.32619095),"
Beezley Springs Elementary School
501 C St Nw
Ephrata, WA 98823

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Beezley Springs Elementary School",'Ephrata=' + Ephrata.length); Moses_Lake[Moses_Lake.length] = createMarker(new GPoint(-119.25996399,47.11636353),"
Chief Moses Middle School
1111 E Nelson Road
Moses Lake, WA 98837

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Chief Moses Middle School",'Moses_Lake=' + Moses_Lake.length); Moses_Lake[Moses_Lake.length] = createMarker(new GPoint(-119.28919983,47.12435532),"
Columbia Basin Secondary School
7942 Randolph Road N.e.
Moses Lake, WA 98837

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Columbia Basin Secondary School",'Moses_Lake=' + Moses_Lake.length); Ephrata[Ephrata.length] = createMarker(new GPoint(-119.53969574,47.31749344),"
Columbia Ridge Elementary School
60 H Se
Ephrata, WA 98823

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Columbia Ridge Elementary School",'Ephrata=' + Ephrata.length); Coulee_City[Coulee_City.length] = createMarker(new GPoint(-119.29234314,47.61343765),"
Coulee City Elementary School
Po Box 428
Coulee City, WA 99115

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Coulee City Elementary School",'Coulee_City=' + Coulee_City.length); Coulee_City[Coulee_City.length] = createMarker(new GPoint(-119.28746200,47.61234900),"
Coulee City MiddleSchool
P.o. Box 428
Coulee City, WA 99115

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Coulee City MiddleSchool",'Coulee_City=' + Coulee_City.length); Mattawa[Mattawa.length] = createMarker(new GPoint(-119.90071300,46.73690300),"
Developmental Pre-school
400 N. Boundary
Mattawa, WA 99349

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Developmental Pre-school",'Mattawa=' + Mattawa.length); Quincy[Quincy.length] = createMarker(new GPoint(-119.85293579,47.23083878),"
Early Childhood Learning Center
21 J St Se
Quincy, WA 98848

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Early Childhood Learning Center",'Quincy=' + Quincy.length); Ephrata[Ephrata.length] = createMarker(new GPoint(-119.55136871,47.32553864),"
Ephrata High School
499 C Street Nw
Ephrata, WA 98823

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ephrata High School",'Ephrata=' + Ephrata.length); Ephrata[Ephrata.length] = createMarker(new GPoint(-119.55124900,47.31867500),"
Ephrata Middle School
384 ''a'' Se
Ephrata, WA 98823

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ephrata Middle School",'Ephrata=' + Ephrata.length); Moses_Lake[Moses_Lake.length] = createMarker(new GPoint(-119.28317261,47.12747192),"
Frontier Middle School
517 West Third Avenue
Moses Lake, WA 98837

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Frontier Middle School",'Moses_Lake=' + Moses_Lake.length); Moses_Lake[Moses_Lake.length] = createMarker(new GPoint(-119.26732635,47.11636353),"
Garden Heights Elementary School
707 E Nelson Road
Moses Lake, WA 98837

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Garden Heights Elementary School",'Moses_Lake=' + Moses_Lake.length); Quincy[Quincy.length] = createMarker(new GPoint(-119.85610199,47.08514786),"
George Elementary School
101 S. Washington Way
Quincy, WA 98848

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George Elementary School",'Quincy=' + Quincy.length); Grand_Coulee[Grand_Coulee.length] = createMarker(new GPoint(-119.00524139,47.93834305),"
Grand Coulee Dam Middle School
Box J
Grand Coulee, WA 99133

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Grand Coulee Dam Middle School",'Grand_Coulee=' + Grand_Coulee.length); Ephrata[Ephrata.length] = createMarker(new GPoint(-119.56040192,47.32187271),"
Grant Co Detention Center
303 Able Rd
Ephrata, WA 98823

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grant Co Detention Center",'Ephrata=' + Ephrata.length); Ephrata[Ephrata.length] = createMarker(new GPoint(-119.55281830,47.32485962),"
Grant Elementary School
451 3rd Nw
Ephrata, WA 98823

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Grant Elementary School",'Ephrata=' + Ephrata.length); Moses_Lake[Moses_Lake.length] = createMarker(new GPoint(-119.28510284,47.13464737),"
Knolls Vista Elementary School
454 W Ridge Road
Moses Lake, WA 98837

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Knolls Vista Elementary School",'Moses_Lake=' + Moses_Lake.length); Moses_Lake[Moses_Lake.length] = createMarker(new GPoint(-119.25730133,47.12410736),"
Lakeview Terrace Elementary School
780 S. Clover Drive
Moses Lake, WA 98837

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lakeview Terrace Elementary School",'Moses_Lake=' + Moses_Lake.length); Moses_Lake[Moses_Lake.length] = createMarker(new GPoint(-119.32449341,47.16728210),"
Larson Heights Elementary School
700 Lindberg Lane
Moses Lake, WA 98837

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Larson Heights Elementary School",'Moses_Lake=' + Moses_Lake.length); Moses_Lake[Moses_Lake.length] = createMarker(new GPoint(-119.28030396,47.15250397),"
Longview Elementary School
9783 Apple Road Ne
Moses Lake, WA 98837

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Longview Elementary School",'Moses_Lake=' + Moses_Lake.length); Mattawa[Mattawa.length] = createMarker(new GPoint(-119.89630127,46.73926544),"
Mattawa Elementary School
P.o. Box 907
Mattawa, WA 99349

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mattawa Elementary School",'Mattawa=' + Mattawa.length); Moses_Lake[Moses_Lake.length] = createMarker(new GPoint(-119.28998566,47.12006378),"
Midway Middle School
502 S C Street
Moses Lake, WA 98837

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Midway Middle School",'Moses_Lake=' + Moses_Lake.length); Moses_Lake[Moses_Lake.length] = createMarker(new GPoint(-119.28998566,47.12006378),"
Mlc/discover Elementary School
502 South C St
Moses Lake, WA 98837

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mlc/discover Elementary School",'Moses_Lake=' + Moses_Lake.length); Quincy[Quincy.length] = createMarker(new GPoint(-119.87519836,47.23503113),"
Monument Elementary School
1400 13th Ave. Sw
Quincy, WA 98848

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Monument Elementary School",'Quincy=' + Quincy.length); Mattawa[Mattawa.length] = createMarker(new GPoint(-119.89630127,46.73985291),"
Morris Schott Middle School
P.o. Box 907
Mattawa, WA 99349

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Morris Schott Middle School",'Mattawa=' + Mattawa.length); Moses_Lake[Moses_Lake.length] = createMarker(new GPoint(-119.26407623,47.11266327),"
Moses Lake High School
803 E. Sharon Ave.
Moses Lake, WA 98837

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Moses Lake High School",'Moses_Lake=' + Moses_Lake.length); Quincy[Quincy.length] = createMarker(new GPoint(-119.85686493,47.24153519),"
Mountain View Elementary School
119 D St Nw
Quincy, WA 98848

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mountain View Elementary School",'Quincy=' + Quincy.length); Moses_Lake[Moses_Lake.length] = createMarker(new GPoint(-119.32856750,47.17761230),"
North Elementary School
1200 West Craig Street
Moses Lake, WA 98837

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Elementary School",'Moses_Lake=' + Moses_Lake.length); Omak[Omak.length] = createMarker(new GPoint(-119.52845800,48.41088100),"
Okanogan Alternative School
Po Box 592
Omak, WA 98841

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Okanogan Alternative School",'Omak=' + Omak.length); Ephrata[Ephrata.length] = createMarker(new GPoint(-119.56050110,47.31209183),"
Parkway School
1011 Parkway Blvd
Ephrata, WA 98823

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Parkway School",'Ephrata=' + Ephrata.length); Moses_Lake[Moses_Lake.length] = createMarker(new GPoint(-119.30300903,47.10593033),"
Peninsula Elementary School
2406 W. Texas Street
Moses Lake, WA 98837

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Peninsula Elementary School",'Moses_Lake=' + Moses_Lake.length); Quincy[Quincy.length] = createMarker(new GPoint(-119.84944153,47.23016357),"
Pioneer Elementary School
224 J Street S.e.
Quincy, WA 98848

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pioneer Elementary School",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-119.84249878,47.23788071),"
Quincy High School
16 Sixth Ave. S.e.
Quincy, WA 98848

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Quincy High School",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-119.85492800,47.23436000),"
Quincy High Tech High School
404 1st Ave Sw
Quincy, WA 98848

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Quincy High Tech High School",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-119.84592438,47.23555756),"
Quincy Junior High School
417 C Street Se
Quincy, WA 98848

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Quincy Junior High School",'Quincy=' + Quincy.length); Royal_City[Royal_City.length] = createMarker(new GPoint(-119.62854004,46.90127945),"
Red Rock Elementary School
Po Box 486
Royal City, WA 99357

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Red Rock Elementary School",'Royal_City=' + Royal_City.length); Royal_City[Royal_City.length] = createMarker(new GPoint(-119.62847900,46.90031815),"
Royal High School
Po Box 486
Royal City, WA 99357

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Royal High School",'Royal_City=' + Royal_City.length); Royal_City[Royal_City.length] = createMarker(new GPoint(-119.62847900,46.90031815),"
Royal Middle School
921 Ahlers Road
Royal City, WA 99357

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Royal Middle School",'Royal_City=' + Royal_City.length); Mattawa[Mattawa.length] = createMarker(new GPoint(-119.89997864,46.74110031),"
Saddle Mountain Intermediate
P.o. Box 907
Mattawa, WA 99349

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Saddle Mountain Intermediate",'Mattawa=' + Mattawa.length); Mattawa[Mattawa.length] = createMarker(new GPoint(-119.94547272,46.73763657),"
Sentinel Technical Alt School
P.o. Box 907
Mattawa, WA 99349

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sentinel Technical Alt School",'Mattawa=' + Mattawa.length); Grand_Coulee[Grand_Coulee.length] = createMarker(new GPoint(-119.00710297,47.94160080),"
Skilskin High School
Box F
Grand Coulee, WA 99133

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Skilskin High School",'Grand_Coulee=' + Grand_Coulee.length); Soap_Lake[Soap_Lake.length] = createMarker(new GPoint(-119.48826599,47.38953781),"
Smokiam Alternative High School
Po Box 1269
Soap Lake, WA 98851

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Smokiam Alternative High School",'Soap_Lake=' + Soap_Lake.length); Soap_Lake[Soap_Lake.length] = createMarker(new GPoint(-119.49799347,47.38531113),"
Soap Lake Elementary School
Po Box 908
Soap Lake, WA 98851

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Soap Lake Elementary School",'Soap_Lake=' + Soap_Lake.length); Soap_Lake[Soap_Lake.length] = createMarker(new GPoint(-119.49778748,47.38706207),"
Soap Lake Middle & High School
Po Box 878
Soap Lake, WA 98851

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Soap Lake Middle & High School",'Soap_Lake=' + Soap_Lake.length); Mattawa[Mattawa.length] = createMarker(new GPoint(-119.89630127,46.73985672),"
Wahluke High School
P.o. Box 907
Mattawa, WA 99349

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wahluke High School",'Mattawa=' + Mattawa.length); Warden[Warden.length] = createMarker(new GPoint(-119.04380035,46.96263504),"
Warden Elementary School
101 W. Beck Way
Warden, WA 98857

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Warden Elementary School",'Warden=' + Warden.length); Warden[Warden.length] = createMarker(new GPoint(-119.04380035,46.96263504),"
Warden High School
101 W. Beck Way
Warden, WA 98857

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Warden High School",'Warden=' + Warden.length); Warden[Warden.length] = createMarker(new GPoint(-119.04380035,46.96263504),"
Warden Middle School
101 W. Beck Way
Warden, WA 98857

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Warden Middle School",'Warden=' + Warden.length); Wilson_Creek[Wilson_Creek.length] = createMarker(new GPoint(-119.12200165,47.42350006),"
Wilson Creek Elementary School
Po Box 46
Wilson Creek, WA 98860

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wilson Creek Elementary School",'Wilson_Creek=' + Wilson_Creek.length); Wilson_Creek[Wilson_Creek.length] = createMarker(new GPoint(-119.12102509,47.42546463),"
Wilson Creek High School
P.o. Box 46
Wilson Creek, WA 98860

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wilson Creek High School",'Wilson_Creek=' + Wilson_Creek.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(Coulee_City); map.removeOverlays(Ephrata); map.removeOverlays(Grand_Coulee); map.removeOverlays(Hartline); map.removeOverlays(Mattawa); map.removeOverlays(Moses_Lake); map.removeOverlays(Omak); map.removeOverlays(Quincy); map.removeOverlays(Royal_City); map.removeOverlays(Soap_Lake); map.removeOverlays(Warden); map.removeOverlays(Wilson_Creek); 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(Hartline);map.removeOverlays(Coulee_City); map.removeOverlays(Ephrata); map.removeOverlays(Grand_Coulee); map.removeOverlays(Hartline); map.removeOverlays(Mattawa); map.removeOverlays(Moses_Lake); map.removeOverlays(Omak); map.removeOverlays(Quincy); map.removeOverlays(Royal_City); map.removeOverlays(Soap_Lake); map.removeOverlays(Warden); map.removeOverlays(Wilson_Creek); map.addOverlays(Coulee_City); centerByArray(Coulee_City, false, false); cntMarker += Coulee_City.length; map.addOverlays(Ephrata); centerByArray(Ephrata, false, false); cntMarker += Ephrata.length; map.addOverlays(Grand_Coulee); centerByArray(Grand_Coulee, false, false); cntMarker += Grand_Coulee.length; map.addOverlays(Hartline); centerByArray(Hartline, false, false); cntMarker += Hartline.length; map.addOverlays(Mattawa); centerByArray(Mattawa, false, false); cntMarker += Mattawa.length; map.addOverlays(Moses_Lake); centerByArray(Moses_Lake, false, false); cntMarker += Moses_Lake.length; map.addOverlays(Omak); centerByArray(Omak, false, false); cntMarker += Omak.length; map.addOverlays(Quincy); centerByArray(Quincy, false, false); cntMarker += Quincy.length; map.addOverlays(Royal_City); centerByArray(Royal_City, false, false); cntMarker += Royal_City.length; map.addOverlays(Soap_Lake); centerByArray(Soap_Lake, false, false); cntMarker += Soap_Lake.length; map.addOverlays(Warden); centerByArray(Warden, false, false); cntMarker += Warden.length; map.addOverlays(Wilson_Creek); centerByArray(Wilson_Creek, false, false); cntMarker += Wilson_Creek.length; centerByArray(Hartline,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'); } }