function addMarkers() { mySelect = document.getElementById('selection'); Wapato = [];Yakima = [];Mabton = [];Sunnyside = [];Grandview = [];Toppenish = [];Granger = [];_Harrah_Road = [];Cowiche = [];Zillah = [];Selah = [];White_Swan = [];Moxee = [];Naches = [];Tieton = [];Union_Gap = [];mySelect.options[mySelect.options.length] = new Option("Cowiche schools",'all=Cowiche'); mySelect.options[mySelect.options.length] = new Option("Grandview schools",'all=Grandview'); mySelect.options[mySelect.options.length] = new Option("Granger schools",'all=Granger'); mySelect.options[mySelect.options.length] = new Option("Mabton schools",'all=Mabton'); mySelect.options[mySelect.options.length] = new Option("Moxee schools",'all=Moxee'); mySelect.options[mySelect.options.length] = new Option("Naches schools",'all=Naches'); mySelect.options[mySelect.options.length] = new Option("Selah schools",'all=Selah'); mySelect.options[mySelect.options.length] = new Option("Sunnyside schools",'all=Sunnyside'); mySelect.options[mySelect.options.length] = new Option("Tieton schools",'all=Tieton'); mySelect.options[mySelect.options.length] = new Option("Toppenish schools",'all=Toppenish'); mySelect.options[mySelect.options.length] = new Option("Union Gap schools",'all=Union_Gap'); mySelect.options[mySelect.options.length] = new Option("Wapato schools",'all=Wapato'); mySelect.options[mySelect.options.length] = new Option("White Swan schools",'all=White_Swan'); mySelect.options[mySelect.options.length] = new Option("Yakima schools",'all=Yakima'); mySelect.options[mySelect.options.length] = new Option("Zillah schools",'all=Zillah'); mySelect.options[mySelect.options.length] = new Option(" Harrah Road schools",'all=_Harrah_Road'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Wapato[Wapato.length] = createMarker(new GPoint(-120.41719818,46.43770218),"
",iconRd); mySelect.options[mySelect.options.length] = new Option("Adams Elementary School",'Wapato=' + Wapato.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.49099731,46.59529114),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Adams Elementary School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.64990234,46.55052185),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Ahtanum Valley Elementary School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.62508392,46.59772491),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Apple Valley Elementary School",'Yakima=' + Yakima.length); Mabton[Mabton.length] = createMarker(new GPoint(-119.99900055,46.21480179),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Artz Fox Elementary School",'Mabton=' + Mabton.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.50897980,46.61443710),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Barge-lincoln Elementary School",'Yakima=' + Yakima.length); Wapato[Wapato.length] = createMarker(new GPoint(-120.41690063,46.45693970),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Camas Elementary School",'Wapato=' + Wapato.length); Sunnyside[Sunnyside.length] = createMarker(new GPoint(-120.01290131,46.31747437),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Chief Kamiakin Elementary School",'Sunnyside=' + Sunnyside.length); Grandview[Grandview.length] = createMarker(new GPoint(-119.91230774,46.25493622),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Compass High School",'Grandview=' + Grandview.length); Grandview[Grandview.length] = createMarker(new GPoint(-119.91210175,46.25479889),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Contract Learning Center",'Grandview=' + Grandview.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.63600159,46.58540726),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Cottonwood Elementary School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.51596832,46.59690475),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Davis High School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.54659271,46.61236191),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Discovery Lab School",'Yakima=' + Yakima.length); Toppenish[Toppenish.length] = createMarker(new GPoint(-120.31370544,46.38236237),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Eagle High School",'Toppenish=' + Toppenish.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.56452600,46.59268200),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Early Childhood Center",'Yakima=' + Yakima.length); Sunnyside[Sunnyside.length] = createMarker(new GPoint(-120.00873566,46.31727600),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Early Learning Center",'Sunnyside=' + Sunnyside.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.40409851,46.57329559),"",iconBl); mySelect.options[mySelect.options.length] = new Option("East Valley Central Middle School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.40409851,46.57521439),"",iconGr); mySelect.options[mySelect.options.length] = new Option("East Valley High School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.40370178,46.57432556),"",iconBl); mySelect.options[mySelect.options.length] = new Option("East Valley Intermediate",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.56209564,46.59074783),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Eisenhower High School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.53450012,46.59418869),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Franklin Middle School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.52009583,46.60813522),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Yakima=' + Yakima.length); Toppenish[Toppenish.length] = createMarker(new GPoint(-120.31873322,46.37764740),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Toppenish=' + Toppenish.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.56749725,46.60516357),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Gilbert Elementary School",'Yakima=' + Yakima.length); Grandview[Grandview.length] = createMarker(new GPoint(-119.92460632,46.25133514),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Grandview High School",'Grandview=' + Grandview.length); Grandview[Grandview.length] = createMarker(new GPoint(-119.92140198,46.25493622),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Grandview Middle School",'Grandview=' + Grandview.length); Granger[Granger.length] = createMarker(new GPoint(-120.18479300,46.34216300),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Granger Alternative High School",'Granger=' + Granger.length); Granger[Granger.length] = createMarker(new GPoint(-120.19577026,46.34623337),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Granger High School",'Granger=' + Granger.length); Granger[Granger.length] = createMarker(new GPoint(-120.18578339,46.34623718),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Granger Middle School",'Granger=' + Granger.length); _Harrah_Road[_Harrah_Road.length] = createMarker(new GPoint(-120.54389954,46.40670395),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Harrah Elementary School",'_Harrah_Road=' + _Harrah_Road.length); Sunnyside[Sunnyside.length] = createMarker(new GPoint(-120.01290131,46.31747437),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Harrison Middle School",'Sunnyside=' + Sunnyside.length); Cowiche[Cowiche.length] = createMarker(new GPoint(-120.71050262,46.67344284),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Highland High School",'Cowiche=' + Cowiche.length); Cowiche[Cowiche.length] = createMarker(new GPoint(-120.71690369,46.66899872),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Highland Junior High School",'Cowiche=' + Cowiche.length); Zillah[Zillah.length] = createMarker(new GPoint(-120.26505280,46.40662384),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Hilton Elementary School",'Zillah=' + Zillah.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.51099396,46.58146286),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Hoover Elementary School",'Yakima=' + Yakima.length); Selah[Selah.length] = createMarker(new GPoint(-120.53067780,46.65813446),"",iconRd); mySelect.options[mySelect.options.length] = new Option("John Campbell Elementary School",'Selah=' + Selah.length); Toppenish[Toppenish.length] = createMarker(new GPoint(-120.32550049,46.38055801),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Kirkwood Elementary School",'Toppenish=' + Toppenish.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.52310944,46.57426453),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Lewis & Clark Middle School",'Yakima=' + Yakima.length); Toppenish[Toppenish.length] = createMarker(new GPoint(-120.30592346,46.38065720),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Toppenish=' + Toppenish.length); Mabton[Mabton.length] = createMarker(new GPoint(-120.00980377,46.19680023),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Mabton Junior Senior High School",'Mabton=' + Mabton.length); Cowiche[Cowiche.length] = createMarker(new GPoint(-120.69630432,46.65803909),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Marcus Whitman-cowiche Elementary School",'Cowiche=' + Cowiche.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.47790527,46.57336426),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Martin Luther King Junior Elementary School",'Yakima=' + Yakima.length); Grandview[Grandview.length] = createMarker(new GPoint(-119.91400909,46.25493622),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mcclure Elementary School",'Grandview=' + Grandview.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.53846741,46.58301926),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mcclure Elementary School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.52619934,46.59204102),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.51596832,46.59690475),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Migrant Alternative School",'Yakima=' + Yakima.length); White_Swan[White_Swan.length] = createMarker(new GPoint(-120.73062900,46.38287500),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Mount Adams Middle School",'White_Swan=' + White_Swan.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.70963287,46.58677673),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mountainview Elementary School",'Yakima=' + Yakima.length); Moxee[Moxee.length] = createMarker(new GPoint(-120.38059998,46.55198669),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Moxee Elementary School",'Moxee=' + Moxee.length); Naches[Naches.length] = createMarker(new GPoint(-120.70063782,46.73553085),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Naches Valley High School",'Naches=' + Naches.length); Naches[Naches.length] = createMarker(new GPoint(-120.69499969,46.72836685),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Naches Valley Middle School",'Naches=' + Naches.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.61227417,46.66994476),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Naches Valley Primary School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.55380249,46.58958817),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Nob Hill Elementary School",'Yakima=' + Yakima.length); Sunnyside[Sunnyside.length] = createMarker(new GPoint(-120.06021881,46.34579849),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Outlook Elementary School",'Sunnyside=' + Sunnyside.length); Wapato[Wapato.length] = createMarker(new GPoint(-120.42269897,46.44580078),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Pace Alternative High School",'Wapato=' + Wapato.length); Sunnyside[Sunnyside.length] = createMarker(new GPoint(-120.01290131,46.31747437),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Pioneer Elementary School",'Sunnyside=' + Sunnyside.length); Selah[Selah.length] = createMarker(new GPoint(-120.53074646,46.65705109),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Preschool Elementary School",'Selah=' + Selah.length); Sunnyside[Sunnyside.length] = createMarker(new GPoint(-120.00889587,46.32751846),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Pride High School",'Sunnyside=' + Sunnyside.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.51504517,46.57083511),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Ridgeview Elementary School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.53208923,46.60876465),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Ridgeview Group Home",'Yakima=' + Yakima.length); Selah[Selah.length] = createMarker(new GPoint(-120.53356934,46.65396118),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Robert S Lince Elementary School",'Selah=' + Selah.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.54656219,46.60363770),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Robertson Elementary School",'Yakima=' + Yakima.length); Granger[Granger.length] = createMarker(new GPoint(-120.18578339,46.34623718),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary (new)",'Granger=' + Granger.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.53060150,46.59906769),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Yakima=' + Yakima.length); Wapato[Wapato.length] = createMarker(new GPoint(-120.41749573,46.44024277),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Satus Elementary School",'Wapato=' + Wapato.length); Selah[Selah.length] = createMarker(new GPoint(-120.52942657,46.66101074),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Selah Academy",'Selah=' + Selah.length); Selah[Selah.length] = createMarker(new GPoint(-120.53019714,46.66434479),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Selah High School",'Selah=' + Selah.length); Selah[Selah.length] = createMarker(new GPoint(-120.54851532,46.65623856),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Selah Intermediate",'Selah=' + Selah.length); Selah[Selah.length] = createMarker(new GPoint(-120.53028107,46.65815353),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Selah Junior High School",'Selah=' + Selah.length); Grandview[Grandview.length] = createMarker(new GPoint(-119.88899994,46.25423050),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Smith Elementary School",'Grandview=' + Grandview.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.51885223,46.56726837),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Stanton Alternative School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.59252930,46.59663773),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Summitview Elementary School",'Yakima=' + Yakima.length); Sunnyside[Sunnyside.length] = createMarker(new GPoint(-120.01290131,46.31747437),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Sunnyside High School",'Sunnyside=' + Sunnyside.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.44425201,46.60653687),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Terrace Heights Elementary School",'Yakima=' + Yakima.length); Grandview[Grandview.length] = createMarker(new GPoint(-119.91579437,46.25505447),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Thompson Elementary School",'Grandview=' + Grandview.length); Tieton[Tieton.length] = createMarker(new GPoint(-120.76200104,46.70121765),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Tieton Intermediate School",'Tieton=' + Tieton.length); Toppenish[Toppenish.length] = createMarker(new GPoint(-120.33562469,46.37851715),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Toppenish High School",'Toppenish=' + Toppenish.length); Toppenish[Toppenish.length] = createMarker(new GPoint(-120.31435394,46.38366318),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Toppenish Middle School",'Toppenish=' + Toppenish.length); Toppenish[Toppenish.length] = createMarker(new GPoint(-120.32550049,46.38052368),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Toppenish Pre School",'Toppenish=' + Toppenish.length); Union_Gap[Union_Gap.length] = createMarker(new GPoint(-120.47799683,46.55596161),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Union Gap School",'Union_Gap=' + Union_Gap.length); Toppenish[Toppenish.length] = createMarker(new GPoint(-10.00000000,10.00000000),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Valley View Elementary School",'Toppenish=' + Toppenish.length); Wapato[Wapato.length] = createMarker(new GPoint(-120.42224884,46.43842316),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Wapato High School",'Wapato=' + Wapato.length); Wapato[Wapato.length] = createMarker(new GPoint(-120.41723633,46.43809891),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Wapato Middle School",'Wapato=' + Wapato.length); Sunnyside[Sunnyside.length] = createMarker(new GPoint(-120.01290131,46.31747437),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Sunnyside=' + Sunnyside.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.49095917,46.59851837),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Washington Middle School",'Yakima=' + Yakima.length); White_Swan[White_Swan.length] = createMarker(new GPoint(-120.85487366,46.33851242),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Wellpinit-fort Semco High School",'White_Swan=' + White_Swan.length); Toppenish[Toppenish.length] = createMarker(new GPoint(-120.33562469,46.37851715),"",iconRd); mySelect.options[mySelect.options.length] = new Option("West Elementary School",'Toppenish=' + Toppenish.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.63365936,46.57456207),"",iconGr); mySelect.options[mySelect.options.length] = new Option("West Valley High School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.60795593,46.57495117),"",iconGr); mySelect.options[mySelect.options.length] = new Option("West Valley Jr High School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.60790253,46.57826233),"",iconBl); mySelect.options[mySelect.options.length] = new Option("West Valley Middle School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.63582100,46.58553300),"",iconRd); mySelect.options[mySelect.options.length] = new Option("West Valley Preschool",'Yakima=' + Yakima.length); White_Swan[White_Swan.length] = createMarker(new GPoint(-120.73246002,46.37779617),"",iconGr); mySelect.options[mySelect.options.length] = new Option("White Swan High School",'White_Swan=' + White_Swan.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.56738281,46.58553696),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Whitney Elementary School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.60454559,46.58758926),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Wide Hollow Elementary School",'Yakima=' + Yakima.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.56729889,46.58879852),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Wilson Middle School",'Yakima=' + Yakima.length); Toppenish[Toppenish.length] = createMarker(new GPoint(-120.82720184,46.26660156),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Yakama Tribal School",'Toppenish=' + Toppenish.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.53211212,46.60876465),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Yakima Co Juvenile Detention",'Yakima=' + Yakima.length); Selah[Selah.length] = createMarker(new GPoint(-120.53074646,46.65705109),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Yakima Valley School (selah)",'Selah=' + Selah.length); Yakima[Yakima.length] = createMarker(new GPoint(-120.52919769,46.58481598),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Yakima Valley Technical Skills Center",'Yakima=' + Yakima.length); Grandview[Grandview.length] = createMarker(new GPoint(-119.91059875,46.25586319),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Yvcc Ged School",'Grandview=' + Grandview.length); Zillah[Zillah.length] = createMarker(new GPoint(-120.24606323,46.40065765),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Zillah High School",'Zillah=' + Zillah.length); Zillah[Zillah.length] = createMarker(new GPoint(-120.26447296,46.40396118),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Zillah Intermediate School",'Zillah=' + Zillah.length); Zillah[Zillah.length] = createMarker(new GPoint(-120.27438354,46.41123581),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Zillah Middle School",'Zillah=' + Zillah.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(Cowiche); map.removeOverlays(Grandview); map.removeOverlays(Granger); map.removeOverlays(Mabton); map.removeOverlays(Moxee); map.removeOverlays(Naches); map.removeOverlays(Selah); map.removeOverlays(Sunnyside); map.removeOverlays(Tieton); map.removeOverlays(Toppenish); map.removeOverlays(Union_Gap); map.removeOverlays(Wapato); map.removeOverlays(White_Swan); map.removeOverlays(Yakima); map.removeOverlays(Zillah); map.removeOverlays(_Harrah_Road); 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(Wapato);map.removeOverlays(Cowiche); map.removeOverlays(Grandview); map.removeOverlays(Granger); map.removeOverlays(Mabton); map.removeOverlays(Moxee); map.removeOverlays(Naches); map.removeOverlays(Selah); map.removeOverlays(Sunnyside); map.removeOverlays(Tieton); map.removeOverlays(Toppenish); map.removeOverlays(Union_Gap); map.removeOverlays(Wapato); map.removeOverlays(White_Swan); map.removeOverlays(Yakima); map.removeOverlays(Zillah); map.removeOverlays(_Harrah_Road); map.addOverlays(Cowiche); centerByArray(Cowiche, false, false); cntMarker += Cowiche.length; map.addOverlays(Grandview); centerByArray(Grandview, false, false); cntMarker += Grandview.length; map.addOverlays(Granger); centerByArray(Granger, false, false); cntMarker += Granger.length; map.addOverlays(Mabton); centerByArray(Mabton, false, false); cntMarker += Mabton.length; map.addOverlays(Moxee); centerByArray(Moxee, false, false); cntMarker += Moxee.length; map.addOverlays(Naches); centerByArray(Naches, false, false); cntMarker += Naches.length; map.addOverlays(Selah); centerByArray(Selah, false, false); cntMarker += Selah.length; map.addOverlays(Sunnyside); centerByArray(Sunnyside, false, false); cntMarker += Sunnyside.length; map.addOverlays(Tieton); centerByArray(Tieton, false, false); cntMarker += Tieton.length; map.addOverlays(Toppenish); centerByArray(Toppenish, false, false); cntMarker += Toppenish.length; map.addOverlays(Union_Gap); centerByArray(Union_Gap, false, false); cntMarker += Union_Gap.length; map.addOverlays(Wapato); centerByArray(Wapato, false, false); cntMarker += Wapato.length; map.addOverlays(White_Swan); centerByArray(White_Swan, false, false); cntMarker += White_Swan.length; map.addOverlays(Yakima); centerByArray(Yakima, false, false); cntMarker += Yakima.length; map.addOverlays(Zillah); centerByArray(Zillah, false, false); cntMarker += Zillah.length; map.addOverlays(_Harrah_Road); centerByArray(_Harrah_Road, false, false); cntMarker += _Harrah_Road.length; centerByArray(Wapato,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'); } }