function addMarkers() { mySelect = document.getElementById('selection'); Barstow = [];Andalusia = [];Carbon_Cliff = [];Coal_Valley = [];Rock_Island = [];Moline = [];East_Moline = [];Silvis = [];Milan = [];Hampton = [];Illinois_City = [];Reynolds = [];Port_Byron = [];Taylor_Ridge = [];Sherrard = [];mySelect.options[mySelect.options.length] = new Option("Andalusia schools",'all=Andalusia'); mySelect.options[mySelect.options.length] = new Option("Barstow schools",'all=Barstow'); mySelect.options[mySelect.options.length] = new Option("Carbon Cliff schools",'all=Carbon_Cliff'); mySelect.options[mySelect.options.length] = new Option("Coal Valley schools",'all=Coal_Valley'); mySelect.options[mySelect.options.length] = new Option("East Moline schools",'all=East_Moline'); mySelect.options[mySelect.options.length] = new Option("Hampton schools",'all=Hampton'); mySelect.options[mySelect.options.length] = new Option("Illinois City schools",'all=Illinois_City'); mySelect.options[mySelect.options.length] = new Option("Milan schools",'all=Milan'); mySelect.options[mySelect.options.length] = new Option("Moline schools",'all=Moline'); mySelect.options[mySelect.options.length] = new Option("Port Byron schools",'all=Port_Byron'); mySelect.options[mySelect.options.length] = new Option("Reynolds schools",'all=Reynolds'); mySelect.options[mySelect.options.length] = new Option("Rock Island schools",'all=Rock_Island'); mySelect.options[mySelect.options.length] = new Option("Sherrard schools",'all=Sherrard'); mySelect.options[mySelect.options.length] = new Option("Silvis schools",'all=Silvis'); mySelect.options[mySelect.options.length] = new Option("Taylor Ridge schools",'all=Taylor_Ridge'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Barstow[Barstow.length] = createMarker(new GPoint(-90.35690308,41.51829910),"
Aldrin Junior High School
Po Box 140
Barstow, IL 61236

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Aldrin Junior High School",'Barstow=' + Barstow.length); Andalusia[Andalusia.length] = createMarker(new GPoint(-90.73220062,41.43750000),"
Andalusia Elementary School
Po Box 770
Andalusia, IL 61232

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Andalusia Elementary School",'Andalusia=' + Andalusia.length); Carbon_Cliff[Carbon_Cliff.length] = createMarker(new GPoint(-90.39109802,41.49629974),"
Apollo Elementary School
Po Box 280
Carbon Cliff, IL 61239

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Apollo Elementary School",'Carbon_Cliff=' + Carbon_Cliff.length); Coal_Valley[Coal_Valley.length] = createMarker(new GPoint(-90.46727753,41.39635086),"
Arrowhead Ranch Boys School
Po Box 370
Coal Valley, IL 61240

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Arrowhead Ranch Boys School",'Coal_Valley=' + Coal_Valley.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.58626556,41.50374222),"
Art Program Middle School
630 9th St
Rock Island, IL 61201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Art Program Middle School",'Rock_Island=' + Rock_Island.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.56272125,41.49363708),"
Audubon Elementary School
2601 - 18th Ave
Rock Island, IL 61201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Audubon Elementary School",'Rock_Island=' + Rock_Island.length); Moline[Moline.length] = createMarker(new GPoint(-90.46437073,41.50206375),"
Benjamin Franklin Elementary School
5312 11th Ave C
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Benjamin Franklin Elementary School",'Moline=' + Moline.length); Coal_Valley[Coal_Valley.length] = createMarker(new GPoint(-90.46128082,41.44128036),"
Bicentennial Elementary School
1004 1st St
Coal Valley, IL 61240

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bicentennial Elementary School",'Coal_Valley=' + Coal_Valley.length); East_Moline[East_Moline.length] = createMarker(new GPoint(-90.43671417,41.48341751),"
Black Hawk Ed Center
4680 11th St
East Moline, IL 61244

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Black Hawk Ed Center",'East_Moline=' + East_Moline.length); Silvis[Silvis.length] = createMarker(new GPoint(-90.41541290,41.48719788),"
Bowlesburg Elementary School
2221 10th St
Silvis, IL 61282

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bowlesburg Elementary School",'Silvis=' + Silvis.length); Moline[Moline.length] = createMarker(new GPoint(-90.47098541,41.46976089),"
Butterworth Elementary School
4205 48th St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Butterworth Elementary School",'Moline=' + Moline.length); Milan[Milan.length] = createMarker(new GPoint(-90.56320190,41.40634537),"
Coyne Center Elementary School
11310 16th St
Milan, IL 61264

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Coyne Center Elementary School",'Milan=' + Milan.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.54390717,41.49003601),"
Denkmann Elementary School
4101 22nd Ave
Rock Island, IL 61201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Denkmann Elementary School",'Rock_Island=' + Rock_Island.length); Silvis[Silvis.length] = createMarker(new GPoint(-90.40077972,41.50022125),"
Eagle Ridge School
2002 Eagle Ridge Dr
Silvis, IL 61282

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eagle Ridge School",'Silvis=' + Silvis.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.58698273,41.47145844),"
Earl H Hanson Elementary School
4000 9th St
Rock Island, IL 61201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Earl H Hanson Elementary School",'Rock_Island=' + Rock_Island.length); East_Moline[East_Moline.length] = createMarker(new GPoint(-90.42181396,41.53176117),"
East Moline Correctional Center
100 Hillcrest Rd
East Moline, IL 61244

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Moline Correctional Center",'East_Moline=' + East_Moline.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.58661652,41.47006989),"
Edison Junior High School
4141 - 9th St
Rock Island, IL 61201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Edison Junior High School",'Rock_Island=' + Rock_Island.length); Moline[Moline.length] = createMarker(new GPoint(-90.53290558,41.50483704),"
Ericsson Elementary School
335 5th Ave
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ericsson Elementary School",'Moline=' + Moline.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.55908966,41.47877884),"
Eugene Field Elementary School
2900 31st Ave
Rock Island, IL 61201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eugene Field Elementary School",'Rock_Island=' + Rock_Island.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.58623505,41.48583221),"
Frances Willard Elementary School
2503 9th St
Rock Island, IL 61201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Frances Willard Elementary School",'Rock_Island=' + Rock_Island.length); Moline[Moline.length] = createMarker(new GPoint(-90.51538086,41.48726273),"
Garfield Elementary School
1518 25th Ave
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Moline=' + Moline.length); Silvis[Silvis.length] = createMarker(new GPoint(-90.41204071,41.50564957),"
George O Barr School
1305 5th Ave
Silvis, IL 61282

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George O Barr School",'Silvis=' + Silvis.length); Moline[Moline.length] = createMarker(new GPoint(-90.47971344,41.49760056),"
George Washington Elementary School
1550 41st St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George Washington Elementary School",'Moline=' + Moline.length); East_Moline[East_Moline.length] = createMarker(new GPoint(-90.44421387,41.49956131),"
Glenview Middle School
3100 7th St
East Moline, IL 61244

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Glenview Middle School",'East_Moline=' + East_Moline.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.58913422,41.50054932),"
Grant Intensive Basic Elementary School
600 11th Ave
Rock Island, IL 61201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Grant Intensive Basic Elementary School",'Rock_Island=' + Rock_Island.length); Moline[Moline.length] = createMarker(new GPoint(-90.52796173,41.48043060),"
Hamilton Elementary School
700 32nd Ave
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hamilton Elementary School",'Moline=' + Moline.length); Hampton[Hampton.length] = createMarker(new GPoint(-90.40740204,41.55469894),"
Hampton Elementary School
206 5th St
Hampton, IL 61256

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hampton Elementary School",'Hampton=' + Hampton.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.57952118,41.50192261),"
Hawthorne-irving Elementary School
930 14th St
Rock Island, IL 61201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hawthorne-irving Elementary School",'Rock_Island=' + Rock_Island.length); East_Moline[East_Moline.length] = createMarker(new GPoint(-90.45071411,41.50988770),"
Hillcrest Elementary School
451 22nd Ave
East Moline, IL 61244

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hillcrest Elementary School",'East_Moline=' + East_Moline.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.55096436,41.47133255),"
Horace Mann Choice School
3530 38th Ave
Rock Island, IL 61201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Horace Mann Choice School",'Rock_Island=' + Rock_Island.length); Moline[Moline.length] = createMarker(new GPoint(-90.48631287,41.45333862),"
Horace Mann Elementary School
3601 69th Ave
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Horace Mann Elementary School",'Moline=' + Moline.length); Illinois_City[Illinois_City.length] = createMarker(new GPoint(-90.90429687,41.39130020),"
Illinois City Elementary School
Po Box 39
Illinois City, IL 61259

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Illinois City Elementary School",'Illinois_City=' + Illinois_City.length); Moline[Moline.length] = createMarker(new GPoint(-90.48989900,41.49173300),"
Interdist Ece Program
4000 11th St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Interdist Ece Program",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.51971436,41.46886444),"
Interdist Ece Program Elementary School
4000 11th St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Interdist Ece Program Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.46291351,41.47555161),"
Jane Addams Elementary School
3520 53rd St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jane Addams Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.49497986,41.48566437),"
Jefferson Early Childhood Center
3010 26th Ave
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Early Childhood Center",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.52164459,41.49162674),"
John Deere Middle School
2035 11th St
Moline, IL 61265

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("John Deere Middle School",'Moline=' + Moline.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.57031250,41.50606155),"
Lincoln Elementary School
2100 6th Ave
Rock Island, IL 61201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Rock_Island=' + Rock_Island.length); Moline[Moline.length] = createMarker(new GPoint(-90.52210999,41.49693680),"
Lincoln-irving Elementary School
1015 16th Ave
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln-irving Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.50128174,41.49608231),"
Logan Elementary School
1602 25th St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Logan Elementary School",'Moline=' + Moline.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.54299164,41.50456238),"
Longfellow Elementary School
4198 7th Ave
Rock Island, IL 61201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Longfellow Elementary School",'Rock_Island=' + Rock_Island.length); Moline[Moline.length] = createMarker(new GPoint(-90.48831940,41.49141312),"
Moline Alternative High School
3428 Ave The Cities
Moline, IL 61265

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Moline Alternative High School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.48405457,41.49075317),"
Moline Senior High School
3600 Ave The Cities
Moline, IL 61265

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Moline Senior High School",'Moline=' + Moline.length); Carbon_Cliff[Carbon_Cliff.length] = createMarker(new GPoint(-90.39109802,41.49629974),"
Phoenix Program High School
Po Box 100
Carbon Cliff, IL 61239

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Phoenix Program High School",'Carbon_Cliff=' + Carbon_Cliff.length); Reynolds[Reynolds.length] = createMarker(new GPoint(-90.67496490,41.33093643),"
Reynolds Elementary School
705 Edgington
Reynolds, IL 61279

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Reynolds Elementary School",'Reynolds=' + Reynolds.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.58671570,41.42407227),"
Ridgewood Elementary School
9607 14th St W
Rock Island, IL 61201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ridgewood Elementary School",'Rock_Island=' + Rock_Island.length); East_Moline[East_Moline.length] = createMarker(new GPoint(-90.44232941,41.50036240),"
Ridgewood Elementary School
814 30th Ave
East Moline, IL 61244

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ridgewood Elementary School",'East_Moline=' + East_Moline.length); Port_Byron[Port_Byron.length] = createMarker(new GPoint(-90.26769257,41.61379623),"
Riverdale Elementary School
9424 256th St N
Port Byron, IL 61275

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverdale Elementary School",'Port_Byron=' + Port_Byron.length); Port_Byron[Port_Byron.length] = createMarker(new GPoint(-90.26773071,41.62356949),"
Riverdale Middle School
9822 256th St N
Port Byron, IL 61275

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Riverdale Middle School",'Port_Byron=' + Port_Byron.length); Port_Byron[Port_Byron.length] = createMarker(new GPoint(-90.33515930,41.60662842),"
Riverdale Senior High School
9622-256th St N
Port Byron, IL 61275

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Riverdale Senior High School",'Port_Byron=' + Port_Byron.length); Moline[Moline.length] = createMarker(new GPoint(-90.48826599,41.49140549),"
Rock Island Co Reg Safe School
3430 23rd Ave
Moline, IL 61265

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rock Island Co Reg Safe School",'Moline=' + Moline.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.57768250,41.48561859),"
Rock Island High School
1400 25th Ave
Rock Island, IL 61201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rock Island High School",'Rock_Island=' + Rock_Island.length); Taylor_Ridge[Taylor_Ridge.length] = createMarker(new GPoint(-90.76567841,41.38686752),"
Rockridge High School
14110 134th Ave W
Taylor Ridge, IL 61284

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rockridge High School",'Taylor_Ridge=' + Taylor_Ridge.length); Taylor_Ridge[Taylor_Ridge.length] = createMarker(new GPoint(-90.76567841,41.38686752),"
Rockridge Junior High School
14110 134th Ave W
Taylor Ridge, IL 61284

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rockridge Junior High School",'Taylor_Ridge=' + Taylor_Ridge.length); Moline[Moline.length] = createMarker(new GPoint(-90.48551178,41.49100876),"
Roosevelt Elementary School
3530 Ave The Cities
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Moline=' + Moline.length); Sherrard[Sherrard.length] = createMarker(new GPoint(-90.50469971,41.34090042),"
Sherrard High School
4701 176th Ave
Sherrard, IL 61281

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sherrard High School",'Sherrard=' + Sherrard.length); Sherrard[Sherrard.length] = createMarker(new GPoint(-90.50469971,41.34090042),"
Sherrard Junior High School
4701 176th Ave
Sherrard, IL 61281

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sherrard Junior High School",'Sherrard=' + Sherrard.length); Silvis[Silvis.length] = createMarker(new GPoint(-90.41204071,41.50564957),"
Silvis Junior High School
1305 5th Ave
Silvis, IL 61282

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Silvis Junior High School",'Silvis=' + Silvis.length); Taylor_Ridge[Taylor_Ridge.length] = createMarker(new GPoint(-90.67204285,41.38866043),"
Taylor Ridge Elementary School
13227 Turkey Holw
Taylor Ridge, IL 61284

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Taylor Ridge Elementary School",'Taylor_Ridge=' + Taylor_Ridge.length); Milan[Milan.length] = createMarker(new GPoint(-90.57201385,41.43854141),"
Thomas Jefferson Elementary School
1307 4th St W
Milan, IL 61264

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thomas Jefferson Elementary School",'Milan=' + Milan.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.57028961,41.50783539),"
Thurgood Marshall Learning Center
600 11th Ave
Rock Island, IL 61201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Thurgood Marshall Learning Center",'Rock_Island=' + Rock_Island.length); East_Moline[East_Moline.length] = createMarker(new GPoint(-90.43277740,41.49042511),"
United Township High School
1275 Ave The Cities
East Moline, IL 61244

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("United Township High School",'East_Moline=' + East_Moline.length); East_Moline[East_Moline.length] = createMarker(new GPoint(-90.43277740,41.49042511),"
United Twp Area Career Center
1275 Ave Of Cities
East Moline, IL 61244

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("United Twp Area Career Center",'East_Moline=' + East_Moline.length); Rock_Island[Rock_Island.length] = createMarker(new GPoint(-90.55291748,41.49316406),"
Washington Junior High School
3300 18th St
Rock Island, IL 61201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Washington Junior High School",'Rock_Island=' + Rock_Island.length); East_Moline[East_Moline.length] = createMarker(new GPoint(-90.45197296,41.48921967),"
Wells Elementary School
490 42nd Ave
East Moline, IL 61244

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wells Elementary School",'East_Moline=' + East_Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.51323700,41.49653625),"
Willard Elementary School
1616 16th St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Willard Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.47047424,41.49963760),"
Woodrow Wilson Middle School
1301 48th St
Moline, IL 61265

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Woodrow Wilson Middle School",'Moline=' + Moline.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(Andalusia); map.removeOverlays(Barstow); map.removeOverlays(Carbon_Cliff); map.removeOverlays(Coal_Valley); map.removeOverlays(East_Moline); map.removeOverlays(Hampton); map.removeOverlays(Illinois_City); map.removeOverlays(Milan); map.removeOverlays(Moline); map.removeOverlays(Port_Byron); map.removeOverlays(Reynolds); map.removeOverlays(Rock_Island); map.removeOverlays(Sherrard); map.removeOverlays(Silvis); map.removeOverlays(Taylor_Ridge); 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(Barstow);map.removeOverlays(Andalusia); map.removeOverlays(Barstow); map.removeOverlays(Carbon_Cliff); map.removeOverlays(Coal_Valley); map.removeOverlays(East_Moline); map.removeOverlays(Hampton); map.removeOverlays(Illinois_City); map.removeOverlays(Milan); map.removeOverlays(Moline); map.removeOverlays(Port_Byron); map.removeOverlays(Reynolds); map.removeOverlays(Rock_Island); map.removeOverlays(Sherrard); map.removeOverlays(Silvis); map.removeOverlays(Taylor_Ridge); map.addOverlays(Andalusia); centerByArray(Andalusia, false, false); cntMarker += Andalusia.length; map.addOverlays(Barstow); centerByArray(Barstow, false, false); cntMarker += Barstow.length; map.addOverlays(Carbon_Cliff); centerByArray(Carbon_Cliff, false, false); cntMarker += Carbon_Cliff.length; map.addOverlays(Coal_Valley); centerByArray(Coal_Valley, false, false); cntMarker += Coal_Valley.length; map.addOverlays(East_Moline); centerByArray(East_Moline, false, false); cntMarker += East_Moline.length; map.addOverlays(Hampton); centerByArray(Hampton, false, false); cntMarker += Hampton.length; map.addOverlays(Illinois_City); centerByArray(Illinois_City, false, false); cntMarker += Illinois_City.length; map.addOverlays(Milan); centerByArray(Milan, false, false); cntMarker += Milan.length; map.addOverlays(Moline); centerByArray(Moline, false, false); cntMarker += Moline.length; map.addOverlays(Port_Byron); centerByArray(Port_Byron, false, false); cntMarker += Port_Byron.length; map.addOverlays(Reynolds); centerByArray(Reynolds, false, false); cntMarker += Reynolds.length; map.addOverlays(Rock_Island); centerByArray(Rock_Island, false, false); cntMarker += Rock_Island.length; map.addOverlays(Sherrard); centerByArray(Sherrard, false, false); cntMarker += Sherrard.length; map.addOverlays(Silvis); centerByArray(Silvis, false, false); cntMarker += Silvis.length; map.addOverlays(Taylor_Ridge); centerByArray(Taylor_Ridge, false, false); cntMarker += Taylor_Ridge.length; centerByArray(Barstow,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'); } }