function addMarkers() { mySelect = document.getElementById('selection'); Livingston = [];Alhambra = [];Alton = [];Bethalto = [];Madison = [];Troy = [];Roxana = [];Collinsville = [];Edwardsville = [];Granite_City = [];Worden = [];Godfrey = [];East_Alton = [];Wood_River = [];Glen_Carbon = [];Highland = [];Hamel = [];Hartford = [];Venice = [];Marine = [];Maryville = [];Moro = [];New_Douglas = [];South_Roxana = [];St_Jacob = [];mySelect.options[mySelect.options.length] = new Option("Alhambra schools",'all=Alhambra'); mySelect.options[mySelect.options.length] = new Option("Alton schools",'all=Alton'); mySelect.options[mySelect.options.length] = new Option("Bethalto schools",'all=Bethalto'); mySelect.options[mySelect.options.length] = new Option("Collinsville schools",'all=Collinsville'); mySelect.options[mySelect.options.length] = new Option("East Alton schools",'all=East_Alton'); mySelect.options[mySelect.options.length] = new Option("Edwardsville schools",'all=Edwardsville'); mySelect.options[mySelect.options.length] = new Option("Glen Carbon schools",'all=Glen_Carbon'); mySelect.options[mySelect.options.length] = new Option("Godfrey schools",'all=Godfrey'); mySelect.options[mySelect.options.length] = new Option("Granite City schools",'all=Granite_City'); mySelect.options[mySelect.options.length] = new Option("Hamel schools",'all=Hamel'); mySelect.options[mySelect.options.length] = new Option("Hartford schools",'all=Hartford'); mySelect.options[mySelect.options.length] = new Option("Highland schools",'all=Highland'); mySelect.options[mySelect.options.length] = new Option("Livingston schools",'all=Livingston'); mySelect.options[mySelect.options.length] = new Option("Madison schools",'all=Madison'); mySelect.options[mySelect.options.length] = new Option("Marine schools",'all=Marine'); mySelect.options[mySelect.options.length] = new Option("Maryville schools",'all=Maryville'); mySelect.options[mySelect.options.length] = new Option("Moro schools",'all=Moro'); mySelect.options[mySelect.options.length] = new Option("New Douglas schools",'all=New_Douglas'); mySelect.options[mySelect.options.length] = new Option("Roxana schools",'all=Roxana'); mySelect.options[mySelect.options.length] = new Option("South Roxana schools",'all=South_Roxana'); mySelect.options[mySelect.options.length] = new Option("St Jacob schools",'all=St_Jacob'); mySelect.options[mySelect.options.length] = new Option("Troy schools",'all=Troy'); mySelect.options[mySelect.options.length] = new Option("Venice schools",'all=Venice'); mySelect.options[mySelect.options.length] = new Option("Wood River schools",'all=Wood_River'); mySelect.options[mySelect.options.length] = new Option("Worden schools",'all=Worden'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Livingston[Livingston.length] = createMarker(new GPoint(-89.76049805,38.96699905),"
",iconRd); mySelect.options[mySelect.options.length] = new Option("A R Graiff Elementary School",'Livingston=' + Livingston.length); Alhambra[Alhambra.length] = createMarker(new GPoint(-89.73609161,38.88816452),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Alhambra Elementary School",'Alhambra=' + Alhambra.length); Alton[Alton.length] = createMarker(new GPoint(-90.15439606,38.90348816),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Alton Senior High School",'Alton=' + Alton.length); Bethalto[Bethalto.length] = createMarker(new GPoint(-90.05137300,38.90885600),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Bethalto East Primary School",'Bethalto=' + Bethalto.length); Bethalto[Bethalto.length] = createMarker(new GPoint(-90.05113983,38.90901184),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Bethalto Sixth Grade Center",'Bethalto=' + Bethalto.length); Bethalto[Bethalto.length] = createMarker(new GPoint(-90.05982971,38.90888596),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Bethalto West Intermediate School",'Bethalto=' + Bethalto.length); Madison[Madison.length] = createMarker(new GPoint(-90.16717529,38.68368149),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Blair Elementary School",'Madison=' + Madison.length); Troy[Troy.length] = createMarker(new GPoint(-89.88203400,38.72897500),"",iconRd); mySelect.options[mySelect.options.length] = new Option("C A Henning School",'Troy=' + Troy.length); Roxana[Roxana.length] = createMarker(new GPoint(-90.07632446,38.84425735),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Roxana=' + Roxana.length); Bethalto[Bethalto.length] = createMarker(new GPoint(-90.06223297,38.90958786),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Civic Memorial High School",'Bethalto=' + Bethalto.length); Collinsville[Collinsville.length] = createMarker(new GPoint(-89.97329712,38.68669891),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Cntr For Ed Oppor High School",'Collinsville=' + Collinsville.length); Alton[Alton.length] = createMarker(new GPoint(-90.14842224,38.89007568),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Cntr For Ed Oppor High School",'Alton=' + Alton.length); Collinsville[Collinsville.length] = createMarker(new GPoint(-89.97037400,38.69328000),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Collinsville Intermediate School",'Collinsville=' + Collinsville.length); Edwardsville[Edwardsville.length] = createMarker(new GPoint(-89.95560455,38.81536865),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Columbus Elementary School",'Edwardsville=' + Edwardsville.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.12290955,38.72105789),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Coolidge Middle School",'Granite_City=' + Granite_City.length); Troy[Troy.length] = createMarker(new GPoint(-89.87261200,38.71793747),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Dewey Street Campus Elementary School",'Troy=' + Troy.length); Worden[Worden.length] = createMarker(new GPoint(-89.83928680,38.93154907),"",iconGr); mySelect.options[mySelect.options.length] = new Option("District 7 Alternative School",'Worden=' + Worden.length); Godfrey[Godfrey.length] = createMarker(new GPoint(-90.19097137,38.95382309),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Early Childhood Elementary School",'Godfrey=' + Godfrey.length); East_Alton[East_Alton.length] = createMarker(new GPoint(-90.09633636,38.87914658),"",iconBl); mySelect.options[mySelect.options.length] = new Option("East Alton Middle School",'East_Alton=' + East_Alton.length); Wood_River[Wood_River.length] = createMarker(new GPoint(-90.09857178,38.87178040),"",iconGr); mySelect.options[mySelect.options.length] = new Option("East Alton-wood River High School",'Wood_River=' + Wood_River.length); Alton[Alton.length] = createMarker(new GPoint(-90.15123749,38.89598083),"",iconBl); mySelect.options[mySelect.options.length] = new Option("East Middle School",'Alton=' + Alton.length); East_Alton[East_Alton.length] = createMarker(new GPoint(-90.09550476,38.87919998),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Eastwood Elementary School",'East_Alton=' + East_Alton.length); Edwardsville[Edwardsville.length] = createMarker(new GPoint(-89.97434235,38.78738022),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Edwardsville High School",'Edwardsville=' + Edwardsville.length); Alton[Alton.length] = createMarker(new GPoint(-90.17684174,38.91284561),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Eunice Smith Elementary School",'Alton=' + Alton.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.11419678,38.72306442),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Frohardt Elementary School",'Granite_City=' + Granite_City.length); Godfrey[Godfrey.length] = createMarker(new GPoint(-90.21655273,38.93131256),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Gilson Brown Elementary School",'Godfrey=' + Godfrey.length); Glen_Carbon[Glen_Carbon.length] = createMarker(new GPoint(-89.97903442,38.74983978),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Glen Carbon Elementary School",'Glen_Carbon=' + Glen_Carbon.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.12461090,38.71715546),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Granite City High School",'Granite_City=' + Granite_City.length); Highland[Highland.length] = createMarker(new GPoint(-89.66542053,38.83108521),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Grantfork Elementary School",'Highland=' + Highland.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.14810181,38.70085144),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Grigsby Middle School",'Granite_City=' + Granite_City.length); Hamel[Hamel.length] = createMarker(new GPoint(-89.84339905,38.88840103),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Hamel Elementary School",'Hamel=' + Hamel.length); Madison[Madison.length] = createMarker(new GPoint(-90.15428925,38.68304825),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Harris Elementary School",'Madison=' + Madison.length); Hartford[Hartford.length] = createMarker(new GPoint(-90.09635925,38.83168030),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Hartford Elementary School",'Hartford=' + Hartford.length); Highland[Highland.length] = createMarker(new GPoint(-89.67089844,38.75000000),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Highland High School",'Highland=' + Highland.length); Highland[Highland.length] = createMarker(new GPoint(-89.67089844,38.75000000),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Highland Mid-elementary School",'Highland=' + Highland.length); Highland[Highland.length] = createMarker(new GPoint(-89.67089844,38.75000000),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Highland Middle School",'Highland=' + Highland.length); Highland[Highland.length] = createMarker(new GPoint(-89.67089844,38.75000000),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Highland Primary School",'Highland=' + Highland.length); Highland[Highland.length] = createMarker(new GPoint(-89.67089844,38.75000000),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Highland Upper Elementary School",'Highland=' + Highland.length); Alton[Alton.length] = createMarker(new GPoint(-90.14642334,38.90131760),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Horace Mann Elementary School",'Alton=' + Alton.length); Alton[Alton.length] = createMarker(new GPoint(-90.15744781,38.93711853),"",iconGr); mySelect.options[mySelect.options.length] = new Option("J B Johnson Career Development",'Alton=' + Alton.length); Alton[Alton.length] = createMarker(new GPoint(-90.15744781,38.93711853),"",iconRd); mySelect.options[mySelect.options.length] = new Option("J B Johnson Elementary School",'Alton=' + Alton.length); Collinsville[Collinsville.length] = createMarker(new GPoint(-90.00422668,38.66039276),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Collinsville=' + Collinsville.length); Collinsville[Collinsville.length] = createMarker(new GPoint(-89.97315216,38.69586182),"",iconRd); mySelect.options[mySelect.options.length] = new Option("John A Renfro Elementary School",'Collinsville=' + Collinsville.length); Edwardsville[Edwardsville.length] = createMarker(new GPoint(-89.97512054,38.78712082),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Keys Charter School",'Edwardsville=' + Edwardsville.length); Collinsville[Collinsville.length] = createMarker(new GPoint(-90.04570007,38.66186142),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Kreitner Elementary School",'Collinsville=' + Collinsville.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.11676788,38.70243835),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lake Elementary School",'Granite_City=' + Granite_City.length); Edwardsville[Edwardsville.length] = createMarker(new GPoint(-89.94491577,38.79823685),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Leclaire Elementary School",'Edwardsville=' + Edwardsville.length); Godfrey[Godfrey.length] = createMarker(new GPoint(-90.18097687,38.96623611),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lewis & Clark Elementary School",'Godfrey=' + Godfrey.length); Wood_River[Wood_River.length] = createMarker(new GPoint(-90.08801270,38.86213684),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lewis-clark Elementary School",'Wood_River=' + Wood_River.length); Wood_River[Wood_River.length] = createMarker(new GPoint(-90.08801270,38.86213684),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Lewis-clark Junior High School",'Wood_River=' + Wood_River.length); Edwardsville[Edwardsville.length] = createMarker(new GPoint(-89.94048309,38.81581879),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Liberty Middle School",'Edwardsville=' + Edwardsville.length); Venice[Venice.length] = createMarker(new GPoint(-90.16590600,38.65424400),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Lincoln Charter School",'Venice=' + Venice.length); East_Alton[East_Alton.length] = createMarker(new GPoint(-90.11072540,38.88117981),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Early Childhood Center",'East_Alton=' + East_Alton.length); Edwardsville[Edwardsville.length] = createMarker(new GPoint(-89.96417236,38.80960464),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Lincoln Middle School",'Edwardsville=' + Edwardsville.length); Livingston[Livingston.length] = createMarker(new GPoint(-89.76049805,38.96699905),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Livingston High School",'Livingston=' + Livingston.length); Alton[Alton.length] = createMarker(new GPoint(-90.16802216,38.90534210),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lovejoy Elementary School",'Alton=' + Alton.length); Alton[Alton.length] = createMarker(new GPoint(-90.14842224,38.89007568),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Madison Co Educ Therapy Pgm",'Alton=' + Alton.length); Madison[Madison.length] = createMarker(new GPoint(-90.14439392,38.68554688),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Madison Middle School",'Madison=' + Madison.length); Madison[Madison.length] = createMarker(new GPoint(-90.14392090,38.68124008),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Madison Senior High School",'Madison=' + Madison.length); Madison[Madison.length] = createMarker(new GPoint(-90.15720900,38.67960000),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Madison Student Support Center",'Madison=' + Madison.length); Marine[Marine.length] = createMarker(new GPoint(-89.78447723,38.78663635),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Marine Elementary School",'Marine=' + Marine.length); Alton[Alton.length] = createMarker(new GPoint(-90.13114929,38.89068985),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mark Twain Elementary School",'Alton=' + Alton.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.10427856,38.73875427),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Maryville Elementary School",'Granite_City=' + Granite_City.length); Maryville[Maryville.length] = createMarker(new GPoint(-89.96787262,38.72403717),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Maryville Elementary School",'Maryville=' + Maryville.length); Troy[Troy.length] = createMarker(new GPoint(-89.87650299,38.72944260),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Mccray-dewey School",'Troy=' + Troy.length); Moro[Moro.length] = createMarker(new GPoint(-90.01181030,38.90625000),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Meadowbrook Intermediate School",'Moro=' + Moro.length); Moro[Moro.length] = createMarker(new GPoint(-89.97053528,38.93033600),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Midway School",'Moro=' + Moro.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.08750153,38.76156235),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mitchell Elementary School",'Granite_City=' + Granite_City.length); Troy[Troy.length] = createMarker(new GPoint(-89.87648010,38.72959900),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Molden Elementary School",'Troy=' + Troy.length); Alton[Alton.length] = createMarker(new GPoint(-90.15039825,38.90883636),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Motivational Achievemnt Center",'Alton=' + Alton.length); Edwardsville[Edwardsville.length] = createMarker(new GPoint(-89.97362518,38.81465149),"",iconRd); mySelect.options[mySelect.options.length] = new Option("N O Nelson Elementary School",'Edwardsville=' + Edwardsville.length); New_Douglas[New_Douglas.length] = createMarker(new GPoint(-89.68029785,38.96139908),"",iconRd); mySelect.options[mySelect.options.length] = new Option("New Douglas Elementary School",'New_Douglas=' + New_Douglas.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.12937164,38.71590805),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Niedringhaus Elementary School",'Granite_City=' + Granite_City.length); Collinsville[Collinsville.length] = createMarker(new GPoint(-89.97064209,38.69313049),"",iconBl); mySelect.options[mySelect.options.length] = new Option("North Junior High School",'Collinsville=' + Collinsville.length); Godfrey[Godfrey.length] = createMarker(new GPoint(-90.19097137,38.94773865),"",iconBl); mySelect.options[mySelect.options.length] = new Option("North Middle School",'Godfrey=' + Godfrey.length); Bethalto[Bethalto.length] = createMarker(new GPoint(-90.03340149,38.91290665),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Parkside Primary School",'Bethalto=' + Bethalto.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.15657806,38.71416473),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Prather Elementary School",'Granite_City=' + Granite_City.length); Roxana[Roxana.length] = createMarker(new GPoint(-90.07632446,38.84595871),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Roxana Junior High School",'Roxana=' + Roxana.length); Roxana[Roxana.length] = createMarker(new GPoint(-90.07632446,38.84595871),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Roxana Senior High School",'Roxana=' + Roxana.length); Bethalto[Bethalto.length] = createMarker(new GPoint(-90.03781891,38.91196823),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Simpson Attendance Center",'Bethalto=' + Bethalto.length); South_Roxana[South_Roxana.length] = createMarker(new GPoint(-90.05730438,38.82944107),"",iconRd); mySelect.options[mySelect.options.length] = new Option("South Roxana Elementary School",'South_Roxana=' + South_Roxana.length); St_Jacob[St_Jacob.length] = createMarker(new GPoint(-89.78250122,38.71220016),"",iconRd); mySelect.options[mySelect.options.length] = new Option("St Jacob Elementary School",'St_Jacob=' + St_Jacob.length); Collinsville[Collinsville.length] = createMarker(new GPoint(-89.99646759,38.67428589),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Summit Elementary School",'Collinsville=' + Collinsville.length); Troy[Troy.length] = createMarker(new GPoint(-89.85594940,38.71755981),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Triad High School",'Troy=' + Troy.length); St_Jacob[St_Jacob.length] = createMarker(new GPoint(-89.82003784,38.71623611),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Triad Middle School",'St_Jacob=' + St_Jacob.length); Venice[Venice.length] = createMarker(new GPoint(-90.16685486,38.67376709),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Venice Elementary School",'Venice=' + Venice.length); Venice[Venice.length] = createMarker(new GPoint(-90.16685486,38.67376709),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Venice High School",'Venice=' + Venice.length); Troy[Troy.length] = createMarker(new GPoint(-89.88124084,38.73004150),"",iconRd); mySelect.options[mySelect.options.length] = new Option("W S Freeman Elementary School",'Troy=' + Troy.length); East_Alton[East_Alton.length] = createMarker(new GPoint(-90.10557556,38.87736511),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'East_Alton=' + East_Alton.length); Collinsville[Collinsville.length] = createMarker(new GPoint(-89.98577881,38.66879654),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Webster Elementary School",'Collinsville=' + Collinsville.length); Alton[Alton.length] = createMarker(new GPoint(-90.19463348,38.90620804),"",iconRd); mySelect.options[mySelect.options.length] = new Option("West Elementary School",'Alton=' + Alton.length); Bethalto[Bethalto.length] = createMarker(new GPoint(-90.05347443,38.90803528),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Wilbur Trimpe Middle School",'Bethalto=' + Bethalto.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.10792542,38.71431732),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Wilson Elementary School",'Granite_City=' + Granite_City.length); Edwardsville[Edwardsville.length] = createMarker(new GPoint(-89.96658325,38.80708313),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodland Elementary School",'Edwardsville=' + Edwardsville.length); Worden[Worden.length] = createMarker(new GPoint(-89.85070038,38.93050003),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Worden Elementary School",'Worden=' + Worden.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.10352325,38.71913910),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Worthen Elementary School",'Granite_City=' + Granite_City.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(Alhambra); map.removeOverlays(Alton); map.removeOverlays(Bethalto); map.removeOverlays(Collinsville); map.removeOverlays(East_Alton); map.removeOverlays(Edwardsville); map.removeOverlays(Glen_Carbon); map.removeOverlays(Godfrey); map.removeOverlays(Granite_City); map.removeOverlays(Hamel); map.removeOverlays(Hartford); map.removeOverlays(Highland); map.removeOverlays(Livingston); map.removeOverlays(Madison); map.removeOverlays(Marine); map.removeOverlays(Maryville); map.removeOverlays(Moro); map.removeOverlays(New_Douglas); map.removeOverlays(Roxana); map.removeOverlays(South_Roxana); map.removeOverlays(St_Jacob); map.removeOverlays(Troy); map.removeOverlays(Venice); map.removeOverlays(Wood_River); map.removeOverlays(Worden); 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(Livingston);map.removeOverlays(Alhambra); map.removeOverlays(Alton); map.removeOverlays(Bethalto); map.removeOverlays(Collinsville); map.removeOverlays(East_Alton); map.removeOverlays(Edwardsville); map.removeOverlays(Glen_Carbon); map.removeOverlays(Godfrey); map.removeOverlays(Granite_City); map.removeOverlays(Hamel); map.removeOverlays(Hartford); map.removeOverlays(Highland); map.removeOverlays(Livingston); map.removeOverlays(Madison); map.removeOverlays(Marine); map.removeOverlays(Maryville); map.removeOverlays(Moro); map.removeOverlays(New_Douglas); map.removeOverlays(Roxana); map.removeOverlays(South_Roxana); map.removeOverlays(St_Jacob); map.removeOverlays(Troy); map.removeOverlays(Venice); map.removeOverlays(Wood_River); map.removeOverlays(Worden); map.addOverlays(Alhambra); centerByArray(Alhambra, false, false); cntMarker += Alhambra.length; map.addOverlays(Alton); centerByArray(Alton, false, false); cntMarker += Alton.length; map.addOverlays(Bethalto); centerByArray(Bethalto, false, false); cntMarker += Bethalto.length; map.addOverlays(Collinsville); centerByArray(Collinsville, false, false); cntMarker += Collinsville.length; map.addOverlays(East_Alton); centerByArray(East_Alton, false, false); cntMarker += East_Alton.length; map.addOverlays(Edwardsville); centerByArray(Edwardsville, false, false); cntMarker += Edwardsville.length; map.addOverlays(Glen_Carbon); centerByArray(Glen_Carbon, false, false); cntMarker += Glen_Carbon.length; map.addOverlays(Godfrey); centerByArray(Godfrey, false, false); cntMarker += Godfrey.length; map.addOverlays(Granite_City); centerByArray(Granite_City, false, false); cntMarker += Granite_City.length; map.addOverlays(Hamel); centerByArray(Hamel, false, false); cntMarker += Hamel.length; map.addOverlays(Hartford); centerByArray(Hartford, false, false); cntMarker += Hartford.length; map.addOverlays(Highland); centerByArray(Highland, false, false); cntMarker += Highland.length; map.addOverlays(Livingston); centerByArray(Livingston, false, false); cntMarker += Livingston.length; map.addOverlays(Madison); centerByArray(Madison, false, false); cntMarker += Madison.length; map.addOverlays(Marine); centerByArray(Marine, false, false); cntMarker += Marine.length; map.addOverlays(Maryville); centerByArray(Maryville, false, false); cntMarker += Maryville.length; map.addOverlays(Moro); centerByArray(Moro, false, false); cntMarker += Moro.length; map.addOverlays(New_Douglas); centerByArray(New_Douglas, false, false); cntMarker += New_Douglas.length; map.addOverlays(Roxana); centerByArray(Roxana, false, false); cntMarker += Roxana.length; map.addOverlays(South_Roxana); centerByArray(South_Roxana, false, false); cntMarker += South_Roxana.length; map.addOverlays(St_Jacob); centerByArray(St_Jacob, false, false); cntMarker += St_Jacob.length; map.addOverlays(Troy); centerByArray(Troy, false, false); cntMarker += Troy.length; map.addOverlays(Venice); centerByArray(Venice, false, false); cntMarker += Venice.length; map.addOverlays(Wood_River); centerByArray(Wood_River, false, false); cntMarker += Wood_River.length; map.addOverlays(Worden); centerByArray(Worden, false, false); cntMarker += Worden.length; centerByArray(Livingston,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'); } }