function addMarkers() { mySelect = document.getElementById('selection'); Waterbury = [];Waterbury[Waterbury.length] = createMarker(new GPoint(-73.05207062,41.53623199),"
B. W. Tinker School
809 Highland Ave.
Waterbury, CT 06708

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("B. W. Tinker School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.06159973,41.55279922),"
Barnard School
11 Draher St.
Waterbury, CT 06708

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Barnard School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.06159973,41.55279922),"
Brooklyn Elementary School
29 John Street
Waterbury, CT 06708

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brooklyn Elementary School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.03045654,41.59954071),"
Bucks Hill School
330 Bucks Hill Rd.
Waterbury, CT 06704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bucks Hill School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.06311798,41.56732941),"
Bunker Hill School
170 Bunker Hill Ave.
Waterbury, CT 06708

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bunker Hill School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.08422089,41.57110596),"
Carrington School
24 Kenmore Ave.
Waterbury, CT 06708

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carrington School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-72.97414398,41.54777527),"
Crosby High School
300 Pierpont Rd.
Waterbury, CT 06705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crosby High School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.04295349,41.56402969),"
Driggs School
77 Woodlawn Terrace
Waterbury, CT 06710

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Driggs School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.05620400,41.48777300),"
Enlightenment School
30 Church Street
Waterbury, CT 06702

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Enlightenment School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.04570007,41.57149506),"
F. J. Kingsbury School
220 Columbia Blvd.
Waterbury, CT 06710

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("F. J. Kingsbury School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.02873993,41.52389526),"
Gilmartin School
107 Wyoming Ave.
Waterbury, CT 06706

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gilmartin School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.00595093,41.55319595),"
H. S. Chase School
40 Woodtick Rd.
Waterbury, CT 06705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("H. S. Chase School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.03432465,41.53275681),"
Hopeville School
2 Cypress St.
Waterbury, CT 06706

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hopeville School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.05615997,41.54595184),"
John F. Kennedy High School
422 Highland Ave.
Waterbury, CT 06708

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("John F. Kennedy High School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.03694916,41.55459595),"
Maloney Interdistrict Magnet Elementary School
233 South Elm St.
Waterbury, CT 06702

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Maloney Interdistrict Magnet Elementary School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-72.98198700,41.54595947),"
Margaret M. Generali Elementary School
3196 East Main Street
Waterbury, CT 06705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Margaret M. Generali Elementary School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-72.97365570,41.54301453),"
Michael F. Wallace Middle School
3465 East Main St.
Waterbury, CT 06705

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Michael F. Wallace Middle School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.03002167,41.60570145),"
North End Middle School
534 Bucks Hill Rd.
Waterbury, CT 06704

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("North End Middle School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.02712250,41.59275055),"
Regan School
2780 North Main St.
Waterbury, CT 06704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Regan School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-72.97063446,41.55070877),"
Rotella Interdistrict Magnet School
440 Pierpont Rd.
Waterbury, CT 06705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rotella Interdistrict Magnet School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.02960968,41.60647202),"
Special Education Preschool
330 Bucks Hill Rd.
Waterbury, CT 06704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Special Education Preschool",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.04983521,41.58644104),"
Sprague School
1443 Thomaston Ave.
Waterbury, CT 06704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sprague School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.04530334,41.55619431),"
State Street School
35 State St.
Waterbury, CT 06702

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("State Street School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.06486511,41.57481766),"
W. F. Kaynor Vocational School
43 Tompkins St.
Waterbury, CT 06708

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("W. F. Kaynor Vocational School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.03071594,41.55760574),"
Walsh School
29 Ashley St.
Waterbury, CT 06704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Walsh School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.03416443,41.54327011),"
Washington School
685 Baldwin St.
Waterbury, CT 06706

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.03701600,41.55450500),"
Waterbury Arts Magnet School
16 South Elm Street
Waterbury, CT 06702

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Waterbury Arts Magnet School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.04615500,41.55408200),"
Waterbury Arts Magnet School (high)
16 South Elm Street
Waterbury, CT 06702

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Waterbury Arts Magnet School (high)",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.01302338,41.53244400),"
Wendell L. Cross School
1255 Hamilton Ave.
Waterbury, CT 06706

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wendell L. Cross School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.06260681,41.54735947),"
West Side Middle School
483 Chase Parkway
Waterbury, CT 06708

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("West Side Middle School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.02960968,41.60647202),"
Wilby High School
568 Bucks Hill Rd.
Waterbury, CT 06704

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wilby High School",'Waterbury=' + Waterbury.length); Waterbury[Waterbury.length] = createMarker(new GPoint(-73.07740784,41.56471634),"
Woodrow Wilson School
235 Birch St.
Waterbury, CT 06704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodrow Wilson School",'Waterbury=' + Waterbury.length); map.removeOverlays(Waterbury); setTimeout(function(){map.addOverlays(Waterbury)},1000); maxLng = -72.97063446; maxLat = 41.60647202; minLng = -73.08422089; minLat = 41.48777300; 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,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(Waterbury); 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(Waterbury);map.removeOverlays(Waterbury); map.addOverlays(Waterbury); centerByArray(Waterbury, false, false); cntMarker += Waterbury.length; centerByArray(Waterbury,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'); } }