function addMarkers(){ mySelect = document.getElementById('selection'); Chicago = [];Skokie = [];Aurora = [];Niles = [];Georgetown = [];Burbank = [];mySelect.options[mySelect.options.length] = new Option("Aurora schools",'all=Aurora'); mySelect.options[mySelect.options.length] = new Option("Burbank schools",'all=Burbank'); mySelect.options[mySelect.options.length] = new Option("Chicago schools",'all=Chicago'); mySelect.options[mySelect.options.length] = new Option("Georgetown schools",'all=Georgetown'); mySelect.options[mySelect.options.length] = new Option("Niles schools",'all=Niles'); mySelect.options[mySelect.options.length] = new Option("Skokie schools",'all=Skokie'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Chicago[Chicago.length] = createMarker(new GPoint(-87.62601400,41.89820500),"
Archbishop Quigley Prep Semina
103 E Chestnut Street
Chicago, IL 60611
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Archbishop Quigley Prep Semina",'Chicago=' + Chicago.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.70468300,41.99763700),"
Brisk Academy-yeshivas Brisk
3000 W Devon Avenue
Chicago, IL 60659
All-boys school, 11-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Brisk Academy-yeshivas Brisk",'Chicago=' + Chicago.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.72090300,41.71113700),"
Brother Rice High School
10001 S Pulaski Rd
Chicago, IL 60688
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Brother Rice High School",'Chicago=' + Chicago.length); Skokie[Skokie.length] = createMarker(new GPoint(-87.75760300,42.01896300),"
Cheder Lubavitch Hebrew Day School
5201 Howard Street
Skokie, IL 60077
All-boys school, PK-8
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Cheder Lubavitch Hebrew Day School",'Skokie=' + Skokie.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.62488500,41.83337100),"
De La Salle Institute
3455 S Wabash Avenue
Chicago, IL 60616
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("De La Salle Institute",'Chicago=' + Chicago.length); Skokie[Skokie.length] = createMarker(new GPoint(-87.76145200,42.01096300),"
Fasman Yeshiva High School
7135 Carpenter Road
Skokie, IL 60077
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fasman Yeshiva High School",'Skokie=' + Skokie.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.60664700,41.80529600),"
Hales Franciscan High School
4930 S Cottage Grove Avenue
Chicago, IL 60615
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hales Franciscan High School",'Chicago=' + Chicago.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.64750700,41.75045300),"
Leo Catholic High School
7901 S Sangamon Street
Chicago, IL 60620
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Leo Catholic High School",'Chicago=' + Chicago.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.69874200,42.00678100),"
Lubavitch Mesivta Of Chicago
2756 W Morse Avenue
Chicago, IL 60645
All-boys school, 9-11
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lubavitch Mesivta Of Chicago",'Chicago=' + Chicago.length); Aurora[Aurora.length] = createMarker(new GPoint(-88.29283900,41.81188600),"
Marmion Academy
1000 Butterfield Road
Aurora, IL 60502
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Marmion Academy",'Aurora=' + Aurora.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.58978300,41.77863100),"
Mount Carmel High School
6410 South Dante Avenue
Chicago, IL 60637
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mount Carmel High School",'Chicago=' + Chicago.length); Niles[Niles.length] = createMarker(new GPoint(-87.83423100,42.04390200),"
Northridge Preparatory School
8320 W Ballard Road
Niles, IL 60714
All-boys school, 6-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Northridge Preparatory School",'Niles=' + Niles.length); Georgetown[Georgetown.length] = createMarker(new GPoint(-87.64372100,39.94047100),"
Notre Dame De La Salette Boys Academy
5065 Olivet Road
Georgetown, IL 61846
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Notre Dame De La Salette Boys Academy",'Georgetown=' + Georgetown.length); Niles[Niles.length] = createMarker(new GPoint(-87.81830600,42.04026300),"
Notre Dame High School For Boy
7655 W Dempster Street
Niles, IL 60714
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Notre Dame High School For Boy",'Niles=' + Niles.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.71518300,41.85239800),"
St. Gregory Episcopal School
2130 S Central Park Avenue
Chicago, IL 60623
All-boys school, K-8
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St. Gregory Episcopal School",'Chicago=' + Chicago.length); Burbank[Burbank.length] = createMarker(new GPoint(-87.76015900,41.75263700),"
St. Laurence High School
5556 W 77th Street
Burbank, IL 60459
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St. Laurence High School",'Burbank=' + Burbank.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.77398400,41.93863700),"
St. Patrick High School
5900 W Belmont Avenue
Chicago, IL 60634
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St. Patrick High School",'Chicago=' + Chicago.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.68314100,41.75294200),"
St. Rita Of Cascia High School
7740 South Western Avenue
Chicago, IL 60620
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St. Rita Of Cascia High School",'Chicago=' + Chicago.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.70564000,42.01207900),"
Yeshiva Meor Hatorah
3050 W Touhy Avenue 2
Chicago, IL 60645
All-boys school, 8-9
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Yeshiva Meor Hatorah",'Chicago=' + Chicago.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.69547000,42.01233700),"
Yeshiva Shearis Yisroel
2620 W Touhy Avenue
Chicago, IL 60645
All-boys school, PK-8
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Yeshiva Shearis Yisroel",'Chicago=' + Chicago.length); Chicago[Chicago.length] = createMarker(new GPoint(-87.69968400,41.99284600),"
Yeshiva Tiferes Tzvi
6122 N California Avenue
Chicago, IL 60659
All-boys school, PK-8
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Yeshiva Tiferes Tzvi",'Chicago=' + Chicago.length); map.removeOverlays(Aurora); map.removeOverlays(Burbank); map.removeOverlays(Chicago); map.removeOverlays(Georgetown); map.removeOverlays(Niles); map.removeOverlays(Skokie); setTimeout(function(){map.addOverlays(Aurora)},1000); setTimeout(function(){map.addOverlays(Burbank)},1000); setTimeout(function(){map.addOverlays(Chicago)},1000); setTimeout(function(){map.addOverlays(Georgetown)},1000); setTimeout(function(){map.addOverlays(Niles)},1000); setTimeout(function(){map.addOverlays(Skokie)},1000); maxLng = -87.58978300; maxLat = 42.04390200; minLng = -88.29283900; minLat = 39.94047100; 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(Aurora); map.removeOverlays(Burbank); map.removeOverlays(Chicago); map.removeOverlays(Georgetown); map.removeOverlays(Niles); map.removeOverlays(Skokie); 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(Chicago);map.removeOverlays(Aurora); map.removeOverlays(Burbank); map.removeOverlays(Chicago); map.removeOverlays(Georgetown); map.removeOverlays(Niles); map.removeOverlays(Skokie); map.addOverlays(Aurora); centerByArray(Aurora, false, false); cntMarker += Aurora.length; map.addOverlays(Burbank); centerByArray(Burbank, false, false); cntMarker += Burbank.length; map.addOverlays(Chicago); centerByArray(Chicago, false, false); cntMarker += Chicago.length; map.addOverlays(Georgetown); centerByArray(Georgetown, false, false); cntMarker += Georgetown.length; map.addOverlays(Niles); centerByArray(Niles, false, false); cntMarker += Niles.length; map.addOverlays(Skokie); centerByArray(Skokie, false, false); cntMarker += Skokie.length; centerByArray(Chicago,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///8913,9437,35942,8468,8470,8600,8706,8857,8887,9004,9533,9592,31194,35376,9033,9047,8645,9351,9775,9776,9033,8328,/all'); //window.open('/map.php?type=2&schools=8913,9437,35942,8468,8470,8600,8706,8857,8887,9004,9533,9592,31194,35376,9033,9047,8645,9351,9775,9776,9033,8328,&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; }