function addMarkers() { mySelect = document.getElementById('selection'); South_Bend = [];Raymond = [];Ilwaco = [];Long_Beach = [];Menlo = [];Naselle = [];Ocean_Park = [];mySelect.options[mySelect.options.length] = new Option("Ilwaco schools",'all=Ilwaco'); mySelect.options[mySelect.options.length] = new Option("Long Beach schools",'all=Long_Beach'); mySelect.options[mySelect.options.length] = new Option("Menlo schools",'all=Menlo'); mySelect.options[mySelect.options.length] = new Option("Naselle schools",'all=Naselle'); mySelect.options[mySelect.options.length] = new Option("Ocean Park schools",'all=Ocean_Park'); mySelect.options[mySelect.options.length] = new Option("Raymond schools",'all=Raymond'); mySelect.options[mySelect.options.length] = new Option("South Bend schools",'all=South_Bend'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); South_Bend[South_Bend.length] = createMarker(new GPoint(-123.79069519,46.66216278),"
Chauncey Davis Elementary School
Po Box 437
South Bend, WA 98586

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chauncey Davis Elementary School",'South_Bend=' + South_Bend.length); Raymond[Raymond.length] = createMarker(new GPoint(-123.73200226,46.68576431),"
Community Learning Op Center (cloc)
303 4th St
Raymond, WA 98577

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Community Learning Op Center (cloc)",'Raymond=' + Raymond.length); Raymond[Raymond.length] = createMarker(new GPoint(-123.72950400,46.68752000),"
Developmental Preschool
1016 Commercial Street
Raymond, WA 98577

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Developmental Preschool",'Raymond=' + Raymond.length); Ilwaco[Ilwaco.length] = createMarker(new GPoint(-124.03901672,46.31241989),"
Hilltop Elementary School
Po Box 860
Ilwaco, WA 98624

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hilltop Elementary School",'Ilwaco=' + Ilwaco.length); Long_Beach[Long_Beach.length] = createMarker(new GPoint(-124.05279541,46.34875870),"
Ilwaco Alternative High School
Po Box 40-a
Long Beach, WA 98631

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ilwaco Alternative High School",'Long_Beach=' + Long_Beach.length); Ilwaco[Ilwaco.length] = createMarker(new GPoint(-124.02909851,46.31620026),"
Ilwaco Junior High School
404 School Road
Ilwaco, WA 98624

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ilwaco Junior High School",'Ilwaco=' + Ilwaco.length); Ilwaco[Ilwaco.length] = createMarker(new GPoint(-124.03533400,46.30880500),"
Ilwaco Sr High School
404 School Road
Ilwaco, WA 98624

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ilwaco Sr High School",'Ilwaco=' + Ilwaco.length); Menlo[Menlo.length] = createMarker(new GPoint(-123.64579773,46.62160110),"
Lebam Elementary School
Po Box 128
Menlo, WA 98561

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lebam Elementary School",'Menlo=' + Menlo.length); Long_Beach[Long_Beach.length] = createMarker(new GPoint(-124.04979706,46.36460114),"
Long Beach Elementary School
Long Beach School
Long Beach, WA 98631

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Long Beach Elementary School",'Long_Beach=' + Long_Beach.length); Naselle[Naselle.length] = createMarker(new GPoint(-123.80950165,46.36600876),"
Naselle Elementary School
793 Sr 4
Naselle, WA 98638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Naselle Elementary School",'Naselle=' + Naselle.length); Naselle[Naselle.length] = createMarker(new GPoint(-123.79873657,46.37650299),"
Naselle Junior Senior High Schools
793 State Route 4
Naselle, WA 98638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Naselle Junior Senior High Schools",'Naselle=' + Naselle.length); Naselle[Naselle.length] = createMarker(new GPoint(-123.82527161,46.39007568),"
Naselle Youth Camp School
11-s Youth Camp Lane
Naselle, WA 98638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Naselle Youth Camp School",'Naselle=' + Naselle.length); Naselle[Naselle.length] = createMarker(new GPoint(-123.81154900,46.36548000),"
Naselle-grays River Valley Elementary School
793 Sr 4
Naselle, WA 98638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Naselle-grays River Valley Elementary School",'Naselle=' + Naselle.length); Ocean_Park[Ocean_Park.length] = createMarker(new GPoint(-124.05030060,46.48860931),"
Ocean Park Elementary Multi Grade
25701 Vernon Ave
Ocean Park, WA 98640

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ocean Park Elementary Multi Grade",'Ocean_Park=' + Ocean_Park.length); Ocean_Park[Ocean_Park.length] = createMarker(new GPoint(-124.04989100,46.49582600),"
Ocean Park Elementary School
Po Box 1220
Ocean Park, WA 98640

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ocean Park Elementary School",'Ocean_Park=' + Ocean_Park.length); Raymond[Raymond.length] = createMarker(new GPoint(-123.72489166,46.68552017),"
Raymond Elementary School
921 Commercial Street
Raymond, WA 98577

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Raymond Elementary School",'Raymond=' + Raymond.length); Raymond[Raymond.length] = createMarker(new GPoint(-123.72489166,46.68552017),"
Raymond Home Link School
1016 Commercial Street
Raymond, WA 98577

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Raymond Home Link School",'Raymond=' + Raymond.length); Raymond[Raymond.length] = createMarker(new GPoint(-123.72489166,46.68552017),"
Raymond Junior Senior High School
1016 Commercial St
Raymond, WA 98577

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Raymond Junior Senior High School",'Raymond=' + Raymond.length); Raymond[Raymond.length] = createMarker(new GPoint(-123.72489166,46.68552017),"
Raymond Preschool
1016 Commercial Street
Raymond, WA 98577

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Raymond Preschool",'Raymond=' + Raymond.length); South_Bend[South_Bend.length] = createMarker(new GPoint(-123.79249573,46.66216278),"
South Bend High School
Po Box 437
South Bend, WA 98586

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Bend High School",'South_Bend=' + South_Bend.length); South_Bend[South_Bend.length] = createMarker(new GPoint(-123.79249573,46.66216278),"
South Bend Middle School
Po Box 437
South Bend, WA 98586

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("South Bend Middle School",'South_Bend=' + South_Bend.length); Menlo[Menlo.length] = createMarker(new GPoint(-123.65090179,46.62253952),"
Willapa Elementary School
Po Box 128
Menlo, WA 98561

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Willapa Elementary School",'Menlo=' + Menlo.length); Menlo[Menlo.length] = createMarker(new GPoint(-123.65090179,46.62253952),"
Willapa Valley Junior Senior High School
Po Box 128
Menlo, WA 98561

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Willapa Valley Junior Senior High School",'Menlo=' + Menlo.length); Menlo[Menlo.length] = createMarker(new GPoint(-123.64775700,46.62191400),"
Willapa Valley Preschool
Po Box 128
Menlo, WA 98561

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Willapa Valley Preschool",'Menlo=' + Menlo.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(Ilwaco); map.removeOverlays(Long_Beach); map.removeOverlays(Menlo); map.removeOverlays(Naselle); map.removeOverlays(Ocean_Park); map.removeOverlays(Raymond); map.removeOverlays(South_Bend); 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(South_Bend);map.removeOverlays(Ilwaco); map.removeOverlays(Long_Beach); map.removeOverlays(Menlo); map.removeOverlays(Naselle); map.removeOverlays(Ocean_Park); map.removeOverlays(Raymond); map.removeOverlays(South_Bend); map.addOverlays(Ilwaco); centerByArray(Ilwaco, false, false); cntMarker += Ilwaco.length; map.addOverlays(Long_Beach); centerByArray(Long_Beach, false, false); cntMarker += Long_Beach.length; map.addOverlays(Menlo); centerByArray(Menlo, false, false); cntMarker += Menlo.length; map.addOverlays(Naselle); centerByArray(Naselle, false, false); cntMarker += Naselle.length; map.addOverlays(Ocean_Park); centerByArray(Ocean_Park, false, false); cntMarker += Ocean_Park.length; map.addOverlays(Raymond); centerByArray(Raymond, false, false); cntMarker += Raymond.length; map.addOverlays(South_Bend); centerByArray(South_Bend, false, false); cntMarker += South_Bend.length; centerByArray(South_Bend,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'); } }