function addMarkers() { mySelect = document.getElementById('selection'); Tangent = [];Albany = [];Lebanon = [];Scio = [];Brownsville = [];Halsey = [];Crawfordsville = [];Detroit = [];Foster = [];Gates = [];Harrisburg = [];Sweet_Home = [];Lyons = [];Mill_City = [];mySelect.options[mySelect.options.length] = new Option("Albany schools",'all=Albany'); mySelect.options[mySelect.options.length] = new Option("Brownsville schools",'all=Brownsville'); mySelect.options[mySelect.options.length] = new Option("Crawfordsville schools",'all=Crawfordsville'); mySelect.options[mySelect.options.length] = new Option("Detroit schools",'all=Detroit'); mySelect.options[mySelect.options.length] = new Option("Foster schools",'all=Foster'); mySelect.options[mySelect.options.length] = new Option("Gates schools",'all=Gates'); mySelect.options[mySelect.options.length] = new Option("Halsey schools",'all=Halsey'); mySelect.options[mySelect.options.length] = new Option("Harrisburg schools",'all=Harrisburg'); mySelect.options[mySelect.options.length] = new Option("Lebanon schools",'all=Lebanon'); mySelect.options[mySelect.options.length] = new Option("Lyons schools",'all=Lyons'); mySelect.options[mySelect.options.length] = new Option("Mill City schools",'all=Mill_City'); mySelect.options[mySelect.options.length] = new Option("Scio schools",'all=Scio'); mySelect.options[mySelect.options.length] = new Option("Sweet Home schools",'all=Sweet_Home'); mySelect.options[mySelect.options.length] = new Option("Tangent schools",'all=Tangent'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Tangent[Tangent.length] = createMarker(new GPoint(-123.11039734,44.64360046),"
Albany Options School
34100 Mcfarland Rd Se
Tangent, OR 97389

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Albany Options School",'Tangent=' + Tangent.length); Albany[Albany.length] = createMarker(new GPoint(-123.09245300,44.61846161),"
Calapooia Middle School
830 Se 24th Ave
Albany, OR 97322

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Calapooia Middle School",'Albany=' + Albany.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-122.91587067,44.52497864),"
Cascades School
2163 7th St
Lebanon, OR 97355

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cascades School",'Lebanon=' + Lebanon.length); Scio[Scio.length] = createMarker(new GPoint(-122.85368347,44.70483780),"
Centennial Elementary School
38875 Nw First Ave
Scio, OR 97374

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Centennial Elementary School",'Scio=' + Scio.length); Albany[Albany.length] = createMarker(new GPoint(-123.10654449,44.63068390),"
Central Elementary School
336 9th Ave Sw
Albany, OR 97321

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Albany=' + Albany.length); Brownsville[Brownsville.length] = createMarker(new GPoint(-122.98173523,44.38553619),"
Central Linn Alternative Education High School
331 E Blakely Ave
Brownsville, OR 97327

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Linn Alternative Education High School",'Brownsville=' + Brownsville.length); Halsey[Halsey.length] = createMarker(new GPoint(-123.10999298,44.38734055),"
Central Linn Elementary School
239 W 2nd St
Halsey, OR 97348

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Linn Elementary School",'Halsey=' + Halsey.length); Halsey[Halsey.length] = createMarker(new GPoint(-123.08599854,44.38904190),"
Central Linn High School
32433 Hwy 228
Halsey, OR 97348

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Linn High School",'Halsey=' + Halsey.length); Albany[Albany.length] = createMarker(new GPoint(-123.10353088,44.63681030),"
Clover Ridge Elementary School
2953 Clover Ridge Rd Nw
Albany, OR 97321

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clover Ridge Elementary School",'Albany=' + Albany.length); Crawfordsville[Crawfordsville.length] = createMarker(new GPoint(-122.85540009,44.35720062),"
Crawfordsville Elementary School
Po Box 177
Crawfordsville, OR 97336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Crawfordsville Elementary School",'Crawfordsville=' + Crawfordsville.length); Detroit[Detroit.length] = createMarker(new GPoint(-122.18029785,44.78390121),"
Detroit Lakes Charter School
Po Box 520
Detroit, OR 97342

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Detroit Lakes Charter School",'Detroit=' + Detroit.length); Foster[Foster.length] = createMarker(new GPoint(-122.59069824,44.40340042),"
Foster Elementary School
Po Box 747
Foster, OR 97345

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Foster Elementary School",'Foster=' + Foster.length); Gates[Gates.length] = createMarker(new GPoint(-122.48400116,44.61840057),"
Gates Elementary School
Po Box 457
Gates, OR 97346

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gates Elementary School",'Gates=' + Gates.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-122.91363525,44.56096268),"
Gore Elementary School
37180 Gore Dr
Lebanon, OR 97355

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gore Elementary School",'Lebanon=' + Lebanon.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-122.92097473,44.53895187),"
Green Acres School
700 10th St
Lebanon, OR 97355

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Green Acres School",'Lebanon=' + Lebanon.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-122.83541107,44.51261139),"
Hamilton Creek School
32135 Berlin Rd
Lebanon, OR 97355

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hamilton Creek School",'Lebanon=' + Lebanon.length); Harrisburg[Harrisburg.length] = createMarker(new GPoint(-123.11789703,44.27009964),"
Harrisburg Elementary School
Po Box 247
Harrisburg, OR 97446

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Harrisburg Elementary School",'Harrisburg=' + Harrisburg.length); Harrisburg[Harrisburg.length] = createMarker(new GPoint(-123.11789703,44.27009964),"
Harrisburg High School
Po Box 209
Harrisburg, OR 97446

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harrisburg High School",'Harrisburg=' + Harrisburg.length); Harrisburg[Harrisburg.length] = createMarker(new GPoint(-123.11789703,44.27009964),"
Harrisburg Middle School
Po Box 317
Harrisburg, OR 97446

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Harrisburg Middle School",'Harrisburg=' + Harrisburg.length); Sweet_Home[Sweet_Home.length] = createMarker(new GPoint(-122.70706940,44.39866257),"
Hawthorne Elementary School
3205 Long St
Sweet Home, OR 97386

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hawthorne Elementary School",'Sweet_Home=' + Sweet_Home.length); Sweet_Home[Sweet_Home.length] = createMarker(new GPoint(-122.78484344,44.35946274),"
Holley Elementary School
40336 Crawfordsville Dr
Sweet Home, OR 97386

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holley Elementary School",'Sweet_Home=' + Sweet_Home.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-122.73709106,44.58546448),"
Lacomb School
34110 E Lacomb Rd
Lebanon, OR 97355

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lacomb School",'Lebanon=' + Lebanon.length); Albany[Albany.length] = createMarker(new GPoint(-123.09139252,44.61227036),"
Lafayette Elementary School
3122 Madison St Se
Albany, OR 97322

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lafayette Elementary School",'Albany=' + Albany.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-122.91309357,44.52996826),"
Lebanon High School
1700 S 5th St
Lebanon, OR 97355

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lebanon High School",'Lebanon=' + Lebanon.length); Albany[Albany.length] = createMarker(new GPoint(-123.11893463,44.62023926),"
Liberty Elementary School
2345 Liberty St Sw
Albany, OR 97321

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liberty Elementary School",'Albany=' + Albany.length); Scio[Scio.length] = createMarker(new GPoint(-122.69235229,44.71764755),"
Lourdes School
39059 Jordan Rd
Scio, OR 97374

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lourdes School",'Scio=' + Scio.length); Lyons[Lyons.length] = createMarker(new GPoint(-122.61649323,44.77981186),"
Mari-linn Elementary School
641 5th St
Lyons, OR 97358

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mari-linn Elementary School",'Lyons=' + Lyons.length); Albany[Albany.length] = createMarker(new GPoint(-123.11530304,44.62351227),"
Memorial Middle School
1050 Queen Ave Sw
Albany, OR 97321

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Memorial Middle School",'Albany=' + Albany.length); Mill_City[Mill_City.length] = createMarker(new GPoint(-122.47669983,44.76169968),"
Mill City Middle School
Po Box 198
Mill City, OR 97360

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mill City Middle School",'Mill_City=' + Mill_City.length); Albany[Albany.length] = createMarker(new GPoint(-123.09291840,44.59973526),"
Oak Creek School
4400 Lochner Rd Se
Albany, OR 97321

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oak Creek School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-123.08547974,44.60912323),"
Oak Elementary School
3610 Oak St Se
Albany, OR 97322

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak Elementary School",'Albany=' + Albany.length); Sweet_Home[Sweet_Home.length] = createMarker(new GPoint(-122.73705292,44.39166260),"
Oak Heights Elementary School
605 Elm St
Sweet Home, OR 97386

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak Heights Elementary School",'Sweet_Home=' + Sweet_Home.length); Albany[Albany.length] = createMarker(new GPoint(-123.07864380,44.62146378),"
Periwinkle Elementary School
2196 21st Ave Se
Albany, OR 97322

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Periwinkle Elementary School",'Albany=' + Albany.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-122.91280365,44.54795837),"
Pioneer School
500 N 5th St
Lebanon, OR 97355

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pioneer School",'Lebanon=' + Lebanon.length); Sweet_Home[Sweet_Home.length] = createMarker(new GPoint(-122.73908997,44.41346359),"
Pleasant Valley Kg Elementary School
28028 Pleasant Valley Rd
Sweet Home, OR 97386

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Valley Kg Elementary School",'Sweet_Home=' + Sweet_Home.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-122.90498352,44.53416443),"
Queen Anne Elementary School
142 Elmore
Lebanon, OR 97355

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Queen Anne Elementary School",'Lebanon=' + Lebanon.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-122.89298248,44.52573776),"
Riverview School
1011 Mountain River Dr
Lebanon, OR 97355

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverview School",'Lebanon=' + Lebanon.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-122.99741364,44.50472260),"
Sand Ridge Charter School
30581 Sodaville-mt Home Rd
Lebanon, OR 97355

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sand Ridge Charter School",'Lebanon=' + Lebanon.length); Mill_City[Mill_City.length] = createMarker(new GPoint(-122.47669983,44.76169968),"
Santiam High School
Po Box 199
Mill City, OR 97360

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Santiam High School",'Mill_City=' + Mill_City.length); Scio[Scio.length] = createMarker(new GPoint(-122.85368347,44.70483780),"
Scio High School
38875 Nw First Ave
Scio, OR 97374

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Scio High School",'Scio=' + Scio.length); Scio[Scio.length] = createMarker(new GPoint(-122.85368347,44.70483780),"
Scio Middle School
38875 Nw First Ave
Scio, OR 97374

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Scio Middle School",'Scio=' + Scio.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-122.89213562,44.51057816),"
Seven Oak Middle School
550 Cascade Dr
Lebanon, OR 97355

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Seven Oak Middle School",'Lebanon=' + Lebanon.length); Albany[Albany.length] = createMarker(new GPoint(-123.07940674,44.60763168),"
South Albany High School
3705 Columbus Se
Albany, OR 97321

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Albany High School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-123.06937408,44.63376236),"
South Shore Elementary School
910 Bain St Se
Albany, OR 97322

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Shore Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-123.09414673,44.62306213),"
Sunrise Elementary School
730 19th Ave Se
Albany, OR 97322

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunrise Elementary School",'Albany=' + Albany.length); Sweet_Home[Sweet_Home.length] = createMarker(new GPoint(-122.72506714,44.39763260),"
Sweet Home High School
1641 Long St
Sweet Home, OR 97386

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sweet Home High School",'Sweet_Home=' + Sweet_Home.length); Sweet_Home[Sweet_Home.length] = createMarker(new GPoint(-122.71899414,44.39475250),"
Sweet Home Junior High School
880 22nd Ave
Sweet Home, OR 97386

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sweet Home Junior High School",'Sweet_Home=' + Sweet_Home.length); Albany[Albany.length] = createMarker(new GPoint(-123.11788940,44.62707138),"
Takena Elementary School
1210 Takena Ave Sw
Albany, OR 97321

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Takena Elementary School",'Albany=' + Albany.length); Tangent[Tangent.length] = createMarker(new GPoint(-123.09474182,44.53448105),"
Tangent Elementary School
31200 Old Oak Dr
Tangent, OR 97389

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tangent Elementary School",'Tangent=' + Tangent.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-122.82527924,44.49229813),"
Waterloo Elementary School
37900 8th St waterloo
Lebanon, OR 97355

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Waterloo Elementary School",'Lebanon=' + Lebanon.length); Albany[Albany.length] = createMarker(new GPoint(-123.07820892,44.63753128),"
Waverly Elementary School
425 Columbus Se
Albany, OR 97322

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Waverly Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-123.11701202,44.62346268),"
West Albany High School
1130 Queen Ave Sw
Albany, OR 97321

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Albany High School",'Albany=' + Albany.length); Harrisburg[Harrisburg.length] = createMarker(new GPoint(-123.12723541,44.21538162),"
Wyatt Elementary School
21211 Coburg Rd
Harrisburg, OR 97446

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wyatt Elementary School",'Harrisburg=' + Harrisburg.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(Albany); map.removeOverlays(Brownsville); map.removeOverlays(Crawfordsville); map.removeOverlays(Detroit); map.removeOverlays(Foster); map.removeOverlays(Gates); map.removeOverlays(Halsey); map.removeOverlays(Harrisburg); map.removeOverlays(Lebanon); map.removeOverlays(Lyons); map.removeOverlays(Mill_City); map.removeOverlays(Scio); map.removeOverlays(Sweet_Home); map.removeOverlays(Tangent); 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(Tangent);map.removeOverlays(Albany); map.removeOverlays(Brownsville); map.removeOverlays(Crawfordsville); map.removeOverlays(Detroit); map.removeOverlays(Foster); map.removeOverlays(Gates); map.removeOverlays(Halsey); map.removeOverlays(Harrisburg); map.removeOverlays(Lebanon); map.removeOverlays(Lyons); map.removeOverlays(Mill_City); map.removeOverlays(Scio); map.removeOverlays(Sweet_Home); map.removeOverlays(Tangent); map.addOverlays(Albany); centerByArray(Albany, false, false); cntMarker += Albany.length; map.addOverlays(Brownsville); centerByArray(Brownsville, false, false); cntMarker += Brownsville.length; map.addOverlays(Crawfordsville); centerByArray(Crawfordsville, false, false); cntMarker += Crawfordsville.length; map.addOverlays(Detroit); centerByArray(Detroit, false, false); cntMarker += Detroit.length; map.addOverlays(Foster); centerByArray(Foster, false, false); cntMarker += Foster.length; map.addOverlays(Gates); centerByArray(Gates, false, false); cntMarker += Gates.length; map.addOverlays(Halsey); centerByArray(Halsey, false, false); cntMarker += Halsey.length; map.addOverlays(Harrisburg); centerByArray(Harrisburg, false, false); cntMarker += Harrisburg.length; map.addOverlays(Lebanon); centerByArray(Lebanon, false, false); cntMarker += Lebanon.length; map.addOverlays(Lyons); centerByArray(Lyons, false, false); cntMarker += Lyons.length; map.addOverlays(Mill_City); centerByArray(Mill_City, false, false); cntMarker += Mill_City.length; map.addOverlays(Scio); centerByArray(Scio, false, false); cntMarker += Scio.length; map.addOverlays(Sweet_Home); centerByArray(Sweet_Home, false, false); cntMarker += Sweet_Home.length; map.addOverlays(Tangent); centerByArray(Tangent, false, false); cntMarker += Tangent.length; centerByArray(Tangent,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'); } }