function addMarkers() { mySelect = document.getElementById('selection'); Kennewick = [];Richland = [];Pasco = [];Prosser = [];Benton_City = [];Paterson = [];_Prosser_Ave = [];West_Richland = [];mySelect.options[mySelect.options.length] = new Option("Benton City schools",'all=Benton_City'); mySelect.options[mySelect.options.length] = new Option("Kennewick schools",'all=Kennewick'); mySelect.options[mySelect.options.length] = new Option("Pasco schools",'all=Pasco'); mySelect.options[mySelect.options.length] = new Option("Paterson schools",'all=Paterson'); mySelect.options[mySelect.options.length] = new Option("Prosser schools",'all=Prosser'); mySelect.options[mySelect.options.length] = new Option("Richland schools",'all=Richland'); mySelect.options[mySelect.options.length] = new Option("West Richland schools",'all=West_Richland'); mySelect.options[mySelect.options.length] = new Option(" Prosser Ave schools",'all=_Prosser_Ave'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.13143158,46.20583725),"
Amistad Elementary School
930 West 4th Avenue
Kennewick, WA 99336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Amistad Elementary School",'Kennewick=' + Kennewick.length); Richland[Richland.length] = createMarker(new GPoint(-119.26950073,46.23400116),"
Badger Mountain Elementary School
1515 Elementary Street
Richland, WA 99352

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Badger Mountain Elementary School",'Richland=' + Richland.length); Pasco[Pasco.length] = createMarker(new GPoint(-118.57599640,46.53578186),"
Benton-franklin Developmental Center
1215 W Lewis St
Pasco, WA 99301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Benton-franklin Developmental Center",'Pasco=' + Pasco.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.19476318,46.22369766),"
Benton/franklin Juvenile Justice Center
5606 West Canal Drive
Kennewick, WA 99336

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Benton/franklin Juvenile Justice Center",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.13418579,46.18856430),"
Canyon View Elementary School
1229 West 22nd Place
Kennewick, WA 99337

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Canyon View Elementary School",'Kennewick=' + Kennewick.length); Richland[Richland.length] = createMarker(new GPoint(-119.28990173,46.27298737),"
Carmichael Middle School
620 Thayer Drive
Richland, WA 99352

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Carmichael Middle School",'Richland=' + Richland.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.12570190,46.17297745),"
Cascade Elementary School
505 South Highland Drive
Kennewick, WA 99337

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cascade Elementary School",'Kennewick=' + Kennewick.length); Richland[Richland.length] = createMarker(new GPoint(-119.28206635,46.29568863),"
Chief Joseph Middle School
504 Wilson
Richland, WA 99352

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Chief Joseph Middle School",'Richland=' + Richland.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.20502472,46.19846344),"
Desert Hills Middle School
6011 West 10th Place
Kennewick, WA 99338

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Desert Hills Middle School",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.10392761,46.19806290),"
Eastgate Elementary School
910 East 10th Avebue
Kennewick, WA 99336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eastgate Elementary School",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.19049835,46.20818710),"
Edison Elementary School
201 South Dawes Street
Kennewick, WA 99336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edison Elementary School",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.05467224,46.14331818),"
Finley Elementary School
213504 E Cougar Rd
Kennewick, WA 99337

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Finley Elementary School",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.03409576,46.15555191),"
Finley Middle School
37208 S Finley Rd
Kennewick, WA 99337

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Finley Middle School",'Kennewick=' + Kennewick.length); Richland[Richland.length] = createMarker(new GPoint(-119.27203369,46.32413864),"
Hanford High School
450 Hanford Street
Richland, WA 99352

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hanford High School",'Richland=' + Richland.length); Richland[Richland.length] = createMarker(new GPoint(-119.26749420,46.32403564),"
Hanford Middle School
300 Hanford Street
Richland, WA 99352

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hanford Middle School",'Richland=' + Richland.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.16825104,46.21793747),"
Hawthorne Elementary School
3520 West John Day Avenue
Kennewick, WA 99336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hawthorne Elementary School",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.17803955,46.20589447),"
Highlands Middle School
425 South Tweedt Street
Kennewick, WA 99336

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Highlands Middle School",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.14869690,46.17756271),"
Horse Heaven Hills Middle School
3500 South Vancouver Street
Kennewick, WA 99337

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Horse Heaven Hills Middle School",'Kennewick=' + Kennewick.length); Prosser[Prosser.length] = createMarker(new GPoint(-119.75357819,46.20926285),"
Housel Middle School
2001 Highland Drive
Prosser, WA 99350

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Housel Middle School",'Prosser=' + Prosser.length); Richland[Richland.length] = createMarker(new GPoint(-119.29331207,46.29323578),"
Jason Lee Elementary School
1702 Van Giesen
Richland, WA 99352

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jason Lee Elementary School",'Richland=' + Richland.length); Richland[Richland.length] = createMarker(new GPoint(-119.27209473,46.29258728),"
Jefferson Elementary School
1525 Hunt Ave
Richland, WA 99352

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Richland=' + Richland.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.18630219,46.21548843),"
Kamiakin High School
600 North Arthur Street
Kennewick, WA 99336

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kamiakin High School",'Kennewick=' + Kennewick.length); Prosser[Prosser.length] = createMarker(new GPoint(-119.77518463,46.20053864),"
Keene-riverview Elementary School
832 Park Ave.
Prosser, WA 99350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Keene-riverview Elementary School",'Prosser=' + Prosser.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.12319946,46.20674515),"
Keewaydin Discovery Center
202 South Dayton Street
Kennewick, WA 99336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Keewaydin Discovery Center",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.11869812,46.20321274),"
Kennewick Alternative Education
200 South Fruitland
Kennewick, WA 99336

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kennewick Alternative Education",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.12319946,46.20377350),"
Kennewick High School
500 South Dayton Street
Kennewick, WA 99336

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kennewick High School",'Kennewick=' + Kennewick.length); Benton_City[Benton_City.length] = createMarker(new GPoint(-119.48918915,46.27076721),"
Kiona-benton City Elementary School
1107 Grace Avenue
Benton City, WA 99320

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kiona-benton City Elementary School",'Benton_City=' + Benton_City.length); Benton_City[Benton_City.length] = createMarker(new GPoint(-119.48918915,46.27076721),"
Kiona-benton City High School
1107 Grace Avenue
Benton City, WA 99320

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kiona-benton City High School",'Benton_City=' + Benton_City.length); Benton_City[Benton_City.length] = createMarker(new GPoint(-119.48918915,46.27076721),"
Kiona-benton City Middle School
1107 Grace Avenue
Benton City, WA 99320

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kiona-benton City Middle School",'Benton_City=' + Benton_City.length); Benton_City[Benton_City.length] = createMarker(new GPoint(-119.49013519,46.27086258),"
Kiona-benton Intermediate
1107 Grace Aveune
Benton City, WA 99320

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kiona-benton Intermediate",'Benton_City=' + Benton_City.length); Richland[Richland.length] = createMarker(new GPoint(-119.27719879,46.26983643),"
Lewis & Clark Elementary School
800 Downing
Richland, WA 99352

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lewis & Clark Elementary School",'Richland=' + Richland.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.17984009,46.18970108),"
Lincoln Elementary School
4901 West 21st Avenue
Kennewick, WA 99338

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Kennewick=' + Kennewick.length); Richland[Richland.length] = createMarker(new GPoint(-119.29437256,46.27239990),"
Marcus Whitman Elementary School
1704 Gray
Richland, WA 99352

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Marcus Whitman Elementary School",'Richland=' + Richland.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.28507996,46.21036148),"
Mid-columbia Parent Partnership Elementary School
200 S Fruitland St
Kennewick, WA 99336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mid-columbia Parent Partnership Elementary School",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.13208008,46.19836426),"
Park Middle School
1011 West 10th Avenue
Kennewick, WA 99336

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Park Middle School",'Kennewick=' + Kennewick.length); Paterson[Paterson.length] = createMarker(new GPoint(-119.62560272,45.93050003),"
Paterson Elementary School
51409 W. Prior Rd.
Paterson, WA 99345

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Paterson Elementary School",'Paterson=' + Paterson.length); Prosser[Prosser.length] = createMarker(new GPoint(-119.77101135,46.21169281),"
Prosser Falls Education Center
1500 Grant Ave.
Prosser, WA 99350

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Prosser Falls Education Center",'Prosser=' + Prosser.length); Prosser[Prosser.length] = createMarker(new GPoint(-119.75331116,46.21153641),"
Prosser Heights Elementary School
2008 Miller Ave.
Prosser, WA 99350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Prosser Heights Elementary School",'Prosser=' + Prosser.length); _Prosser_Ave[_Prosser_Ave.length] = createMarker(new GPoint(-119.76708984,46.20381927),"
Prosser High School
1203 Prosser Ave.
1203 Prosser Ave., WA 99350

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Prosser High School",'_Prosser_Ave=' + _Prosser_Ave.length); Richland[Richland.length] = createMarker(new GPoint(-119.28874969,46.27906418),"
Richland High School
930 Long Ave
Richland, WA 99352

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Richland High School",'Richland=' + Richland.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.21553040,46.19672775),"
Ridge View Elementary School
7001 West 13th Avenue
Kennewick, WA 99338

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ridge View Elementary School",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.03829956,46.15545273),"
River View High School
36509 S Lemon Dr
Kennewick, WA 99337

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("River View High School",'Kennewick=' + Kennewick.length); Richland[Richland.length] = createMarker(new GPoint(-119.27704620,46.27272034),"
Rivers Edge High School
975 Gillespie
Richland, WA 99352

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rivers Edge High School",'Richland=' + Richland.length); Richland[Richland.length] = createMarker(new GPoint(-119.27600861,46.30653763),"
Sacajawea Elementary School
518 Catskill
Richland, WA 99352

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sacajawea Elementary School",'Richland=' + Richland.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.16271210,46.19126129),"
Southgate Elementary School
3121 West 19th Avenue
Kennewick, WA 99337

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southgate Elementary School",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.18037415,46.18476868),"
Southridge High School
3320 South Union Loop
Kennewick, WA 99338

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southridge High School",'Kennewick=' + Kennewick.length); Richland[Richland.length] = createMarker(new GPoint(-119.27919769,46.24919891),"
Special Programs
615 Snow Ave.
Richland, WA 99352

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Special Programs",'Richland=' + Richland.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.23397827,46.21787262),"
Sunset View Elementary School
711 North Center Parkway
Kennewick, WA 99336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunset View Elementary School",'Kennewick=' + Kennewick.length); West_Richland[West_Richland.length] = createMarker(new GPoint(-119.36729431,46.30717468),"
Tapteal Elementary School
705 N 62nd Ave
West Richland, WA 99353

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tapteal Elementary School",'West_Richland=' + West_Richland.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.20006561,46.21956253),"
Tri City Area Vocational Skills Center
5929 West Metaline Avenue
Kennewick, WA 99336

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tri City Area Vocational Skills Center",'Kennewick=' + Kennewick.length); Richland[Richland.length] = createMarker(new GPoint(-119.27875519,46.30016327),"
Twin Rivers Group Home
605 Mcmurray
Richland, WA 99352

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Twin Rivers Group Home",'Richland=' + Richland.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.21849823,46.22819519),"
Vista Elementary School
1701 North Young Street
Kennewick, WA 99336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Vista Elementary School",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.11747742,46.18906403),"
Washington Elementary School
105 West 21st Avenue
Kennewick, WA 99337

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Kennewick=' + Kennewick.length); Kennewick[Kennewick.length] = createMarker(new GPoint(-119.15459442,46.20603561),"
Westgate Elementary School
2514 West 4th Avenue
Kennewick, WA 99336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westgate Elementary School",'Kennewick=' + Kennewick.length); Prosser[Prosser.length] = createMarker(new GPoint(-120.67600250,47.12440109),"
Whitstran Elementary School
102101 W. Foisy Road
Prosser, WA 99350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Whitstran Elementary School",'Prosser=' + Prosser.length); West_Richland[West_Richland.length] = createMarker(new GPoint(-119.35720062,46.27513504),"
Wiley Elementary School
2820 S Highlands Blvd
West Richland, WA 99353

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wiley Elementary School",'West_Richland=' + West_Richland.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(Benton_City); map.removeOverlays(Kennewick); map.removeOverlays(Pasco); map.removeOverlays(Paterson); map.removeOverlays(Prosser); map.removeOverlays(Richland); map.removeOverlays(West_Richland); map.removeOverlays(_Prosser_Ave); 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(Kennewick);map.removeOverlays(Benton_City); map.removeOverlays(Kennewick); map.removeOverlays(Pasco); map.removeOverlays(Paterson); map.removeOverlays(Prosser); map.removeOverlays(Richland); map.removeOverlays(West_Richland); map.removeOverlays(_Prosser_Ave); map.addOverlays(Benton_City); centerByArray(Benton_City, false, false); cntMarker += Benton_City.length; map.addOverlays(Kennewick); centerByArray(Kennewick, false, false); cntMarker += Kennewick.length; map.addOverlays(Pasco); centerByArray(Pasco, false, false); cntMarker += Pasco.length; map.addOverlays(Paterson); centerByArray(Paterson, false, false); cntMarker += Paterson.length; map.addOverlays(Prosser); centerByArray(Prosser, false, false); cntMarker += Prosser.length; map.addOverlays(Richland); centerByArray(Richland, false, false); cntMarker += Richland.length; map.addOverlays(West_Richland); centerByArray(West_Richland, false, false); cntMarker += West_Richland.length; map.addOverlays(_Prosser_Ave); centerByArray(_Prosser_Ave, false, false); cntMarker += _Prosser_Ave.length; centerByArray(Kennewick,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'); } }