function addMarkers() { mySelect = document.getElementById('selection'); Bourbonnais = [];Aroma_Park = [];Bonfield = [];Bradley = [];Kankakee = [];Hopkins_Park = [];Grant_Park = [];Herscher = [];Manteno = [];Momence = [];Reddick = [];St_Anne = [];mySelect.options[mySelect.options.length] = new Option("Aroma Park schools",'all=Aroma_Park'); mySelect.options[mySelect.options.length] = new Option("Bonfield schools",'all=Bonfield'); mySelect.options[mySelect.options.length] = new Option("Bourbonnais schools",'all=Bourbonnais'); mySelect.options[mySelect.options.length] = new Option("Bradley schools",'all=Bradley'); mySelect.options[mySelect.options.length] = new Option("Grant Park schools",'all=Grant_Park'); mySelect.options[mySelect.options.length] = new Option("Herscher schools",'all=Herscher'); mySelect.options[mySelect.options.length] = new Option("Hopkins Park schools",'all=Hopkins_Park'); mySelect.options[mySelect.options.length] = new Option("Kankakee schools",'all=Kankakee'); mySelect.options[mySelect.options.length] = new Option("Manteno schools",'all=Manteno'); mySelect.options[mySelect.options.length] = new Option("Momence schools",'all=Momence'); mySelect.options[mySelect.options.length] = new Option("Reddick schools",'all=Reddick'); mySelect.options[mySelect.options.length] = new Option("St Anne schools",'all=St_Anne'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Bourbonnais[Bourbonnais.length] = createMarker(new GPoint(-87.87538147,41.16125488),"
Alan B Shepard Elementary School
325 N Convent St
Bourbonnais, IL 60914

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Alan B Shepard Elementary School",'Bourbonnais=' + Bourbonnais.length); Aroma_Park[Aroma_Park.length] = createMarker(new GPoint(-87.80619812,41.07960129),"
Aroma Park Primary School
Po Box 239
Aroma Park, IL 60910

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Aroma Park Primary School",'Aroma_Park=' + Aroma_Park.length); Bonfield[Bonfield.length] = createMarker(new GPoint(-88.05045600,41.14682900),"
Bonfield Grade School
522 E Smith St
Bonfield, IL 60913

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bonfield Grade School",'Bonfield=' + Bonfield.length); Bourbonnais[Bourbonnais.length] = createMarker(new GPoint(-87.87857819,41.16559982),"
Bourbonnais Upper Grade Center
200 W John Casey Rd
Bourbonnais, IL 60914

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bourbonnais Upper Grade Center",'Bourbonnais=' + Bourbonnais.length); Bradley[Bradley.length] = createMarker(new GPoint(-87.86476135,41.14419174),"
Bradley Central Middle School
260 N Wabash Ave
Bradley, IL 60915

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bradley Central Middle School",'Bradley=' + Bradley.length); Bradley[Bradley.length] = createMarker(new GPoint(-87.85528564,41.14066315),"
Bradley East Elementary School
610 E Liberty St
Bradley, IL 60915

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bradley East Elementary School",'Bradley=' + Bradley.length); Bradley[Bradley.length] = createMarker(new GPoint(-87.87920380,41.14350128),"
Bradley West Elementary School
200 W State St
Bradley, IL 60915

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bradley West Elementary School",'Bradley=' + Bradley.length); Bradley[Bradley.length] = createMarker(new GPoint(-87.86978149,41.14786148),"
Bradley-bourbonnais C High School
700 W North St
Bradley, IL 60915

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bradley-bourbonnais C High School",'Bradley=' + Bradley.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.84155273,41.11316681),"
Edison Primary School
1991 E Maple St
Kankakee, IL 60901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edison Primary School",'Kankakee=' + Kankakee.length); Hopkins_Park[Hopkins_Park.length] = createMarker(new GPoint(-87.62404633,41.06462860),"
George Washington Carver School
Po Box Ae
Hopkins Park, IL 60944

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George Washington Carver School",'Hopkins_Park=' + Hopkins_Park.length); Grant_Park[Grant_Park.length] = createMarker(new GPoint(-87.65000153,41.24140167),"
Grant Park Elementary School
Po Box 549
Grant Park, IL 60940

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Grant Park Elementary School",'Grant_Park=' + Grant_Park.length); Grant_Park[Grant_Park.length] = createMarker(new GPoint(-87.65000153,41.24140167),"
Grant Park High School
Po Box 549
Grant Park, IL 60940

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grant Park High School",'Grant_Park=' + Grant_Park.length); Herscher[Herscher.length] = createMarker(new GPoint(-88.08390045,41.02780151),"
Herscher Elementary School
Po Box 504
Herscher, IL 60941

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Herscher Elementary School",'Herscher=' + Herscher.length); Herscher[Herscher.length] = createMarker(new GPoint(-88.08390045,41.02780151),"
Herscher High School
Po Box 504
Herscher, IL 60941

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Herscher High School",'Herscher=' + Herscher.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.87004089,41.07859421),"
I Kan Regional Alternatve Att Center
50 Industrial Dr
Kankakee, IL 60901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("I Kan Regional Alternatve Att Center",'Kankakee=' + Kankakee.length); Hopkins_Park[Hopkins_Park.length] = createMarker(new GPoint(-87.62404633,41.06462860),"
Ida L Busch Elementary School
P O Box Af
Hopkins Park, IL 60944

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ida L Busch Elementary School",'Hopkins_Park=' + Hopkins_Park.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.84787750,41.11703491),"
Impact Program
50 Industrial Park
Kankakee, IL 60901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Impact Program",'Kankakee=' + Kankakee.length); Manteno[Manteno.length] = createMarker(new GPoint(-87.80411530,41.23735809),"
Indian Oaks Academy
101 Bramble Ln
Manteno, IL 60950

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Indian Oaks Academy",'Manteno=' + Manteno.length); Momence[Momence.length] = createMarker(new GPoint(-87.67559052,41.16406250),"
Je-neir Elementary School
1001 W 2nd St
Momence, IL 60954

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Je-neir Elementary School",'Momence=' + Momence.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.87076569,41.11807632),"
Jefferson School
381 S Fourth Ave
Kankakee, IL 60901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson School",'Kankakee=' + Kankakee.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.88636780,41.11356354),"
John Kennedy Middle Grade School
1550 W Calista St
Kankakee, IL 60901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John Kennedy Middle Grade School",'Kankakee=' + Kankakee.length); Bourbonnais[Bourbonnais.length] = createMarker(new GPoint(-87.89517975,41.17804337),"
Kankakee Area Career Center
4083 N 1000w Rd
Bourbonnais, IL 60914

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kankakee Area Career Center",'Bourbonnais=' + Bourbonnais.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.87004089,41.07859421),"
Kankakee Area Co-op Day School
1 Stuart Dr
Kankakee, IL 60901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kankakee Area Co-op Day School",'Kankakee=' + Kankakee.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.88554382,41.10586166),"
Kankakee High School
1200 W Jeffery St
Kankakee, IL 60901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kankakee High School",'Kankakee=' + Kankakee.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.83300018,41.11556244),"
Kankakee Junior High School
2250 E Crestwood St
Kankakee, IL 60901

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kankakee Junior High School",'Kankakee=' + Kankakee.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.84664917,41.11880875),"
King Middle Grade School
1440 E Court St
Kankakee, IL 60901

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("King Middle Grade School",'Kankakee=' + Kankakee.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.87168121,41.12453842),"
Lafayette Primary School
369 N 5th Ave
Kankakee, IL 60901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lafayette Primary School",'Kankakee=' + Kankakee.length); Bourbonnais[Bourbonnais.length] = createMarker(new GPoint(-87.89526300,41.19176500),"
Liberty Intermediate School
1690 Career Cntr Rd
Bourbonnais, IL 60914

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Liberty Intermediate School",'Bourbonnais=' + Bourbonnais.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.86245728,41.12017059),"
Limestone Elementary School
963 N 5000 W Rd
Kankakee, IL 60901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Limestone Elementary School",'Kankakee=' + Kankakee.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.84787750,41.11703491),"
Lincoln Cltrl Ctr-montessori Elementary School
240 Warren Ave
Kankakee, IL 60901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Cltrl Ctr-montessori Elementary School",'Kankakee=' + Kankakee.length); Hopkins_Park[Hopkins_Park.length] = createMarker(new GPoint(-87.59780121,41.06790161),"
Lorenzo R Smith Elementary School
Po Box Ag
Hopkins Park, IL 60944

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lorenzo R Smith Elementary School",'Hopkins_Park=' + Hopkins_Park.length); Manteno[Manteno.length] = createMarker(new GPoint(-87.84468842,41.24553680),"
Manteno Elementary School
555 Cook St
Manteno, IL 60950

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Manteno Elementary School",'Manteno=' + Manteno.length); Manteno[Manteno.length] = createMarker(new GPoint(-87.83851624,41.25560379),"
Manteno High School
443 N Maple St
Manteno, IL 60950

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Manteno High School",'Manteno=' + Manteno.length); Manteno[Manteno.length] = createMarker(new GPoint(-87.84307861,41.25329208),"
Manteno Middle School
250 N Poplar St
Manteno, IL 60950

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Manteno Middle School",'Manteno=' + Manteno.length); Manteno[Manteno.length] = createMarker(new GPoint(-87.83846283,41.25304794),"
Manteno Primary School
251 N Maple St
Manteno, IL 60950

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Manteno Primary School",'Manteno=' + Manteno.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.83432007,41.11886215),"
Mark Twain Primary School
2250 E Court St
Kankakee, IL 60901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mark Twain Primary School",'Kankakee=' + Kankakee.length); Momence[Momence.length] = createMarker(new GPoint(-87.67031860,41.16394806),"
Momence High School
101 N Franklin St
Momence, IL 60954

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Momence High School",'Momence=' + Momence.length); Momence[Momence.length] = createMarker(new GPoint(-87.67369080,41.16406250),"
Momence Junior High School
801 W 2nd St
Momence, IL 60954

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Momence Junior High School",'Momence=' + Momence.length); Bourbonnais[Bourbonnais.length] = createMarker(new GPoint(-87.88549805,41.17013550),"
Noel Levasseur Elementary School
601 Bethel Dr
Bourbonnais, IL 60914

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Noel Levasseur Elementary School",'Bourbonnais=' + Bourbonnais.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.85683441,41.12848663),"
Proegler School
710 N Chicago Ave
Kankakee, IL 60901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Proegler School",'Kankakee=' + Kankakee.length); Momence[Momence.length] = createMarker(new GPoint(-87.66297913,41.16666412),"
Range Elementary School
415 N Dixie Hwy
Momence, IL 60954

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Range Elementary School",'Momence=' + Momence.length); Reddick[Reddick.length] = createMarker(new GPoint(-88.22760010,41.10580063),"
Reddick Elementary School
Po Box 67
Reddick, IL 60961

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Reddick Elementary School",'Reddick=' + Reddick.length); Bourbonnais[Bourbonnais.length] = createMarker(new GPoint(-87.87910461,41.15375900),"
Robert Frost Elementary School
160 W River St
Bourbonnais, IL 60914

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robert Frost Elementary School",'Bourbonnais=' + Bourbonnais.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.87020111,41.11320114),"
Salt School
710 N Chicago Ave
Kankakee, IL 60901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Salt School",'Kankakee=' + Kankakee.length); Bourbonnais[Bourbonnais.length] = createMarker(new GPoint(-87.87538147,41.16123581),"
Shabbona Elementary School
321 N Convent St
Bourbonnais, IL 60914

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shabbona Elementary School",'Bourbonnais=' + Bourbonnais.length); St_Anne[St_Anne.length] = createMarker(new GPoint(-87.72177124,41.02086258),"
St Anne Community High School
650 W Guertin St
St Anne, IL 60964

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Anne Community High School",'St_Anne=' + St_Anne.length); St_Anne[St_Anne.length] = createMarker(new GPoint(-87.69830322,41.06340027),"
St Anne Elementary School
Po Box 530
St Anne, IL 60964

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("St Anne Elementary School",'St_Anne=' + St_Anne.length); Bourbonnais[Bourbonnais.length] = createMarker(new GPoint(-87.77588654,41.19166183),"
St George Elementary School
5200 E Center St
Bourbonnais, IL 60914

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("St George Elementary School",'Bourbonnais=' + Bourbonnais.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.85542297,41.11323929),"
Steuben Elementary School
520 S Wildwood Ave
Kankakee, IL 60901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Steuben Elementary School",'Kankakee=' + Kankakee.length); Kankakee[Kankakee.length] = createMarker(new GPoint(-87.88266754,41.11018372),"
Taft Primary School
1155 W Hawkins St
Kankakee, IL 60901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Taft Primary School",'Kankakee=' + Kankakee.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(Aroma_Park); map.removeOverlays(Bonfield); map.removeOverlays(Bourbonnais); map.removeOverlays(Bradley); map.removeOverlays(Grant_Park); map.removeOverlays(Herscher); map.removeOverlays(Hopkins_Park); map.removeOverlays(Kankakee); map.removeOverlays(Manteno); map.removeOverlays(Momence); map.removeOverlays(Reddick); map.removeOverlays(St_Anne); 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(Bourbonnais);map.removeOverlays(Aroma_Park); map.removeOverlays(Bonfield); map.removeOverlays(Bourbonnais); map.removeOverlays(Bradley); map.removeOverlays(Grant_Park); map.removeOverlays(Herscher); map.removeOverlays(Hopkins_Park); map.removeOverlays(Kankakee); map.removeOverlays(Manteno); map.removeOverlays(Momence); map.removeOverlays(Reddick); map.removeOverlays(St_Anne); map.addOverlays(Aroma_Park); centerByArray(Aroma_Park, false, false); cntMarker += Aroma_Park.length; map.addOverlays(Bonfield); centerByArray(Bonfield, false, false); cntMarker += Bonfield.length; map.addOverlays(Bourbonnais); centerByArray(Bourbonnais, false, false); cntMarker += Bourbonnais.length; map.addOverlays(Bradley); centerByArray(Bradley, false, false); cntMarker += Bradley.length; map.addOverlays(Grant_Park); centerByArray(Grant_Park, false, false); cntMarker += Grant_Park.length; map.addOverlays(Herscher); centerByArray(Herscher, false, false); cntMarker += Herscher.length; map.addOverlays(Hopkins_Park); centerByArray(Hopkins_Park, false, false); cntMarker += Hopkins_Park.length; map.addOverlays(Kankakee); centerByArray(Kankakee, false, false); cntMarker += Kankakee.length; map.addOverlays(Manteno); centerByArray(Manteno, false, false); cntMarker += Manteno.length; map.addOverlays(Momence); centerByArray(Momence, false, false); cntMarker += Momence.length; map.addOverlays(Reddick); centerByArray(Reddick, false, false); cntMarker += Reddick.length; map.addOverlays(St_Anne); centerByArray(St_Anne, false, false); cntMarker += St_Anne.length; centerByArray(Bourbonnais,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'); } }