function addMarkers() { mySelect = document.getElementById('selection'); Chicago_Heights = [];Ford_Heights = [];Sauk_Village = [];Lynwood = [];South_Chicago_Hts = [];S_Chicago_Heights = [];Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.66170502,41.49763870),"
Beacon Hill Primary Cntr
401 Concord Dr
Chicago Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Beacon Hill Primary Cntr",'Chicago_Heights=' + Chicago_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.64542389,41.51343536),"
Bloom High School
101 W 10th St
Chicago Heights, IL 60411

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bloom High School",'Chicago_Heights=' + Chicago_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.59632874,41.48486328),"
Bloom Trail High School
22331 Cottage Grove
Chicago Heights, IL 60411

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bloom Trail High School",'Chicago_Heights=' + Chicago_Heights.length); Ford_Heights[Ford_Heights.length] = createMarker(new GPoint(-87.63150024,41.50619888),"
Cottage Grove Middle School
800 E 14th St
Ford Heights, IL 60411

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Cottage Grove Middle School",'Ford_Heights=' + Ford_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.64538574,41.51316452),"
Dist 206 Alternative High School
100 W 10th St
Chicago Heights, IL 60411

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dist 206 Alternative High School",'Chicago_Heights=' + Chicago_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.62331390,41.50966263),"
Dr Charles E Gavin Elementary School
280 E 12th St
Chicago Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dr Charles E Gavin Elementary School",'Chicago_Heights=' + Chicago_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.63185120,41.49416351),"
Garfield Elementary School
140 E 23rd St
Chicago Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Chicago_Heights=' + Chicago_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.64524841,41.52450180),"
Greenbriar Elementary School
101 Greenbriar Ave W
Chicago Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greenbriar Elementary School",'Chicago_Heights=' + Chicago_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.64939117,41.51634216),"
Highland School
828 Willow Dr
Chicago Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Highland School",'Chicago_Heights=' + Chicago_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.63591766,41.49969864),"
Jefferson Elementary School
176 E 11th St
Chicago Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Chicago_Heights=' + Chicago_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.66451263,41.51286316),"
Kennedy Elementary School
1013 Division St
Chicago Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kennedy Elementary School",'Chicago_Heights=' + Chicago_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.63591766,41.49969864),"
Lincoln Elementary School
1520 Center Ave
Chicago Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Chicago_Heights=' + Chicago_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.63591766,41.49969864),"
Mckinley Elementary School
25 W 16th Pl
Chicago Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Chicago_Heights=' + Chicago_Heights.length); Ford_Heights[Ford_Heights.length] = createMarker(new GPoint(-87.59028625,41.51363754),"
Medgar Evers Primary
1101 E 10th St
Ford Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Medgar Evers Primary",'Ford_Heights=' + Ford_Heights.length); Sauk_Village[Sauk_Village.length] = createMarker(new GPoint(-87.55781555,41.48760986),"
Rickover Junior High School
22151 S Torrence Ave
Sauk Village, IL 60411

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rickover Junior High School",'Sauk_Village=' + Sauk_Village.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.65231323,41.50696945),"
Roosevelt Elementary School
1345 Sunnyside Ave
Chicago Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Chicago_Heights=' + Chicago_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.65299225,41.52073669),"
Safe School Program
253 W Joe Orr Rd
Chicago Heights, IL 60411

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Safe School Program",'Chicago_Heights=' + Chicago_Heights.length); Lynwood[Lynwood.length] = createMarker(new GPoint(-87.54427338,41.51755524),"
Sandridge Elementary School
2950 Glenwood-dyer
Lynwood, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sandridge Elementary School",'Lynwood=' + Lynwood.length); South_Chicago_Hts[South_Chicago_Hts.length] = createMarker(new GPoint(-87.64001465,41.47807312),"
Saukview Elementary School
3341 Miller Ave
South Chicago Hts, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Saukview Elementary School",'South_Chicago_Hts=' + South_Chicago_Hts.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.65272522,41.53273773),"
Serena Hills Elementary School
255 Pleasant Dr
Chicago Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Serena Hills Elementary School",'Chicago_Heights=' + Chicago_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.66441345,41.51135254),"
Speed Seja 802 Pal Pgrm
1125 Division St
Chicago Heights, IL 60411

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Speed Seja 802 Pal Pgrm",'Chicago_Heights=' + Chicago_Heights.length); Sauk_Village[Sauk_Village.length] = createMarker(new GPoint(-87.56739044,41.48436356),"
Strassburg Elementary & L J Morales Cnt
2002 E 223rd St
Sauk Village, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Strassburg Elementary & L J Morales Cnt",'Sauk_Village=' + Sauk_Village.length); Ford_Heights[Ford_Heights.length] = createMarker(new GPoint(-87.58709717,41.50743866),"
Tidye A Phillips Elementary School
1401 E 13th Pl
Ford Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tidye A Phillips Elementary School",'Ford_Heights=' + Ford_Heights.length); S_Chicago_Heights[S_Chicago_Heights.length] = createMarker(new GPoint(-87.64048004,41.48946381),"
U S Grant Elementary School
2712 Miller Ave
S Chicago Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("U S Grant Elementary School",'S_Chicago_Heights=' + S_Chicago_Heights.length); Sauk_Village[Sauk_Village.length] = createMarker(new GPoint(-87.57123566,41.49666595),"
Wagoner Elementary & Dr T E Ryan Lrn Cn
1831 215th Pl
Sauk Village, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wagoner Elementary & Dr T E Ryan Lrn Cn",'Sauk_Village=' + Sauk_Village.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.64192963,41.50163651),"
Washington Junior High School
25 W 16th Pl
Chicago Heights, IL 60411

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Washington Junior High School",'Chicago_Heights=' + Chicago_Heights.length); Chicago_Heights[Chicago_Heights.length] = createMarker(new GPoint(-87.63591766,41.49969864),"
Wilson Elementary School
422 W 16th Pl
Chicago Heights, IL 60411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wilson Elementary School",'Chicago_Heights=' + Chicago_Heights.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(Chicago_Heights); map.removeOverlays(Ford_Heights); map.removeOverlays(Sauk_Village); map.removeOverlays(Lynwood); map.removeOverlays(South_Chicago_Hts); map.removeOverlays(S_Chicago_Heights); 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_Heights);map.removeOverlays(Chicago_Heights); map.removeOverlays(Ford_Heights); map.removeOverlays(Sauk_Village); map.removeOverlays(Lynwood); map.removeOverlays(South_Chicago_Hts); map.removeOverlays(S_Chicago_Heights); map.addOverlays(Chicago_Heights); centerByArray(Chicago_Heights, false, false); cntMarker += Chicago_Heights.length; map.addOverlays(Ford_Heights); centerByArray(Ford_Heights, false, false); cntMarker += Ford_Heights.length; map.addOverlays(Sauk_Village); centerByArray(Sauk_Village, false, false); cntMarker += Sauk_Village.length; map.addOverlays(Lynwood); centerByArray(Lynwood, false, false); cntMarker += Lynwood.length; map.addOverlays(South_Chicago_Hts); centerByArray(South_Chicago_Hts, false, false); cntMarker += South_Chicago_Hts.length; map.addOverlays(S_Chicago_Heights); centerByArray(S_Chicago_Heights, false, false); cntMarker += S_Chicago_Heights.length; centerByArray(Chicago_Heights,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'); } }