function addMarkers() { mySelect = document.getElementById('selection'); Kelso = [];Longview = [];Carrolls = [];Castle_Rock = [];Kalama = [];Toutle = [];Woodland = [];Ariel = [];mySelect.options[mySelect.options.length] = new Option("Ariel schools",'all=Ariel'); mySelect.options[mySelect.options.length] = new Option("Carrolls schools",'all=Carrolls'); mySelect.options[mySelect.options.length] = new Option("Castle Rock schools",'all=Castle_Rock'); mySelect.options[mySelect.options.length] = new Option("Kalama schools",'all=Kalama'); mySelect.options[mySelect.options.length] = new Option("Kelso schools",'all=Kelso'); mySelect.options[mySelect.options.length] = new Option("Longview schools",'all=Longview'); mySelect.options[mySelect.options.length] = new Option("Toutle schools",'all=Toutle'); mySelect.options[mySelect.options.length] = new Option("Woodland schools",'all=Woodland'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Kelso[Kelso.length] = createMarker(new GPoint(-122.90819550,46.15943527),"
Barnes Elementary School
401 Barnes
Kelso, WA 98626

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Barnes Elementary School",'Kelso=' + Kelso.length); Longview[Longview.length] = createMarker(new GPoint(-122.92501831,46.17941666),"
Beacon Hill Elementary School
257 Alpha Dr
Longview, WA 98632

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Beacon Hill Elementary School",'Longview=' + Longview.length); Longview[Longview.length] = createMarker(new GPoint(-122.92711639,46.13738632),"
Broadway Learning Center
1410 8th Avenue
Longview, WA 98632

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Broadway Learning Center",'Longview=' + Longview.length); Kelso[Kelso.length] = createMarker(new GPoint(-122.89506531,46.15013885),"
Butler Acres Elementary School
1609 Burcham St
Kelso, WA 98626

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Butler Acres Elementary School",'Kelso=' + Kelso.length); Carrolls[Carrolls.length] = createMarker(new GPoint(-122.86219788,46.07220078),"
Carrolls Elementary School
Po Box 3
Carrolls, WA 98609

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carrolls Elementary School",'Carrolls=' + Carrolls.length); Longview[Longview.length] = createMarker(new GPoint(-122.93981171,46.15864944),"
Cascade Middle School
2821 Parkview Drive
Longview, WA 98632

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Cascade Middle School",'Longview=' + Longview.length); Castle_Rock[Castle_Rock.length] = createMarker(new GPoint(-122.90617371,46.27086639),"
Castle Rock Elementary School
700 Huntington Ave S
Castle Rock, WA 98611

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Castle Rock Elementary School",'Castle_Rock=' + Castle_Rock.length); Castle_Rock[Castle_Rock.length] = createMarker(new GPoint(-122.91951752,46.28173065),"
Castle Rock High School
5180 Westside Hwy
Castle Rock, WA 98611

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Castle Rock High School",'Castle_Rock=' + Castle_Rock.length); Castle_Rock[Castle_Rock.length] = createMarker(new GPoint(-122.90713501,46.27228165),"
Castle Rock Middle School
615 Front Ave Sw
Castle Rock, WA 98611

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Castle Rock Middle School",'Castle_Rock=' + Castle_Rock.length); Kelso[Kelso.length] = createMarker(new GPoint(-122.91860199,46.14935684),"
Catlin Elementary School
404 Long Ave
Kelso, WA 98626

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Catlin Elementary School",'Kelso=' + Kelso.length); Longview[Longview.length] = createMarker(new GPoint(-122.93941498,46.15865707),"
Columbia Heights Elementary School
2820 Parkview Drive
Longview, WA 98632

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Columbia Heights Elementary School",'Longview=' + Longview.length); Longview[Longview.length] = createMarker(new GPoint(-122.95813751,46.15452576),"
Columbia Valley Garden Elementary School
2644 30th Avenue
Longview, WA 98632

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Columbia Valley Garden Elementary School",'Longview=' + Longview.length); Kelso[Kelso.length] = createMarker(new GPoint(-122.89050293,46.14476395),"
Coweeman Junior High School
2000 Allen St
Kelso, WA 98626

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Coweeman Junior High School",'Kelso=' + Kelso.length); Longview[Longview.length] = createMarker(new GPoint(-122.91796112,46.14132309),"
Cowlitz Co Detention Center
1725 1st Ave
Longview, WA 98632

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cowlitz Co Detention Center",'Longview=' + Longview.length); Kelso[Kelso.length] = createMarker(new GPoint(-122.90599823,46.15396118),"
Huntington Junior High School
500 Redpath
Kelso, WA 98626

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Huntington Junior High School",'Kelso=' + Kelso.length); Kalama[Kalama.length] = createMarker(new GPoint(-122.83653259,46.00750732),"
Kalama Elementary School
548 China Garden Road
Kalama, WA 98625

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kalama Elementary School",'Kalama=' + Kalama.length); Kalama[Kalama.length] = createMarker(new GPoint(-122.83653259,46.00750732),"
Kalama Jr Senior High School
548 China Garden Road
Kalama, WA 98625

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kalama Jr Senior High School",'Kalama=' + Kalama.length); Kelso[Kelso.length] = createMarker(new GPoint(-122.89199829,46.14476395),"
Kelso High School
1904 Allen St
Kelso, WA 98626

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kelso High School",'Kelso=' + Kelso.length); Longview[Longview.length] = createMarker(new GPoint(-122.94539642,46.13031769),"
Kessler Elementary School
1902 E Kessler Blvd.
Longview, WA 98632

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kessler Elementary School",'Longview=' + Longview.length); Longview[Longview.length] = createMarker(new GPoint(-122.91960144,46.13873672),"
Longview Schl District Special Svcs Elementary School
1600 3rd Avenue
Longview, WA 98632

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Longview Schl District Special Svcs Elementary School",'Longview=' + Longview.length); Kelso[Kelso.length] = createMarker(new GPoint(-122.91107941,46.13087845),"
Loowit High School
2001 Allen St
Kelso, WA 98626

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Loowit High School",'Kelso=' + Kelso.length); Longview[Longview.length] = createMarker(new GPoint(-122.93495178,46.14458466),"
Mark Morris High School
1602 Mark Morris Court
Longview, WA 98632

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mark Morris High School",'Longview=' + Longview.length); Longview[Longview.length] = createMarker(new GPoint(-122.97407532,46.16476440),"
Mint Valley Elementary School
2745 38th Avenue
Longview, WA 98632

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mint Valley Elementary School",'Longview=' + Longview.length); Longview[Longview.length] = createMarker(new GPoint(-122.95770264,46.13809967),"
Monticello Middle School
1225 28th Avenue
Longview, WA 98632

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Monticello Middle School",'Longview=' + Longview.length); Longview[Longview.length] = createMarker(new GPoint(-123.02498900,46.16145800),"
Mt. Solo Middle School
5300 Mt. Solo Road
Longview, WA 98632

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mt. Solo Middle School",'Longview=' + Longview.length); Longview[Longview.length] = createMarker(new GPoint(-122.94406891,46.14487839),"
Northlake Elementary School
2210 Olympia Way
Longview, WA 98632

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northlake Elementary School",'Longview=' + Longview.length); Longview[Longview.length] = createMarker(new GPoint(-122.96210480,46.13936615),"
Olympic Elementary School
1324 30th Avenue
Longview, WA 98632

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Olympic Elementary School",'Longview=' + Longview.length); Longview[Longview.length] = createMarker(new GPoint(-122.95368958,46.13820648),"
R A Long High School
2903 Nichols Blvd.
Longview, WA 98632

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("R A Long High School",'Longview=' + Longview.length); Longview[Longview.length] = createMarker(new GPoint(-122.99299622,46.17074966),"
Robert Gray Elementary School
4622 Ohio Street
Longview, WA 98632

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robert Gray Elementary School",'Longview=' + Longview.length); Kelso[Kelso.length] = createMarker(new GPoint(-122.82289124,46.10659409),"
Rose Valley Elementary School
1502 Rose Valley Rd
Kelso, WA 98626

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rose Valley Elementary School",'Kelso=' + Kelso.length); Longview[Longview.length] = createMarker(new GPoint(-122.95949554,46.12801743),"
Saint Helens Elementary School
431 27th Avenue
Longview, WA 98632

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Saint Helens Elementary School",'Longview=' + Longview.length); Kelso[Kelso.length] = createMarker(new GPoint(-122.90605164,46.14719391),"
Special Education Home & Hospital
601 Crawford St
Kelso, WA 98626

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Special Education Home & Hospital",'Kelso=' + Kelso.length); Longview[Longview.length] = createMarker(new GPoint(-122.98209381,46.14886856),"
Structured Learning Center
3602 Memorial Park Drive
Longview, WA 98632

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Structured Learning Center",'Longview=' + Longview.length); Toutle[Toutle.length] = createMarker(new GPoint(-122.74101257,46.32317352),"
Toutle Lake Elementary School
5050 Spirit Lake Hwy
Toutle, WA 98649

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Toutle Lake Elementary School",'Toutle=' + Toutle.length); Toutle[Toutle.length] = createMarker(new GPoint(-122.74101257,46.32317352),"
Toutle Lake High School
5050 Spirit Lake Hwy
Toutle, WA 98649

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Toutle Lake High School",'Toutle=' + Toutle.length); Kelso[Kelso.length] = createMarker(new GPoint(-122.91249847,46.13501740),"
Wallace Elementary School
410 Elm St
Kelso, WA 98626

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wallace Elementary School",'Kelso=' + Kelso.length); Woodland[Woodland.length] = createMarker(new GPoint(-122.74990082,45.90315247),"
Woodland Alternative School
600 Bozarth
Woodland, WA 98674

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodland Alternative School",'Woodland=' + Woodland.length); Woodland[Woodland.length] = createMarker(new GPoint(-122.74820709,45.90342331),"
Woodland High School
757 Park
Woodland, WA 98674

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodland High School",'Woodland=' + Woodland.length); Woodland[Woodland.length] = createMarker(new GPoint(-122.72273254,45.92732239),"
Woodland Intermediate School
2250 Lewis River Road
Woodland, WA 98674

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodland Intermediate School",'Woodland=' + Woodland.length); Woodland[Woodland.length] = createMarker(new GPoint(-122.74820709,45.90339661),"
Woodland Middle School
755 Park Street
Woodland, WA 98674

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Woodland Middle School",'Woodland=' + Woodland.length); Woodland[Woodland.length] = createMarker(new GPoint(-122.75155640,45.90193558),"
Woodland Primary
600 Bozarth
Woodland, WA 98674

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodland Primary",'Woodland=' + Woodland.length); Ariel[Ariel.length] = createMarker(new GPoint(-122.74166107,45.90615845),"
Yale Elementary School
11842 Lewis River Road
Ariel, WA 98603

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Yale Elementary School",'Ariel=' + Ariel.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(Ariel); map.removeOverlays(Carrolls); map.removeOverlays(Castle_Rock); map.removeOverlays(Kalama); map.removeOverlays(Kelso); map.removeOverlays(Longview); map.removeOverlays(Toutle); map.removeOverlays(Woodland); 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(Kelso);map.removeOverlays(Ariel); map.removeOverlays(Carrolls); map.removeOverlays(Castle_Rock); map.removeOverlays(Kalama); map.removeOverlays(Kelso); map.removeOverlays(Longview); map.removeOverlays(Toutle); map.removeOverlays(Woodland); map.addOverlays(Ariel); centerByArray(Ariel, false, false); cntMarker += Ariel.length; map.addOverlays(Carrolls); centerByArray(Carrolls, false, false); cntMarker += Carrolls.length; map.addOverlays(Castle_Rock); centerByArray(Castle_Rock, false, false); cntMarker += Castle_Rock.length; map.addOverlays(Kalama); centerByArray(Kalama, false, false); cntMarker += Kalama.length; map.addOverlays(Kelso); centerByArray(Kelso, false, false); cntMarker += Kelso.length; map.addOverlays(Longview); centerByArray(Longview, false, false); cntMarker += Longview.length; map.addOverlays(Toutle); centerByArray(Toutle, false, false); cntMarker += Toutle.length; map.addOverlays(Woodland); centerByArray(Woodland, false, false); cntMarker += Woodland.length; centerByArray(Kelso,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'); } }