function addMarkers(){ mySelect = document.getElementById('selection'); La_Grange = [];Lake_Villa = [];Bartlett = [];Calumet_Park = [];Carbondale = [];Chicago = [];Granite_City = [];Niles = [];Peoria = [];Addison = [];Riverdale = [];Quincy = [];mySelect.options[mySelect.options.length] = new Option("Addison schools",'all=Addison'); mySelect.options[mySelect.options.length] = new Option("Bartlett schools",'all=Bartlett'); mySelect.options[mySelect.options.length] = new Option("Calumet Park schools",'all=Calumet_Park'); mySelect.options[mySelect.options.length] = new Option("Carbondale schools",'all=Carbondale'); mySelect.options[mySelect.options.length] = new Option("Chicago schools",'all=Chicago'); mySelect.options[mySelect.options.length] = new Option("Granite City schools",'all=Granite_City'); mySelect.options[mySelect.options.length] = new Option("La Grange schools",'all=La_Grange'); mySelect.options[mySelect.options.length] = new Option("Lake Villa schools",'all=Lake_Villa'); mySelect.options[mySelect.options.length] = new Option("Niles schools",'all=Niles'); mySelect.options[mySelect.options.length] = new Option("Peoria schools",'all=Peoria'); mySelect.options[mySelect.options.length] = new Option("Quincy schools",'all=Quincy'); mySelect.options[mySelect.options.length] = new Option("Riverdale schools",'all=Riverdale'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); La_Grange[La_Grange.length] = createMarker(new GPoint(-87.88720000,41.77277300),"
Acacia Academy
6425 Willow Springs Road
La Grange, IL 60525
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Acacia Academy",'La_Grange=' + La_Grange.length); Lake_Villa[Lake_Villa.length] = createMarker(new GPoint(-88.05568600,42.41208100),"
Allendale School
Po Box 1088
Lake Villa, IL 60046
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Allendale School",'Lake_Villa=' + Lake_Villa.length); Bartlett[Bartlett.length] = createMarker(new GPoint(-88.19945600,41.99455000),"
Bartlett Learning Center
801 W. Bartlett Road
Bartlett, IL 60103
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bartlett Learning Center",'Bartlett=' + Bartlett.length); Calumet_Park[Calumet_Park.length] = createMarker(new GPoint(-87.65514100,41.66774200),"
Beacon Therapeutic School
12440 S Ada Street
Calumet Park, IL 60827
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beacon Therapeutic School",'Calumet_Park=' + Calumet_Park.length); Carbondale[Carbondale.length] = createMarker(new GPoint(-89.19336300,37.71759600),"
Brehm Preparatory School
1245 E Grand Avenue
Carbondale, IL 62901
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brehm Preparatory School",'Carbondale=' + Carbondale.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.65590900,41.91554000),"
Cardinal Bernardin Early Childhood Center
1651 W Diversey Parkway
Chicago, IL 60614
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cardinal Bernardin Early Childhood Center",'Chicago=' + Chicago.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.68144200,41.79129400),"
Carol South West School
5644 South Oakley
Chicago, IL 60636
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carol South West School",'Chicago=' + Chicago.length); Lake_Villa[Lake_Villa.length] = createMarker(new GPoint(-88.05700000,42.41170000),"
Comm Alternative Renewal Exper
Po Box 1128
Lake Villa, IL 60046
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Comm Alternative Renewal Exper",'Lake_Villa=' + Lake_Villa.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.14603100,38.69978200),"
Coordinated Youth & Human Services
2016 Madison Avenue
Granite City, IL 62040
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Coordinated Youth & Human Services",'Granite_City=' + Granite_City.length); Niles[Niles.length] = createMarker(new GPoint(-87.78782000,42.01764500),"
Joseph Academy
7530 N Natchez Avenue
Niles, IL 60714
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Joseph Academy",'Niles=' + Niles.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.59371800,40.71345700),"
Kiefer School
2130 N Knoxville Ave
Peoria, IL 61603
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kiefer School",'Peoria=' + Peoria.length); Addison[Addison.length] = createMarker(new GPoint(-87.99673000,41.93547000),"
Lutherbrook Academy
329 W Lake Street
Addison, IL 60101
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lutherbrook Academy",'Addison=' + Addison.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.75446800,41.93883700),"
North Center For Handicapped Children
5104 W Belmont Avenue
Chicago, IL 60641
Co-ed school, 11-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Center For Handicapped Children",'Chicago=' + Chicago.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.66783400,42.01167400),"
PACTT Learing Center
7101 N. Greenview Ave.
Chicago, IL 60626
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("PACTT Learing Center",'Chicago=' + Chicago.length); Riverdale[Riverdale.length] = createMarker(new GPoint(-87.62791500,41.63307000),"
Queen Of Apostles School
14419 S Atlantic Ave
Riverdale, IL 60827
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Queen Of Apostles School",'Riverdale=' + Riverdale.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.71032500,41.70623700),"
Queen Of Martyrs Elementary School
3550 West 103rd Street
Chicago, IL 60655
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Queen Of Martyrs Elementary School",'Chicago=' + Chicago.length); Quincy[Quincy.length] = createMarker(new GPoint(-91.35360000,39.93600000),"
Quincy School For Handicapped
Box 3646 4409 Maine
Quincy, IL 62305
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Quincy School For Handicapped",'Quincy=' + Quincy.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.71805300,41.99043700),"
St. Bernadette School
3550 W Peterson Av
Chicago, IL 60659
Co-ed school, 1-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Bernadette School",'Chicago=' + Chicago.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.63401500,41.84245000),"
St. Jerome School
2801 S Princeton Avenue
Chicago, IL 60616
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Jerome School",'Chicago=' + Chicago.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.56528300,41.75809300),"
South Central Community Services
7550 S Phillips Avenue
Chicago, IL 60649
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Central Community Services",'Chicago=' + Chicago.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.59789700,41.74397200),"
South Central Day Treatment
1021 E 83rd Street
Chicago, IL 60619
Co-ed school, 3-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Central Day Treatment",'Chicago=' + Chicago.length); Niles[Niles.length] = createMarker(new GPoint(-87.80486000,42.01619600),"
St Bernadette's School For Special Children
7429 N Milwaukee Avenue
Niles, IL 60714
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Bernadette's School For Special Children",'Niles=' + Niles.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.64253900,41.88598800),"
Uhlich Academy
217 N Jefferson
Chicago, IL 60661
Co-ed school, 2-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Uhlich Academy",'Chicago=' + Chicago.length); map.removeOverlays(Addison); map.removeOverlays(Bartlett); map.removeOverlays(Calumet_Park); map.removeOverlays(Carbondale); map.removeOverlays(Chicago); map.removeOverlays(Granite_City); map.removeOverlays(La_Grange); map.removeOverlays(Lake_Villa); map.removeOverlays(Niles); map.removeOverlays(Peoria); map.removeOverlays(Quincy); map.removeOverlays(Riverdale); setTimeout(function(){map.addOverlays(Addison)},1000); setTimeout(function(){map.addOverlays(Bartlett)},1000); setTimeout(function(){map.addOverlays(Calumet_Park)},1000); setTimeout(function(){map.addOverlays(Carbondale)},1000); setTimeout(function(){map.addOverlays(Chicago)},1000); setTimeout(function(){map.addOverlays(Granite_City)},1000); setTimeout(function(){map.addOverlays(La_Grange)},1000); setTimeout(function(){map.addOverlays(Lake_Villa)},1000); setTimeout(function(){map.addOverlays(Niles)},1000); setTimeout(function(){map.addOverlays(Peoria)},1000); setTimeout(function(){map.addOverlays(Quincy)},1000); setTimeout(function(){map.addOverlays(Riverdale)},1000); maxLng = -87.56528300; maxLat = 42.41208100; minLng = -91.35360000; minLat = 37.71759600; reCenterMap(); } // 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,11); /* 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(Addison); map.removeOverlays(Bartlett); map.removeOverlays(Calumet_Park); map.removeOverlays(Carbondale); map.removeOverlays(Chicago); map.removeOverlays(Granite_City); map.removeOverlays(La_Grange); map.removeOverlays(Lake_Villa); map.removeOverlays(Niles); map.removeOverlays(Peoria); map.removeOverlays(Quincy); map.removeOverlays(Riverdale); 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(La_Grange);map.removeOverlays(Addison); map.removeOverlays(Bartlett); map.removeOverlays(Calumet_Park); map.removeOverlays(Carbondale); map.removeOverlays(Chicago); map.removeOverlays(Granite_City); map.removeOverlays(La_Grange); map.removeOverlays(Lake_Villa); map.removeOverlays(Niles); map.removeOverlays(Peoria); map.removeOverlays(Quincy); map.removeOverlays(Riverdale); map.addOverlays(Addison); centerByArray(Addison, false, false); cntMarker += Addison.length; map.addOverlays(Bartlett); centerByArray(Bartlett, false, false); cntMarker += Bartlett.length; map.addOverlays(Calumet_Park); centerByArray(Calumet_Park, false, false); cntMarker += Calumet_Park.length; map.addOverlays(Carbondale); centerByArray(Carbondale, false, false); cntMarker += Carbondale.length; map.addOverlays(Chicago); centerByArray(Chicago, false, false); cntMarker += Chicago.length; map.addOverlays(Granite_City); centerByArray(Granite_City, false, false); cntMarker += Granite_City.length; map.addOverlays(La_Grange); centerByArray(La_Grange, false, false); cntMarker += La_Grange.length; map.addOverlays(Lake_Villa); centerByArray(Lake_Villa, false, false); cntMarker += Lake_Villa.length; map.addOverlays(Niles); centerByArray(Niles, false, false); cntMarker += Niles.length; map.addOverlays(Peoria); centerByArray(Peoria, false, false); cntMarker += Peoria.length; map.addOverlays(Quincy); centerByArray(Quincy, false, false); cntMarker += Quincy.length; map.addOverlays(Riverdale); centerByArray(Riverdale, false, false); cntMarker += Riverdale.length; centerByArray(La_Grange,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///35384,8424,8462,9224,9026,9092,9215,8574,8376,8391,8566,34882,35948,8533,9143,35384,8424,8425,8341,9224,9092,9138,9280,9376,36202,9732,8574,8376,8391,8566,34882,35948,8533,9143,9137,/all'); //window.open('/map.php?type=2&schools=35384,8424,8462,9224,9026,9092,9215,8574,8376,8391,8566,34882,35948,8533,9143,35384,8424,8425,8341,9224,9092,9138,9280,9376,36202,9732,8574,8376,8391,8566,34882,35948,8533,9143,9137,&school_level=&radius=&zipcode=&school_type_search=&school_type_code='); } } function createMarker(point, label, icon) { var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }