function addMarkers() { mySelect = document.getElementById('selection'); Waterville = [];Albion = [];Belgrade = [];Benton = [];Augusta = [];Litchfield = [];Chelsea = [];S_China = [];Clinton = [];Fayette = [];Gardiner = [];Hallowell = [];Farmingdale = [];West_Gardiner = [];Monmouth = [];Sidney = [];Manchester = [];Readfield = [];Oakland = [];Mount_Vernon = [];S_Gardiner = [];Randolph = [];Vassalboro = [];Wayne = [];Windsor = [];Winslow = [];Winthrop = [];mySelect.options[mySelect.options.length] = new Option("Albion schools",'all=Albion'); mySelect.options[mySelect.options.length] = new Option("Augusta schools",'all=Augusta'); mySelect.options[mySelect.options.length] = new Option("Belgrade schools",'all=Belgrade'); mySelect.options[mySelect.options.length] = new Option("Benton schools",'all=Benton'); mySelect.options[mySelect.options.length] = new Option("Chelsea schools",'all=Chelsea'); mySelect.options[mySelect.options.length] = new Option("Clinton schools",'all=Clinton'); mySelect.options[mySelect.options.length] = new Option("Farmingdale schools",'all=Farmingdale'); mySelect.options[mySelect.options.length] = new Option("Fayette schools",'all=Fayette'); mySelect.options[mySelect.options.length] = new Option("Gardiner schools",'all=Gardiner'); mySelect.options[mySelect.options.length] = new Option("Hallowell schools",'all=Hallowell'); mySelect.options[mySelect.options.length] = new Option("Litchfield schools",'all=Litchfield'); mySelect.options[mySelect.options.length] = new Option("Manchester schools",'all=Manchester'); mySelect.options[mySelect.options.length] = new Option("Monmouth schools",'all=Monmouth'); mySelect.options[mySelect.options.length] = new Option("Mount Vernon schools",'all=Mount_Vernon'); mySelect.options[mySelect.options.length] = new Option("Oakland schools",'all=Oakland'); mySelect.options[mySelect.options.length] = new Option("Randolph schools",'all=Randolph'); mySelect.options[mySelect.options.length] = new Option("Readfield schools",'all=Readfield'); mySelect.options[mySelect.options.length] = new Option("S China schools",'all=S_China'); mySelect.options[mySelect.options.length] = new Option("S Gardiner schools",'all=S_Gardiner'); mySelect.options[mySelect.options.length] = new Option("Sidney schools",'all=Sidney'); mySelect.options[mySelect.options.length] = new Option("Vassalboro schools",'all=Vassalboro'); mySelect.options[mySelect.options.length] = new Option("Waterville schools",'all=Waterville'); mySelect.options[mySelect.options.length] = new Option("Wayne schools",'all=Wayne'); mySelect.options[mySelect.options.length] = new Option("West Gardiner schools",'all=West_Gardiner'); mySelect.options[mySelect.options.length] = new Option("Windsor schools",'all=Windsor'); mySelect.options[mySelect.options.length] = new Option("Winslow schools",'all=Winslow'); mySelect.options[mySelect.options.length] = new Option("Winthrop schools",'all=Winthrop'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Waterville[Waterville.length] = createMarker(new GPoint(-69.63597107,44.55012131),"
Albert S Hall School
27 Pleasant Street
Waterville, ME 04901

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Albert S Hall School",'Waterville=' + Waterville.length); Albion[Albion.length] = createMarker(new GPoint(-69.43910217,44.51839828),"
Albion Elementary School
20 School Street
Albion, ME 04910

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Albion Elementary School",'Albion=' + Albion.length); Belgrade[Belgrade.length] = createMarker(new GPoint(-69.83212280,44.44670105),"
Belgrade Central School
158 Depot Road
Belgrade, ME 04917

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Belgrade Central School",'Belgrade=' + Belgrade.length); Benton[Benton.length] = createMarker(new GPoint(-69.65003204,44.54824448),"
Benton Elementary School
68 School Drive
Benton, ME 04901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Benton Elementary School",'Benton=' + Benton.length); Augusta[Augusta.length] = createMarker(new GPoint(-69.77976227,44.31053162),"
Capital Area Technology Center
40 Pierce Drive
Augusta, ME 04330

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Capital Area Technology Center",'Augusta=' + Augusta.length); Litchfield[Litchfield.length] = createMarker(new GPoint(-69.97326660,44.13420486),"
Carrie Ricker Middle School
573 Richmond Road
Litchfield, ME 04350

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Carrie Ricker Middle School",'Litchfield=' + Litchfield.length); Chelsea[Chelsea.length] = createMarker(new GPoint(-69.69895172,44.26752853),"
Chelsea Elementary School
566 Togus Road
Chelsea, ME 04330

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chelsea Elementary School",'Chelsea=' + Chelsea.length); S_China[S_China.length] = createMarker(new GPoint(-69.52749634,44.43857956),"
China Middle School
773 Lakeview Drive
S China, ME 04358

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("China Middle School",'S_China=' + S_China.length); S_China[S_China.length] = createMarker(new GPoint(-69.52754211,44.43844604),"
China Primary School
763 Lakeview Drive
S China, ME 04358

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("China Primary School",'S_China=' + S_China.length); Clinton[Clinton.length] = createMarker(new GPoint(-69.50222015,44.64120102),"
Clinton Elementary School
75 Morrison Ave Po Box 189
Clinton, ME 04927

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clinton Elementary School",'Clinton=' + Clinton.length); Augusta[Augusta.length] = createMarker(new GPoint(-69.76576996,44.31619263),"
Cony High School
120 Cony Street
Augusta, ME 04330

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cony High School",'Augusta=' + Augusta.length); Augusta[Augusta.length] = createMarker(new GPoint(-69.75775909,44.31644058),"
Ella R Hodgkins School
Malta Street
Augusta, ME 04330

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ella R Hodgkins School",'Augusta=' + Augusta.length); Augusta[Augusta.length] = createMarker(new GPoint(-69.74858093,44.30619431),"
Farrington School
249 Eastern Avenue
Augusta, ME 04330

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Farrington School",'Augusta=' + Augusta.length); Fayette[Fayette.length] = createMarker(new GPoint(-70.00051117,44.40488815),"
Fayette Central School
2023 Main Street
Fayette, ME 04349

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fayette Central School",'Fayette=' + Fayette.length); Gardiner[Gardiner.length] = createMarker(new GPoint(-69.79061127,44.22517776),"
Gardiner Area High School
40 West Hill Road
Gardiner, ME 04345

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gardiner Area High School",'Gardiner=' + Gardiner.length); Gardiner[Gardiner.length] = createMarker(new GPoint(-69.79946899,44.21723175),"
Gardiner Regional Middle School
161 Cobbossee Avenue
Gardiner, ME 04345

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Gardiner Regional Middle School",'Gardiner=' + Gardiner.length); Waterville[Waterville.length] = createMarker(new GPoint(-69.62898254,44.56818390),"
George J Mitchell School
58 Drummond Avenue
Waterville, ME 04901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George J Mitchell School",'Waterville=' + Waterville.length); Hallowell[Hallowell.length] = createMarker(new GPoint(-69.79052734,44.28892899),"
Hall-dale Elementary School
3 School Street
Hallowell, ME 04347

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hall-dale Elementary School",'Hallowell=' + Hallowell.length); Farmingdale[Farmingdale.length] = createMarker(new GPoint(-69.81364441,44.26479340),"
Hall-dale High School
97 Maple Street
Farmingdale, ME 04344

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hall-dale High School",'Farmingdale=' + Farmingdale.length); Farmingdale[Farmingdale.length] = createMarker(new GPoint(-69.81049347,44.26443863),"
Hall-dale Middle School
111 Maple Street
Farmingdale, ME 04344

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hall-dale Middle School",'Farmingdale=' + Farmingdale.length); West_Gardiner[West_Gardiner.length] = createMarker(new GPoint(-69.88195801,44.20690155),"
Helen Thompson School
309 Spears Corner Road
West Gardiner, ME 04345

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Helen Thompson School",'West_Gardiner=' + West_Gardiner.length); Monmouth[Monmouth.length] = createMarker(new GPoint(-70.03788757,44.25514603),"
Henry L Cottrell School
169 Academy Street
Monmouth, ME 04259

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Henry L Cottrell School",'Monmouth=' + Monmouth.length); Sidney[Sidney.length] = createMarker(new GPoint(-69.74195099,44.44334793),"
James H Bean School
2896 Middle Road
Sidney, ME 04330

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("James H Bean School",'Sidney=' + Sidney.length); Gardiner[Gardiner.length] = createMarker(new GPoint(-69.78058624,44.21889496),"
Laura E Richards School
279 Brunswick Avenue
Gardiner, ME 04345

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Laura E Richards School",'Gardiner=' + Gardiner.length); Litchfield[Litchfield.length] = createMarker(new GPoint(-69.97028351,44.12178040),"
Libby-tozier School
466 Academy Road
Litchfield, ME 04350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Libby-tozier School",'Litchfield=' + Litchfield.length); Augusta[Augusta.length] = createMarker(new GPoint(-69.76251984,44.32096100),"
Lillian Parks Hussey School
Gedney Street
Augusta, ME 04330

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lillian Parks Hussey School",'Augusta=' + Augusta.length); Augusta[Augusta.length] = createMarker(new GPoint(-69.78644562,44.31301880),"
Lincoln School
40 Lincoln Street
Augusta, ME 04330

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln School",'Augusta=' + Augusta.length); Manchester[Manchester.length] = createMarker(new GPoint(-69.86064148,44.32466888),"
Manchester Elementary School
17 School St Po Box 217
Manchester, ME 04351

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Manchester Elementary School",'Manchester=' + Manchester.length); Readfield[Readfield.length] = createMarker(new GPoint(-69.95368195,44.39664078),"
Maranacook Community High School
2250 Millard Harrison Drive
Readfield, ME 04355

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Maranacook Community High School",'Readfield=' + Readfield.length); Readfield[Readfield.length] = createMarker(new GPoint(-69.95368195,44.39664078),"
Maranacook Community Middle School
2100 Millard Harrison Drive
Readfield, ME 04355

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Maranacook Community Middle School",'Readfield=' + Readfield.length); Oakland[Oakland.length] = createMarker(new GPoint(-69.71572876,44.55744934),"
Messalonskee High School
131 Messalonskee High Drive
Oakland, ME 04963

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Messalonskee High School",'Oakland=' + Oakland.length); Oakland[Oakland.length] = createMarker(new GPoint(-69.71723938,44.55003738),"
Messalonskee Middle School
33 School Bus Drive
Oakland, ME 04963

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Messalonskee Middle School",'Oakland=' + Oakland.length); Waterville[Waterville.length] = createMarker(new GPoint(-69.64225769,44.55096054),"
Mid-maine Technical Center
3 Brooklyn Avenue
Waterville, ME 04901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mid-maine Technical Center",'Waterville=' + Waterville.length); Monmouth[Monmouth.length] = createMarker(new GPoint(-70.03742981,44.24963379),"
Monmouth Academy
96 Academy Street
Monmouth, ME 04259

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Monmouth Academy",'Monmouth=' + Monmouth.length); Monmouth[Monmouth.length] = createMarker(new GPoint(-70.00370026,44.22999954),"
Monmouth Middle School
Po Box 240
Monmouth, ME 04259

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Monmouth Middle School",'Monmouth=' + Monmouth.length); Mount_Vernon[Mount_Vernon.length] = createMarker(new GPoint(-69.98390198,44.50067902),"
Mt Vernon Elementary School
1507 North Road
Mount Vernon, ME 04352

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mt Vernon Elementary School",'Mount_Vernon=' + Mount_Vernon.length); Gardiner[Gardiner.length] = createMarker(new GPoint(-69.73970032,44.19739914),"
Pittston Consolidated School
Rr 2 Box 6060
Gardiner, ME 04345

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pittston Consolidated School",'Gardiner=' + Gardiner.length); Gardiner[Gardiner.length] = createMarker(new GPoint(-69.78524017,44.23072052),"
Pray Street School
14 Pray Street
Gardiner, ME 04345

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pray Street School",'Gardiner=' + Gardiner.length); Oakland[Oakland.length] = createMarker(new GPoint(-69.72057343,44.54946899),"
Ralph M Atwood School
19 Heath Street
Oakland, ME 04963

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ralph M Atwood School",'Oakland=' + Oakland.length); Readfield[Readfield.length] = createMarker(new GPoint(-69.94058228,44.37363052),"
Readfield Elementary School
84 South Road
Readfield, ME 04355

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Readfield Elementary School",'Readfield=' + Readfield.length); S_Gardiner[S_Gardiner.length] = createMarker(new GPoint(-69.75637817,44.17977905),"
River View Community School
815 River Rd Po Box 9
S Gardiner, ME 04359

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("River View Community School",'S_Gardiner=' + S_Gardiner.length); Augusta[Augusta.length] = createMarker(new GPoint(-69.78054047,44.33295822),"
Sylvio J Gilbert School
Sunset Avenue
Augusta, ME 04330

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sylvio J Gilbert School",'Augusta=' + Augusta.length); Randolph[Randolph.length] = createMarker(new GPoint(-69.76712036,44.23428726),"
Teresa C Hamlin Elementary School
17 School Street
Randolph, ME 04346

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Teresa C Hamlin Elementary School",'Randolph=' + Randolph.length); Vassalboro[Vassalboro.length] = createMarker(new GPoint(-69.65417480,44.43299484),"
Vassalboro Community School
1116 Webber Pond Road
Vassalboro, ME 04989

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Vassalboro Community School",'Vassalboro=' + Vassalboro.length); Waterville[Waterville.length] = createMarker(new GPoint(-69.64225769,44.55096054),"
Waterville High School
1 Brooklyn Avenue
Waterville, ME 04901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Waterville High School",'Waterville=' + Waterville.length); Waterville[Waterville.length] = createMarker(new GPoint(-69.66580963,44.52679825),"
Waterville Junior High School
120 West River Road
Waterville, ME 04901

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Waterville Junior High School",'Waterville=' + Waterville.length); Wayne[Wayne.length] = createMarker(new GPoint(-70.05719757,44.34669876),"
Wayne Elementary School
48 Pond Road
Wayne, ME 04284

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wayne Elementary School",'Wayne=' + Wayne.length); Oakland[Oakland.length] = createMarker(new GPoint(-69.72143555,44.54965973),"
Williams Elementary School
55 Pleasant Street
Oakland, ME 04963

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Williams Elementary School",'Oakland=' + Oakland.length); Windsor[Windsor.length] = createMarker(new GPoint(-69.58106995,44.31050110),"
Windsor Elementary School
Rte 32 Po Box 82
Windsor, ME 04363

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Windsor Elementary School",'Windsor=' + Windsor.length); Winslow[Winslow.length] = createMarker(new GPoint(-69.62459564,44.54964066),"
Winslow Elementary School
285 Benton Avenue
Winslow, ME 04901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Winslow Elementary School",'Winslow=' + Winslow.length); Winslow[Winslow.length] = createMarker(new GPoint(-69.62220001,44.55121994),"
Winslow High School
20 Danielson Street
Winslow, ME 04901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Winslow High School",'Winslow=' + Winslow.length); Winslow[Winslow.length] = createMarker(new GPoint(-69.62223816,44.55124664),"
Winslow Junior High School
6 Danielson Street
Winslow, ME 04901

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Winslow Junior High School",'Winslow=' + Winslow.length); Winthrop[Winthrop.length] = createMarker(new GPoint(-69.96779633,44.30591965),"
Winthrop Grade School
23 Highland Avenue
Winthrop, ME 04364

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Winthrop Grade School",'Winthrop=' + Winthrop.length); Winthrop[Winthrop.length] = createMarker(new GPoint(-69.96733093,44.30503082),"
Winthrop High School
211 Rambler Road
Winthrop, ME 04364

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Winthrop High School",'Winthrop=' + Winthrop.length); Winthrop[Winthrop.length] = createMarker(new GPoint(-69.98459625,44.30146408),"
Winthrop Middle School
400 Rambler Road
Winthrop, ME 04364

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Winthrop Middle School",'Winthrop=' + Winthrop.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(Albion); map.removeOverlays(Augusta); map.removeOverlays(Belgrade); map.removeOverlays(Benton); map.removeOverlays(Chelsea); map.removeOverlays(Clinton); map.removeOverlays(Farmingdale); map.removeOverlays(Fayette); map.removeOverlays(Gardiner); map.removeOverlays(Hallowell); map.removeOverlays(Litchfield); map.removeOverlays(Manchester); map.removeOverlays(Monmouth); map.removeOverlays(Mount_Vernon); map.removeOverlays(Oakland); map.removeOverlays(Randolph); map.removeOverlays(Readfield); map.removeOverlays(S_China); map.removeOverlays(S_Gardiner); map.removeOverlays(Sidney); map.removeOverlays(Vassalboro); map.removeOverlays(Waterville); map.removeOverlays(Wayne); map.removeOverlays(West_Gardiner); map.removeOverlays(Windsor); map.removeOverlays(Winslow); map.removeOverlays(Winthrop); 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(Waterville);map.removeOverlays(Albion); map.removeOverlays(Augusta); map.removeOverlays(Belgrade); map.removeOverlays(Benton); map.removeOverlays(Chelsea); map.removeOverlays(Clinton); map.removeOverlays(Farmingdale); map.removeOverlays(Fayette); map.removeOverlays(Gardiner); map.removeOverlays(Hallowell); map.removeOverlays(Litchfield); map.removeOverlays(Manchester); map.removeOverlays(Monmouth); map.removeOverlays(Mount_Vernon); map.removeOverlays(Oakland); map.removeOverlays(Randolph); map.removeOverlays(Readfield); map.removeOverlays(S_China); map.removeOverlays(S_Gardiner); map.removeOverlays(Sidney); map.removeOverlays(Vassalboro); map.removeOverlays(Waterville); map.removeOverlays(Wayne); map.removeOverlays(West_Gardiner); map.removeOverlays(Windsor); map.removeOverlays(Winslow); map.removeOverlays(Winthrop); map.addOverlays(Albion); centerByArray(Albion, false, false); cntMarker += Albion.length; map.addOverlays(Augusta); centerByArray(Augusta, false, false); cntMarker += Augusta.length; map.addOverlays(Belgrade); centerByArray(Belgrade, false, false); cntMarker += Belgrade.length; map.addOverlays(Benton); centerByArray(Benton, false, false); cntMarker += Benton.length; map.addOverlays(Chelsea); centerByArray(Chelsea, false, false); cntMarker += Chelsea.length; map.addOverlays(Clinton); centerByArray(Clinton, false, false); cntMarker += Clinton.length; map.addOverlays(Farmingdale); centerByArray(Farmingdale, false, false); cntMarker += Farmingdale.length; map.addOverlays(Fayette); centerByArray(Fayette, false, false); cntMarker += Fayette.length; map.addOverlays(Gardiner); centerByArray(Gardiner, false, false); cntMarker += Gardiner.length; map.addOverlays(Hallowell); centerByArray(Hallowell, false, false); cntMarker += Hallowell.length; map.addOverlays(Litchfield); centerByArray(Litchfield, false, false); cntMarker += Litchfield.length; map.addOverlays(Manchester); centerByArray(Manchester, false, false); cntMarker += Manchester.length; map.addOverlays(Monmouth); centerByArray(Monmouth, false, false); cntMarker += Monmouth.length; map.addOverlays(Mount_Vernon); centerByArray(Mount_Vernon, false, false); cntMarker += Mount_Vernon.length; map.addOverlays(Oakland); centerByArray(Oakland, false, false); cntMarker += Oakland.length; map.addOverlays(Randolph); centerByArray(Randolph, false, false); cntMarker += Randolph.length; map.addOverlays(Readfield); centerByArray(Readfield, false, false); cntMarker += Readfield.length; map.addOverlays(S_China); centerByArray(S_China, false, false); cntMarker += S_China.length; map.addOverlays(S_Gardiner); centerByArray(S_Gardiner, false, false); cntMarker += S_Gardiner.length; map.addOverlays(Sidney); centerByArray(Sidney, false, false); cntMarker += Sidney.length; map.addOverlays(Vassalboro); centerByArray(Vassalboro, false, false); cntMarker += Vassalboro.length; map.addOverlays(Waterville); centerByArray(Waterville, false, false); cntMarker += Waterville.length; map.addOverlays(Wayne); centerByArray(Wayne, false, false); cntMarker += Wayne.length; map.addOverlays(West_Gardiner); centerByArray(West_Gardiner, false, false); cntMarker += West_Gardiner.length; map.addOverlays(Windsor); centerByArray(Windsor, false, false); cntMarker += Windsor.length; map.addOverlays(Winslow); centerByArray(Winslow, false, false); cntMarker += Winslow.length; map.addOverlays(Winthrop); centerByArray(Winthrop, false, false); cntMarker += Winthrop.length; centerByArray(Waterville,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'); } }