function addMarkers(){ mySelect = document.getElementById('selection'); Boston = [];Boston[Boston.length] = createMarker(new GPoint(-71.10679000,42.33343700),"
Abc-123 Child Care Center
779 Huntington Avenue
Boston, MA 02115
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Abc-123 Child Care Center",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.07198400,42.35832400),"
Advent School
15 Brimmer Street
Boston, MA 02108
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Advent School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.06526200,42.36059800),"
Beacon Hill Nursery School
74 Joy Street
Boston, MA 02114
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beacon Hill Nursery School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.06671200,42.36586800),"
The Boston Children's School
8 Whittier Place
Boston, MA 02114
Co-ed school, NS-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Boston Children's School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.04681700,42.31467600),"
Boston College High School
150 Morrissey Blvd
Boston, MA 02125
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Boston College High School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.12918900,42.25942300),"
Boston Trinity Academy
17 Hale Street
Boston, MA 02136
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Boston Trinity Academy",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.10955600,42.35057200),"
Boston University Academy
One University Road
Boston, MA 02215
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Boston University Academy",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.13060300,42.30934800),"
British School Of Boston
416 Pond Street
Boston, MA 02130
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("British School Of Boston",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.06843300,42.34049600),"
Cathedral Grammar School
595 Harrison Avenue
Boston, MA 02118
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cathedral Grammar School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.06823000,42.34083800),"
Cathedral High School
74 Union Park Street
Boston, MA 02118
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cathedral High School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.07793300,42.35228600),"
Commonwealth School
151 Commonwealth Avenue
Boston, MA 02116
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Commonwealth School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.07930000,42.33486100),"
Cooper Community Child Development Center
1891 Washington Street
Boston, MA 02118
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cooper Community Child Development Center",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.08587800,42.32128300),"
Eliot Educational Center
56 Dale Street
Boston, MA 02119
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eliot Educational Center",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.08845800,42.29412900),"
Excel Academy Inc
879 Blue Hill Avenue 881
Boston, MA 02124
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Excel Academy Inc",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.10957100,42.34038300),"
Frances Jacobson Early Childhood Center
477 Longwood Avenue
Boston, MA 02215
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Frances Jacobson Early Childhood Center",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.13850800,42.35299400),"
Jackson-mann Community Preschool
500 Cambridge Street
Boston, MA 02134
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jackson-mann Community Preschool",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.07304700,42.34915700),"
John Hancock Child Care Center
370 Stuart St.
Boston, MA 02117
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("John Hancock Child Care Center",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.07534900,42.35359500),"
John Winthrop School
66 Marlborough St
Boston, MA 02116
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("John Winthrop School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.15350000,42.34980000),"
Kennedy Day School Program
30 Warren Street Franciscan Ch
Boston, MA 02135
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kennedy Day School Program",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.05669900,42.35863500),"
Kids Are People Elementary School
Po Box 15656 530 Commonwealth Avenue
Boston, MA 02215
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kids Are People Elementary School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.09604000,42.34868700),"
Kids Are People School
530 Commonwealth Ave
Boston, MA 02215
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kids Are People School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.08896000,42.29088400),"
Kids Choice Early Childhood Center
974b Blue Hill Avenue
Boston, MA 02124
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kids Choice Early Childhood Center",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.08230300,42.35034700),"
Kingsley Montessori School
30 Fairfield Street Early Childhood 26 Exeter Street El
Boston, MA 02116
Co-ed school, NS-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kingsley Montessori School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.07691500,42.35348400),"
The Learning Project Elementary School
107 Marlborough Street
Boston, MA 02116
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Learning Project Elementary School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.10971400,42.33121600),"
Manville School
53 Parker Hill Avenue
Boston, MA 02120
Co-ed school, 1-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Manville School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.08226800,42.35208900),"
The Newman School
247 Marlborough Street
Boston, MA 02116
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Newman School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.07165500,42.35634100),"
Park Street School
67 Brimmer Street
Boston, MA 02108
Co-ed school, NS-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Park Street School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.07624400,42.32488100),"
St. Patrick School
131 Mt. Pleasant Ave
Boston, MA 02119
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Patrick School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.05268400,42.36399200),"
St John School
9 Moon Street
Boston, MA 02113
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.15939000,42.34196900),"
Transportation Children's Center
10 Park Plaza Room 3330
Boston, MA 02116
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Transportation Children's Center",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.04776900,42.31604200),"
Umass/boston Early Learning Center
100 Morrissey Blvd
Boston, MA 02125
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Umass/boston Early Learning Center",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.10685800,42.34094200),"
The Winsor School
103 Pilgrim Road
Boston, MA 02215
All-girls school, 5-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("The Winsor School",'Boston=' + Boston.length); Boston[Boston.length] = createMarker(new GPoint(-71.07909900,42.28338700),"
Zion Early Learning Center
79 Stanton Street
Boston, MA 02124
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zion Early Learning Center",'Boston=' + Boston.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,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(Boston); 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(Boston);map.removeOverlays(Boston); map.addOverlays(Boston); centerByArray(Boston, false, false); cntMarker += Boston.length; centerByArray(Boston,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'); //window.open('/map.php?type=1&schools=&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; }