function addMarkers() { mySelect = document.getElementById('selection'); Walla_Walla = [];Burbank = [];College_Place = [];Dixie = [];Prescott = [];Waitsburg = [];Touchet = [];mySelect.options[mySelect.options.length] = new Option("Burbank schools",'all=Burbank'); mySelect.options[mySelect.options.length] = new Option("College Place schools",'all=College_Place'); mySelect.options[mySelect.options.length] = new Option("Dixie schools",'all=Dixie'); mySelect.options[mySelect.options.length] = new Option("Prescott schools",'all=Prescott'); mySelect.options[mySelect.options.length] = new Option("Touchet schools",'all=Touchet'); mySelect.options[mySelect.options.length] = new Option("Waitsburg schools",'all=Waitsburg'); mySelect.options[mySelect.options.length] = new Option("Walla Walla schools",'all=Walla_Walla'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.30005646,46.06196213),"
Berney Elementary School
1718 Pleasant St
Walla Walla, WA 99362

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Berney Elementary School",'Walla_Walla=' + Walla_Walla.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.35354614,46.05457306),"
Blue Ridge Elementary School
1150 W Chestnut St
Walla Walla, WA 99362

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Blue Ridge Elementary School",'Walla_Walla=' + Walla_Walla.length); Burbank[Burbank.length] = createMarker(new GPoint(-118.99291992,46.20072174),"
Columbia Elementary School
977 Maple Street
Burbank, WA 99323

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Columbia Elementary School",'Burbank=' + Burbank.length); Burbank[Burbank.length] = createMarker(new GPoint(-118.99555206,46.20093536),"
Columbia High School
787 Maple Street
Burbank, WA 99323

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Columbia High School",'Burbank=' + Burbank.length); Burbank[Burbank.length] = createMarker(new GPoint(-118.99427795,46.20091248),"
Columbia Middle School
835 Maple Street
Burbank, WA 99323

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Columbia Middle School",'Burbank=' + Burbank.length); College_Place[College_Place.length] = createMarker(new GPoint(-118.38673401,46.04763794),"
Davis Elementary School
31 Se Ash Street
College Place, WA 99324

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Davis Elementary School",'College_Place=' + College_Place.length); Dixie[Dixie.length] = createMarker(new GPoint(-118.15409851,46.14020157),"
Dixie Elementary School
Po Box 40
Dixie, WA 99329

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dixie Elementary School",'Dixie=' + Dixie.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.31064606,46.06773758),"
Edison Elementary School
1315 E Alder St
Walla Walla, WA 99362

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edison Elementary School",'Walla_Walla=' + Walla_Walla.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.34079742,46.05459595),"
Garrison Middle School
906 Chase St
Walla Walla, WA 99362

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Garrison Middle School",'Walla_Walla=' + Walla_Walla.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.32354736,46.07376480),"
Green Park Elementary School
1105 E Isaacs Ave
Walla Walla, WA 99362

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Green Park Elementary School",'Walla_Walla=' + Walla_Walla.length); College_Place[College_Place.length] = createMarker(new GPoint(-118.38853455,46.03105545),"
John Sager Middle School
1755 South College Avenue
College Place, WA 99324

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("John Sager Middle School",'College_Place=' + College_Place.length); College_Place[College_Place.length] = createMarker(new GPoint(-118.38859558,46.02949142),"
Meadow Brook School
1775 South College Avenue
College Place, WA 99324

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Meadow Brook School",'College_Place=' + College_Place.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.33226013,46.05541992),"
Opportunity Program High School
919 S. 2nd
Walla Walla, WA 99362

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Opportunity Program High School",'Walla_Walla=' + Walla_Walla.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.33779907,46.05913162),"
Paine Campus (homelink) Elementary School
421 S. 4th Ave
Walla Walla, WA 99362

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Paine Campus (homelink) Elementary School",'Walla_Walla=' + Walla_Walla.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.33779907,46.05913162),"
Paine Campus Aep High School
421 S. 4th Ave
Walla Walla, WA 99362

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Paine Campus Aep High School",'Walla_Walla=' + Walla_Walla.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.33779907,46.05913162),"
Paine Campus High School
421 S 4th Ave
Walla Walla, WA 99362

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Paine Campus High School",'Walla_Walla=' + Walla_Walla.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.34236900,46.07038000),"
Paine Campus Homelink
421 S. 4th Ave
Walla Walla, WA 99362

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Paine Campus Homelink",'Walla_Walla=' + Walla_Walla.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.33362100,46.05761600),"
Pathways Back
919 S Second Ave
Walla Walla, WA 99362

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pathways Back",'Walla_Walla=' + Walla_Walla.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.30975342,46.06495285),"
Pioneer Middle School
450 Bridge St
Walla Walla, WA 99362

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pioneer Middle School",'Walla_Walla=' + Walla_Walla.length); Prescott[Prescott.length] = createMarker(new GPoint(-118.47920227,46.39659882),"
Prescott Elementary School
Po Box 65
Prescott, WA 99348

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Prescott Elementary School",'Prescott=' + Prescott.length); Prescott[Prescott.length] = createMarker(new GPoint(-118.47920227,46.39659882),"
Prescott Junior Senior High School
P O Box 65
Prescott, WA 99348

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Prescott Junior Senior High School",'Prescott=' + Prescott.length); Waitsburg[Waitsburg.length] = createMarker(new GPoint(-118.13739777,46.21189880),"
Preston Hall Middle School
605 Main Street
Waitsburg, WA 99361

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Preston Hall Middle School",'Waitsburg=' + Waitsburg.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.32390594,46.04146576),"
Prospect Point Elementary School
55 Reser Rd
Walla Walla, WA 99362

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Prospect Point Elementary School",'Walla_Walla=' + Walla_Walla.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.32529449,46.06470108),"
Sharpstein Elementary School
410 Howard St
Walla Walla, WA 99362

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sharpstein Elementary School",'Walla_Walla=' + Walla_Walla.length); Touchet[Touchet.length] = createMarker(new GPoint(-118.67159271,46.03971863),"
Touchet Elementary & High School
Touchet School District
Touchet, WA 99360

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Touchet Elementary & High School",'Touchet=' + Touchet.length); Waitsburg[Waitsburg.length] = createMarker(new GPoint(-118.15361786,46.26697922),"
Waitsburg Elementary School
184 Academy
Waitsburg, WA 99361

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Waitsburg Elementary School",'Waitsburg=' + Waitsburg.length); Waitsburg[Waitsburg.length] = createMarker(new GPoint(-118.15309906,46.26763153),"
Waitsburg High School
421 Coppei Ave
Waitsburg, WA 99361

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Waitsburg High School",'Waitsburg=' + Waitsburg.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.34591675,46.06511307),"
Walla Walla County Juvenile Detention High School
455 W. Rose Street
Walla Walla, WA 99362

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Walla Walla County Juvenile Detention High School",'Walla_Walla=' + Walla_Walla.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.31729126,46.04571533),"
Walla Walla High School
800 Abbott Rd
Walla Walla, WA 99362

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Walla Walla High School",'Walla_Walla=' + Walla_Walla.length); Walla_Walla[Walla_Walla.length] = createMarker(new GPoint(-118.35354614,46.05457306),"
Walla Walla Public Child Dev Center
1150 W Chestnut
Walla Walla, WA 99362

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Walla Walla Public Child Dev Center",'Walla_Walla=' + Walla_Walla.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(Burbank); map.removeOverlays(College_Place); map.removeOverlays(Dixie); map.removeOverlays(Prescott); map.removeOverlays(Touchet); map.removeOverlays(Waitsburg); map.removeOverlays(Walla_Walla); 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(Walla_Walla);map.removeOverlays(Burbank); map.removeOverlays(College_Place); map.removeOverlays(Dixie); map.removeOverlays(Prescott); map.removeOverlays(Touchet); map.removeOverlays(Waitsburg); map.removeOverlays(Walla_Walla); map.addOverlays(Burbank); centerByArray(Burbank, false, false); cntMarker += Burbank.length; map.addOverlays(College_Place); centerByArray(College_Place, false, false); cntMarker += College_Place.length; map.addOverlays(Dixie); centerByArray(Dixie, false, false); cntMarker += Dixie.length; map.addOverlays(Prescott); centerByArray(Prescott, false, false); cntMarker += Prescott.length; map.addOverlays(Touchet); centerByArray(Touchet, false, false); cntMarker += Touchet.length; map.addOverlays(Waitsburg); centerByArray(Waitsburg, false, false); cntMarker += Waitsburg.length; map.addOverlays(Walla_Walla); centerByArray(Walla_Walla, false, false); cntMarker += Walla_Walla.length; centerByArray(Walla_Walla,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'); } }