function addMarkers(){ mySelect = document.getElementById('selection'); Middlebury = [];Manchester_Center = [];Saint_Johnsbury = [];Fair_Haven = [];Johnson = [];Bennington = [];S_Burlington = [];Brattleboro = [];Sutton = [];Westminster = [];West_Dover = [];Rutland = [];Ripton = [];Rochester = [];Hartford = [];Saint_Albans_Bay = [];Burlington = [];Sharon = [];North_Bennington = [];Montpelier = [];mySelect.options[mySelect.options.length] = new Option("Bennington schools",'all=Bennington'); mySelect.options[mySelect.options.length] = new Option("Brattleboro schools",'all=Brattleboro'); mySelect.options[mySelect.options.length] = new Option("Burlington schools",'all=Burlington'); mySelect.options[mySelect.options.length] = new Option("Fair Haven schools",'all=Fair_Haven'); mySelect.options[mySelect.options.length] = new Option("Hartford schools",'all=Hartford'); mySelect.options[mySelect.options.length] = new Option("Johnson schools",'all=Johnson'); mySelect.options[mySelect.options.length] = new Option("Manchester Center schools",'all=Manchester_Center'); mySelect.options[mySelect.options.length] = new Option("Middlebury schools",'all=Middlebury'); mySelect.options[mySelect.options.length] = new Option("Montpelier schools",'all=Montpelier'); mySelect.options[mySelect.options.length] = new Option("North Bennington schools",'all=North_Bennington'); mySelect.options[mySelect.options.length] = new Option("Ripton schools",'all=Ripton'); mySelect.options[mySelect.options.length] = new Option("Rochester schools",'all=Rochester'); mySelect.options[mySelect.options.length] = new Option("Rutland schools",'all=Rutland'); mySelect.options[mySelect.options.length] = new Option("S Burlington schools",'all=S_Burlington'); mySelect.options[mySelect.options.length] = new Option("Saint Albans Bay schools",'all=Saint_Albans_Bay'); mySelect.options[mySelect.options.length] = new Option("Saint Johnsbury schools",'all=Saint_Johnsbury'); mySelect.options[mySelect.options.length] = new Option("Sharon schools",'all=Sharon'); mySelect.options[mySelect.options.length] = new Option("Sutton schools",'all=Sutton'); mySelect.options[mySelect.options.length] = new Option("West Dover schools",'all=West_Dover'); mySelect.options[mySelect.options.length] = new Option("Westminster schools",'all=Westminster'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Middlebury[Middlebury.length] = createMarker(new GPoint(-73.16760000,44.00520000),"
Aurora School
238 Peterson Ter
Middlebury, VT 05753
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aurora School",'Middlebury=' + Middlebury.length); Manchester_Center[Manchester_Center.length] = createMarker(new GPoint(-73.07208400,43.16299500),"
Bromley Brook School
Po Box 2328
Manchester Center, VT 05255
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bromley Brook School",'Manchester_Center=' + Manchester_Center.length); Saint_Johnsbury[Saint_Johnsbury.length] = createMarker(new GPoint(-72.01120700,44.42727500),"
The Caledonia School
125 School Street
Saint Johnsbury, VT 05819
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Caledonia School",'Saint_Johnsbury=' + Saint_Johnsbury.length); Fair_Haven[Fair_Haven.length] = createMarker(new GPoint(-73.34298900,43.68630800),"
Camp E-wen-akee
876 Root Pond Road
Fair Haven, VT 05743
Co-ed school, 8-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Camp E-wen-akee",'Fair_Haven=' + Fair_Haven.length); Johnson[Johnson.length] = createMarker(new GPoint(-72.65732500,44.62353700),"
Harvest Christian School
1296 Collins Hill Rd
Johnson, VT 05656
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Harvest Christian School",'Johnson=' + Johnson.length); Bennington[Bennington.length] = createMarker(new GPoint(-73.21019400,42.93155700),"
Hiland Hall School
2196 Harwood Hill Rd.
Bennington, VT 05201
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hiland Hall School",'Bennington=' + Bennington.length); S_Burlington[S_Burlington.length] = createMarker(new GPoint(-73.17179100,44.46865100),"
The International Children's School
1 Executive Dr.
S Burlington, VT 05403
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The International Children's School",'S_Burlington=' + S_Burlington.length); Brattleboro[Brattleboro.length] = createMarker(new GPoint(-72.55829800,42.85275000),"
Kindle Farms Childrens Service
Po Box 6471
Brattleboro, VT 05302
All-boys school, 3-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kindle Farms Childrens Service",'Brattleboro=' + Brattleboro.length); Sutton[Sutton.length] = createMarker(new GPoint(-72.07348600,44.66068900),"
The King George School
2684 King George Farm Road
Sutton, VT 05867
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The King George School",'Sutton=' + Sutton.length); Westminster[Westminster.length] = createMarker(new GPoint(-72.45470000,43.10200000),"
Kurn Hattin Homes
Po Box 127
Westminster, VT 05158
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kurn Hattin Homes",'Westminster=' + Westminster.length); West_Dover[West_Dover.length] = createMarker(new GPoint(-72.84971900,42.93716300),"
Mount Snow Academy
Alpine Training Center 12 Mount Pisgah Road
West Dover, VT 05356
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount Snow Academy",'West_Dover=' + West_Dover.length); Rutland[Rutland.length] = createMarker(new GPoint(-72.98180000,43.60750000),"
Mountain View Community School
261 Church Street
Rutland, VT 05701
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mountain View Community School",'Rutland=' + Rutland.length); Brattleboro[Brattleboro.length] = createMarker(new GPoint(-72.55689900,42.85105000),"
The Neighborhood Schoolhouse
Po Box 119
Brattleboro, VT 05302
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Neighborhood Schoolhouse",'Brattleboro=' + Brattleboro.length); Ripton[Ripton.length] = createMarker(new GPoint(-73.03967100,43.97393500),"
The North Branch School
Po Box 209
Ripton, VT 05766
Co-ed school, 7-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The North Branch School",'Ripton=' + Ripton.length); Rochester[Rochester.length] = createMarker(new GPoint(-72.81512700,43.92402500),"
North Hollow School
606 Fiske Rd. 1
Rochester, VT 05767
Co-ed school, 12-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Hollow School",'Rochester=' + Rochester.length); Hartford[Hartford.length] = createMarker(new GPoint(-72.33880200,43.66062800),"
Potter S House School
Po Box 620
Hartford, VT 05047
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Potter S House School",'Hartford=' + Hartford.length); Saint_Albans_Bay[Saint_Albans_Bay.length] = createMarker(new GPoint(-73.06812700,44.80649300),"
Project Soar-an Alternative In Education
Po Box 178 178 Mcginn Drive
Saint Albans Bay, VT 05481
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Project Soar-an Alternative In Education",'Saint_Albans_Bay=' + Saint_Albans_Bay.length); Burlington[Burlington.length] = createMarker(new GPoint(-73.23569200,44.49516400),"
Rock Point School
1 Rock Point Road
Burlington, VT 05408
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rock Point School",'Burlington=' + Burlington.length); Sharon[Sharon.length] = createMarker(new GPoint(-72.45680300,43.78368800),"
Sharon Academy
Post Office Box 207
Sharon, VT 05065
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sharon Academy",'Sharon=' + Sharon.length); North_Bennington[North_Bennington.length] = createMarker(new GPoint(-73.24530200,42.93161900),"
Southshire Community School
24 Bank Street
North Bennington, VT 05257
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southshire Community School",'North_Bennington=' + North_Bennington.length); Montpelier[Montpelier.length] = createMarker(new GPoint(-72.57300700,44.27976300),"
Turtle Island Children's Center
659 Elm Street
Montpelier, VT 05602
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Turtle Island Children's Center",'Montpelier=' + Montpelier.length); map.removeOverlays(Bennington); map.removeOverlays(Brattleboro); map.removeOverlays(Burlington); map.removeOverlays(Fair_Haven); map.removeOverlays(Hartford); map.removeOverlays(Johnson); map.removeOverlays(Manchester_Center); map.removeOverlays(Middlebury); map.removeOverlays(Montpelier); map.removeOverlays(North_Bennington); map.removeOverlays(Ripton); map.removeOverlays(Rochester); map.removeOverlays(Rutland); map.removeOverlays(S_Burlington); map.removeOverlays(Saint_Albans_Bay); map.removeOverlays(Saint_Johnsbury); map.removeOverlays(Sharon); map.removeOverlays(Sutton); map.removeOverlays(West_Dover); map.removeOverlays(Westminster); setTimeout(function(){map.addOverlays(Bennington)},1000); setTimeout(function(){map.addOverlays(Brattleboro)},1000); setTimeout(function(){map.addOverlays(Burlington)},1000); setTimeout(function(){map.addOverlays(Fair_Haven)},1000); setTimeout(function(){map.addOverlays(Hartford)},1000); setTimeout(function(){map.addOverlays(Johnson)},1000); setTimeout(function(){map.addOverlays(Manchester_Center)},1000); setTimeout(function(){map.addOverlays(Middlebury)},1000); setTimeout(function(){map.addOverlays(Montpelier)},1000); setTimeout(function(){map.addOverlays(North_Bennington)},1000); setTimeout(function(){map.addOverlays(Ripton)},1000); setTimeout(function(){map.addOverlays(Rochester)},1000); setTimeout(function(){map.addOverlays(Rutland)},1000); setTimeout(function(){map.addOverlays(S_Burlington)},1000); setTimeout(function(){map.addOverlays(Saint_Albans_Bay)},1000); setTimeout(function(){map.addOverlays(Saint_Johnsbury)},1000); setTimeout(function(){map.addOverlays(Sharon)},1000); setTimeout(function(){map.addOverlays(Sutton)},1000); setTimeout(function(){map.addOverlays(West_Dover)},1000); setTimeout(function(){map.addOverlays(Westminster)},1000); maxLng = -72.01120700; maxLat = 44.80649300; minLng = -73.34298900; minLat = 42.85105000; 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(Bennington); map.removeOverlays(Brattleboro); map.removeOverlays(Burlington); map.removeOverlays(Fair_Haven); map.removeOverlays(Hartford); map.removeOverlays(Johnson); map.removeOverlays(Manchester_Center); map.removeOverlays(Middlebury); map.removeOverlays(Montpelier); map.removeOverlays(North_Bennington); map.removeOverlays(Ripton); map.removeOverlays(Rochester); map.removeOverlays(Rutland); map.removeOverlays(S_Burlington); map.removeOverlays(Saint_Albans_Bay); map.removeOverlays(Saint_Johnsbury); map.removeOverlays(Sharon); map.removeOverlays(Sutton); map.removeOverlays(West_Dover); map.removeOverlays(Westminster); 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(Middlebury);map.removeOverlays(Bennington); map.removeOverlays(Brattleboro); map.removeOverlays(Burlington); map.removeOverlays(Fair_Haven); map.removeOverlays(Hartford); map.removeOverlays(Johnson); map.removeOverlays(Manchester_Center); map.removeOverlays(Middlebury); map.removeOverlays(Montpelier); map.removeOverlays(North_Bennington); map.removeOverlays(Ripton); map.removeOverlays(Rochester); map.removeOverlays(Rutland); map.removeOverlays(S_Burlington); map.removeOverlays(Saint_Albans_Bay); map.removeOverlays(Saint_Johnsbury); map.removeOverlays(Sharon); map.removeOverlays(Sutton); map.removeOverlays(West_Dover); map.removeOverlays(Westminster); map.addOverlays(Bennington); centerByArray(Bennington, false, false); cntMarker += Bennington.length; map.addOverlays(Brattleboro); centerByArray(Brattleboro, false, false); cntMarker += Brattleboro.length; map.addOverlays(Burlington); centerByArray(Burlington, false, false); cntMarker += Burlington.length; map.addOverlays(Fair_Haven); centerByArray(Fair_Haven, false, false); cntMarker += Fair_Haven.length; map.addOverlays(Hartford); centerByArray(Hartford, false, false); cntMarker += Hartford.length; map.addOverlays(Johnson); centerByArray(Johnson, false, false); cntMarker += Johnson.length; map.addOverlays(Manchester_Center); centerByArray(Manchester_Center, false, false); cntMarker += Manchester_Center.length; map.addOverlays(Middlebury); centerByArray(Middlebury, false, false); cntMarker += Middlebury.length; map.addOverlays(Montpelier); centerByArray(Montpelier, false, false); cntMarker += Montpelier.length; map.addOverlays(North_Bennington); centerByArray(North_Bennington, false, false); cntMarker += North_Bennington.length; map.addOverlays(Ripton); centerByArray(Ripton, false, false); cntMarker += Ripton.length; map.addOverlays(Rochester); centerByArray(Rochester, false, false); cntMarker += Rochester.length; map.addOverlays(Rutland); centerByArray(Rutland, false, false); cntMarker += Rutland.length; map.addOverlays(S_Burlington); centerByArray(S_Burlington, false, false); cntMarker += S_Burlington.length; map.addOverlays(Saint_Albans_Bay); centerByArray(Saint_Albans_Bay, false, false); cntMarker += Saint_Albans_Bay.length; map.addOverlays(Saint_Johnsbury); centerByArray(Saint_Johnsbury, false, false); cntMarker += Saint_Johnsbury.length; map.addOverlays(Sharon); centerByArray(Sharon, false, false); cntMarker += Sharon.length; map.addOverlays(Sutton); centerByArray(Sutton, false, false); cntMarker += Sutton.length; map.addOverlays(West_Dover); centerByArray(West_Dover, false, false); cntMarker += West_Dover.length; map.addOverlays(Westminster); centerByArray(Westminster, false, false); cntMarker += Westminster.length; centerByArray(Middlebury,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///27928,31893,27970,27920,27964,27921,35725,35729,27956,27965,32984,27980,28000,32981,27928,31893,28003,27964,27895,28010,27981,27950,27999,27965,32981,27935,/all'); //window.open('/map.php?type=2&schools=27928,31893,27970,27920,27964,27921,35725,35729,27956,27965,32984,27980,28000,32981,27928,31893,28003,27964,27895,28010,27981,27950,27999,27965,32981,27935,&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; }