function addMarkers(){ mySelect = document.getElementById('selection'); West_Hartford = [];Avon = [];Wethersfield = [];Southington = [];Manchester = [];Tolland = [];Newington = [];Simsbury = [];Hartford = [];Bristol = [];Windsor = [];West_Simsbury = [];Farmington = [];Windsor_Locks = [];East_Hartford = [];Plainville = [];New_Britain = [];Suffield = [];South_Windsor = [];Bloomfield = [];mySelect.options[mySelect.options.length] = new Option("Avon schools",'all=Avon'); mySelect.options[mySelect.options.length] = new Option("Bloomfield schools",'all=Bloomfield'); mySelect.options[mySelect.options.length] = new Option("Bristol schools",'all=Bristol'); mySelect.options[mySelect.options.length] = new Option("East Hartford schools",'all=East_Hartford'); mySelect.options[mySelect.options.length] = new Option("Farmington schools",'all=Farmington'); mySelect.options[mySelect.options.length] = new Option("Hartford schools",'all=Hartford'); mySelect.options[mySelect.options.length] = new Option("Manchester schools",'all=Manchester'); mySelect.options[mySelect.options.length] = new Option("New Britain schools",'all=New_Britain'); mySelect.options[mySelect.options.length] = new Option("Newington schools",'all=Newington'); mySelect.options[mySelect.options.length] = new Option("Plainville schools",'all=Plainville'); mySelect.options[mySelect.options.length] = new Option("Simsbury schools",'all=Simsbury'); mySelect.options[mySelect.options.length] = new Option("South Windsor schools",'all=South_Windsor'); mySelect.options[mySelect.options.length] = new Option("Southington schools",'all=Southington'); mySelect.options[mySelect.options.length] = new Option("Suffield schools",'all=Suffield'); mySelect.options[mySelect.options.length] = new Option("Tolland schools",'all=Tolland'); mySelect.options[mySelect.options.length] = new Option("West Hartford schools",'all=West_Hartford'); mySelect.options[mySelect.options.length] = new Option("West Simsbury schools",'all=West_Simsbury'); mySelect.options[mySelect.options.length] = new Option("Wethersfield schools",'all=Wethersfield'); mySelect.options[mySelect.options.length] = new Option("Windsor schools",'all=Windsor'); mySelect.options[mySelect.options.length] = new Option("Windsor Locks schools",'all=Windsor_Locks'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); West_Hartford[West_Hartford.length] = createMarker(new GPoint(-72.74418200,41.77133100),"
American School For The Deaf
139 North Main Street
West Hartford, CT 06107
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("American School For The Deaf",'West_Hartford=' + West_Hartford.length); Avon[Avon.length] = createMarker(new GPoint(-72.83650200,41.78126100),"
Avon Old Farms School
500 Old Farms Road
Avon, CT 06001
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Avon Old Farms School",'Avon=' + Avon.length); West_Hartford[West_Hartford.length] = createMarker(new GPoint(-72.75580000,41.75340000),"
Ben Bronz Academy
139 N Main Street Boatner Bldg
West Hartford, CT 06107
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ben Bronz Academy",'West_Hartford=' + West_Hartford.length); Wethersfield[Wethersfield.length] = createMarker(new GPoint(-72.69141000,41.71957900),"
Ccmc School
170 Ridge Road
Wethersfield, CT 06109
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ccmc School",'Wethersfield=' + Wethersfield.length); Southington[Southington.length] = createMarker(new GPoint(-72.89981500,41.62917700),"
Central Christian Academy
1505 West St
Southington, CT 06489
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Christian Academy",'Southington=' + Southington.length); Manchester[Manchester.length] = createMarker(new GPoint(-72.52432000,41.78131600),"
Clinical Day School At Manchester Memorial Hosp
71 Haynes Street
Manchester, CT 06040
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clinical Day School At Manchester Memorial Hosp",'Manchester=' + Manchester.length); Manchester[Manchester.length] = createMarker(new GPoint(-72.52391700,41.78578600),"
The Cornerstone Christian School
236 Main Street
Manchester, CT 06042
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Cornerstone Christian School",'Manchester=' + Manchester.length); Tolland[Tolland.length] = createMarker(new GPoint(-72.41585500,41.84474400),"
Covenant Academy
26 Deer Mdw
Tolland, CT 06084
Co-ed school, 4-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Covenant Academy",'Tolland=' + Tolland.length); Manchester[Manchester.length] = createMarker(new GPoint(-72.55663300,41.78261200),"
East Catholic High School
115 New State Road
Manchester, CT 06042
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Catholic High School",'Manchester=' + Manchester.length); Newington[Newington.length] = createMarker(new GPoint(-72.74202700,41.67684300),"
Emmanuel Christian Academy
569 Maple Hill Avenue
Newington, CT 06111
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Emmanuel Christian Academy",'Newington=' + Newington.length); Simsbury[Simsbury.length] = createMarker(new GPoint(-72.83537300,41.84930200),"
Ethel Walker School
230 Bushy Hill Road
Simsbury, CT 06070
All-girls school, 6-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ethel Walker School",'Simsbury=' + Simsbury.length); Hartford[Hartford.length] = createMarker(new GPoint(-72.68150400,41.75164300),"
The Grace S. Webb School
200 Retreat Avenue
Hartford, CT 06106
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Grace S. Webb School",'Hartford=' + Hartford.length); Hartford[Hartford.length] = createMarker(new GPoint(-72.68368300,41.77019600),"
Gray Lodge School
105 Spring Street
Hartford, CT 06105
All-girls school, 8-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gray Lodge School",'Hartford=' + Hartford.length); Hartford[Hartford.length] = createMarker(new GPoint(-72.69576000,41.78263200),"
Hartford Area Sda School
474 Woodland Street
Hartford, CT 06112
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hartford Area Sda School",'Hartford=' + Hartford.length); West_Hartford[West_Hartford.length] = createMarker(new GPoint(-72.75580000,41.75340000),"
Hartford Christian Academy
155 Mountain Road
West Hartford, CT 06107
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hartford Christian Academy",'West_Hartford=' + West_Hartford.length); Hartford[Hartford.length] = createMarker(new GPoint(-72.68548600,41.73738000),"
Hartford Christian School
830 Maple Ave
Hartford, CT 06114
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hartford Christian School",'Hartford=' + Hartford.length); West_Hartford[West_Hartford.length] = createMarker(new GPoint(-72.75049100,41.80331200),"
Hebrew High School Of New England
1244 N. Main Street
West Hartford, CT 06117
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hebrew High School Of New England",'West_Hartford=' + West_Hartford.length); Bristol[Bristol.length] = createMarker(new GPoint(-72.94080300,41.68703400),"
Heritage Christian School
48 Lewis Street
Bristol, CT 06010
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian School",'Bristol=' + Bristol.length); West_Hartford[West_Hartford.length] = createMarker(new GPoint(-72.73423800,41.75961600),"
Kingswood-Oxford School
170 Kingswood Road
West Hartford, CT 06119
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kingswood-Oxford School",'West_Hartford=' + West_Hartford.length); Windsor[Windsor.length] = createMarker(new GPoint(-72.64108700,41.83868400),"
The Loomis Chaffee School
4 Batchelder Road
Windsor, CT 06095
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Loomis Chaffee School",'Windsor=' + Windsor.length); West_Simsbury[West_Simsbury.length] = createMarker(new GPoint(-72.86282100,41.87716600),"
The Master's School
36 Westledge Rd
West Simsbury, CT 06092
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Master's School",'West_Simsbury=' + West_Simsbury.length); Farmington[Farmington.length] = createMarker(new GPoint(-72.82930500,41.72230500),"
Miss Porter's School
60 Main Street
Farmington, CT 06032
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Miss Porter's School",'Farmington=' + Farmington.length); Windsor_Locks[Windsor_Locks.length] = createMarker(new GPoint(-72.64883500,41.91386300),"
New Life Christian Academy
11 Alma Rd
Windsor Locks, CT 06096
Co-ed school, 1-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Life Christian Academy",'Windsor_Locks=' + Windsor_Locks.length); East_Hartford[East_Hartford.length] = createMarker(new GPoint(-72.65476400,41.76834100),"
New Testament Baptist Church School
111 Ash Street
East Hartford, CT 06108
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Testament Baptist Church School",'East_Hartford=' + East_Hartford.length); West_Hartford[West_Hartford.length] = createMarker(new GPoint(-72.75223900,41.80009000),"
Northwest Catholic High School
29 Wampanoag Drive
West Hartford, CT 06117
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northwest Catholic High School",'West_Hartford=' + West_Hartford.length); Plainville[Plainville.length] = createMarker(new GPoint(-72.87786200,41.69208400),"
Nw Village School-wheeler Clinic
91 Northwest Drive
Plainville, CT 06062
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nw Village School-wheeler Clinic",'Plainville=' + Plainville.length); Windsor[Windsor.length] = createMarker(new GPoint(-72.66820000,41.86040000),"
Praise, Power & Prayer Christian School
Po Box 474 209 Kennedy Road
Windsor, CT 06095
Co-ed school, K-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Praise, Power & Prayer Christian School",'Windsor=' + Windsor.length); New_Britain[New_Britain.length] = createMarker(new GPoint(-72.78771500,41.65114800),"
Raymond Hill School
370 Linwood Street
New Britain, CT 06052
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Raymond Hill School",'New_Britain=' + New_Britain.length); West_Hartford[West_Hartford.length] = createMarker(new GPoint(-72.77817700,41.79048000),"
Renbrook School
2865 Albany Avenue
West Hartford, CT 06117
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Renbrook School",'West_Hartford=' + West_Hartford.length); Bristol[Bristol.length] = createMarker(new GPoint(-72.91142800,41.70444500),"
St. Paul Catholic High School
1001 Stafford Ave
Bristol, CT 06010
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Paul Catholic High School",'Bristol=' + Bristol.length); Hartford[Hartford.length] = createMarker(new GPoint(-72.71480900,41.77443600),"
Shiloh Christian Academy
870 Prospect Avenue
Hartford, CT 06105
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shiloh Christian Academy",'Hartford=' + Hartford.length); Suffield[Suffield.length] = createMarker(new GPoint(-72.65005200,41.98544000),"
Suffield Academy
185 North Main Street
Suffield, CT 06078
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Suffield Academy",'Suffield=' + Suffield.length); Manchester[Manchester.length] = createMarker(new GPoint(-72.52265200,41.76442100),"
Summit School/new Hope Manor
48 Hartford Road
Manchester, CT 06040
All-girls school, 8-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Summit School/new Hope Manor",'Manchester=' + Manchester.length); South_Windsor[South_Windsor.length] = createMarker(new GPoint(-72.62201700,41.79899400),"
Truth Baptist Academy
60 Burnham St
South Windsor, CT 06074
Co-ed school, 11-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Truth Baptist Academy",'South_Windsor=' + South_Windsor.length); Hartford[Hartford.length] = createMarker(new GPoint(-72.71592300,41.79286600),"
Watkinson School
180 Bloomfield Avenue
Hartford, CT 06105
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Watkinson School",'Hartford=' + Hartford.length); Bloomfield[Bloomfield.length] = createMarker(new GPoint(-72.75047800,41.80041100),"
Webb School At Bloomfield
2 Northwestern Drive
Bloomfield, CT 06002
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Webb School At Bloomfield",'Bloomfield=' + Bloomfield.length); Simsbury[Simsbury.length] = createMarker(new GPoint(-72.79810800,41.88594400),"
Westminster School
995 Hopmeadow Street
Simsbury, CT 06070
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westminster School",'Simsbury=' + Simsbury.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/////2/' + showArray); map.removeOverlays(Avon); map.removeOverlays(Bloomfield); map.removeOverlays(Bristol); map.removeOverlays(East_Hartford); map.removeOverlays(Farmington); map.removeOverlays(Hartford); map.removeOverlays(Manchester); map.removeOverlays(New_Britain); map.removeOverlays(Newington); map.removeOverlays(Plainville); map.removeOverlays(Simsbury); map.removeOverlays(South_Windsor); map.removeOverlays(Southington); map.removeOverlays(Suffield); map.removeOverlays(Tolland); map.removeOverlays(West_Hartford); map.removeOverlays(West_Simsbury); map.removeOverlays(Wethersfield); map.removeOverlays(Windsor); map.removeOverlays(Windsor_Locks); 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(West_Hartford);map.removeOverlays(Avon); map.removeOverlays(Bloomfield); map.removeOverlays(Bristol); map.removeOverlays(East_Hartford); map.removeOverlays(Farmington); map.removeOverlays(Hartford); map.removeOverlays(Manchester); map.removeOverlays(New_Britain); map.removeOverlays(Newington); map.removeOverlays(Plainville); map.removeOverlays(Simsbury); map.removeOverlays(South_Windsor); map.removeOverlays(Southington); map.removeOverlays(Suffield); map.removeOverlays(Tolland); map.removeOverlays(West_Hartford); map.removeOverlays(West_Simsbury); map.removeOverlays(Wethersfield); map.removeOverlays(Windsor); map.removeOverlays(Windsor_Locks); map.addOverlays(Avon); centerByArray(Avon, false, false); cntMarker += Avon.length; map.addOverlays(Bloomfield); centerByArray(Bloomfield, false, false); cntMarker += Bloomfield.length; map.addOverlays(Bristol); centerByArray(Bristol, false, false); cntMarker += Bristol.length; map.addOverlays(East_Hartford); centerByArray(East_Hartford, false, false); cntMarker += East_Hartford.length; map.addOverlays(Farmington); centerByArray(Farmington, false, false); cntMarker += Farmington.length; map.addOverlays(Hartford); centerByArray(Hartford, false, false); cntMarker += Hartford.length; map.addOverlays(Manchester); centerByArray(Manchester, false, false); cntMarker += Manchester.length; map.addOverlays(New_Britain); centerByArray(New_Britain, false, false); cntMarker += New_Britain.length; map.addOverlays(Newington); centerByArray(Newington, false, false); cntMarker += Newington.length; map.addOverlays(Plainville); centerByArray(Plainville, false, false); cntMarker += Plainville.length; map.addOverlays(Simsbury); centerByArray(Simsbury, false, false); cntMarker += Simsbury.length; map.addOverlays(South_Windsor); centerByArray(South_Windsor, false, false); cntMarker += South_Windsor.length; map.addOverlays(Southington); centerByArray(Southington, false, false); cntMarker += Southington.length; map.addOverlays(Suffield); centerByArray(Suffield, false, false); cntMarker += Suffield.length; map.addOverlays(Tolland); centerByArray(Tolland, false, false); cntMarker += Tolland.length; map.addOverlays(West_Hartford); centerByArray(West_Hartford, false, false); cntMarker += West_Hartford.length; map.addOverlays(West_Simsbury); centerByArray(West_Simsbury, false, false); cntMarker += West_Simsbury.length; map.addOverlays(Wethersfield); centerByArray(Wethersfield, false, false); cntMarker += Wethersfield.length; map.addOverlays(Windsor); centerByArray(Windsor, false, false); cntMarker += Windsor.length; map.addOverlays(Windsor_Locks); centerByArray(Windsor_Locks, false, false); cntMarker += Windsor_Locks.length; centerByArray(West_Hartford,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=2&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; }