function addMarkers()
{
mySelect = document.getElementById('selection');
Ashland = [];Benedicta = [];Bridgewater = [];Caribou = [];Mars_Hill = [];Connor_Twp = [];Presque_Isle = [];Caswell = [];Frenchville = [];Eagle_Lake = [];Easton = [];Fort_Fairfield = [];Fort_Kent = [];Van_Buren = [];Hodgdon = [];Houlton = [];Limestone = [];Madawaska = [];Mapleton = [];New_Sweden = [];Sinclair = [];Dyer_Brook = [];St_Francis = [];Stockholm = [];Soldier_Pond = [];Washburn = [];Monticello = [];St_Agatha = [];Woodland_aroos = [];Wytopitlock = [];mySelect.options[mySelect.options.length] = new Option("Ashland schools",'all=Ashland');
mySelect.options[mySelect.options.length] = new Option("Benedicta schools",'all=Benedicta');
mySelect.options[mySelect.options.length] = new Option("Bridgewater schools",'all=Bridgewater');
mySelect.options[mySelect.options.length] = new Option("Caribou schools",'all=Caribou');
mySelect.options[mySelect.options.length] = new Option("Caswell schools",'all=Caswell');
mySelect.options[mySelect.options.length] = new Option("Connor Twp schools",'all=Connor_Twp');
mySelect.options[mySelect.options.length] = new Option("Dyer Brook schools",'all=Dyer_Brook');
mySelect.options[mySelect.options.length] = new Option("Eagle Lake schools",'all=Eagle_Lake');
mySelect.options[mySelect.options.length] = new Option("Easton schools",'all=Easton');
mySelect.options[mySelect.options.length] = new Option("Fort Fairfield schools",'all=Fort_Fairfield');
mySelect.options[mySelect.options.length] = new Option("Fort Kent schools",'all=Fort_Kent');
mySelect.options[mySelect.options.length] = new Option("Frenchville schools",'all=Frenchville');
mySelect.options[mySelect.options.length] = new Option("Hodgdon schools",'all=Hodgdon');
mySelect.options[mySelect.options.length] = new Option("Houlton schools",'all=Houlton');
mySelect.options[mySelect.options.length] = new Option("Limestone schools",'all=Limestone');
mySelect.options[mySelect.options.length] = new Option("Madawaska schools",'all=Madawaska');
mySelect.options[mySelect.options.length] = new Option("Mapleton schools",'all=Mapleton');
mySelect.options[mySelect.options.length] = new Option("Mars Hill schools",'all=Mars_Hill');
mySelect.options[mySelect.options.length] = new Option("Monticello schools",'all=Monticello');
mySelect.options[mySelect.options.length] = new Option("New Sweden schools",'all=New_Sweden');
mySelect.options[mySelect.options.length] = new Option("Presque Isle schools",'all=Presque_Isle');
mySelect.options[mySelect.options.length] = new Option("Sinclair schools",'all=Sinclair');
mySelect.options[mySelect.options.length] = new Option("Soldier Pond schools",'all=Soldier_Pond');
mySelect.options[mySelect.options.length] = new Option("St Agatha schools",'all=St_Agatha');
mySelect.options[mySelect.options.length] = new Option("St Francis schools",'all=St_Francis');
mySelect.options[mySelect.options.length] = new Option("Stockholm schools",'all=Stockholm');
mySelect.options[mySelect.options.length] = new Option("Van Buren schools",'all=Van_Buren');
mySelect.options[mySelect.options.length] = new Option("Washburn schools",'all=Washburn');
mySelect.options[mySelect.options.length] = new Option("Woodland aroos schools",'all=Woodland_aroos');
mySelect.options[mySelect.options.length] = new Option("Wytopitlock schools",'all=Wytopitlock');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
Ashland[Ashland.length] = createMarker(new GPoint(-68.40223694,46.62939835),"
",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ashland Central School",'Ashland=' + Ashland.length);
Ashland[Ashland.length] = createMarker(new GPoint(-68.39550018,46.62969971),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Ashland Community High School",'Ashland=' + Ashland.length);
Benedicta[Benedicta.length] = createMarker(new GPoint(-68.41156006,45.79811859),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Benedicta Elementary School",'Benedicta=' + Benedicta.length);
Bridgewater[Bridgewater.length] = createMarker(new GPoint(-67.84401703,46.42142105),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Bridgewater Grammar School",'Bridgewater=' + Bridgewater.length);
Caribou[Caribou.length] = createMarker(new GPoint(-68.03061500,46.86360300),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Caribou High School",'Caribou=' + Caribou.length);
Caribou[Caribou.length] = createMarker(new GPoint(-68.00452423,46.86222458),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Caribou Learning Center",'Caribou=' + Caribou.length);
Caribou[Caribou.length] = createMarker(new GPoint(-68.00685120,46.86120987),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Caribou Middle School",'Caribou=' + Caribou.length);
Caribou[Caribou.length] = createMarker(new GPoint(-68.03065491,46.86336517),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Caribou Regional Applied Technical Center",'Caribou=' + Caribou.length);
Mars_Hill[Mars_Hill.length] = createMarker(new GPoint(-67.86093140,46.51494217),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Central Aroostook Junior Senior High School",'Mars_Hill=' + Mars_Hill.length);
Connor_Twp[Connor_Twp.length] = createMarker(new GPoint(-68.03559875,46.97349930),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Connor Consolidated School",'Connor_Twp=' + Connor_Twp.length);
Presque_Isle[Presque_Isle.length] = createMarker(new GPoint(-68.01158142,46.68366623),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Cunningham Middle School",'Presque_Isle=' + Presque_Isle.length);
Caswell[Caswell.length] = createMarker(new GPoint(-67.83141327,46.92550659),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dawn F Barnes Elementary School",'Caswell=' + Caswell.length);
Frenchville[Frenchville.length] = createMarker(new GPoint(-68.38189697,47.31969833),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Dr Levesque Elementary School",'Frenchville=' + Frenchville.length);
Eagle_Lake[Eagle_Lake.length] = createMarker(new GPoint(-68.58923340,47.24883270),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eagle Lake Elem/jr High School",'Eagle_Lake=' + Eagle_Lake.length);
Easton[Easton.length] = createMarker(new GPoint(-67.89885712,46.62271881),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Easton Elementary School",'Easton=' + Easton.length);
Easton[Easton.length] = createMarker(new GPoint(-67.91017914,46.64112091),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Easton Junior-senior High School",'Easton=' + Easton.length);
Presque_Isle[Presque_Isle.length] = createMarker(new GPoint(-68.00668335,46.68490601),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eva Hoyt Zippel School",'Presque_Isle=' + Presque_Isle.length);
Fort_Fairfield[Fort_Fairfield.length] = createMarker(new GPoint(-67.83741760,46.76477051),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fort Fairfield Elementary School",'Fort_Fairfield=' + Fort_Fairfield.length);
Fort_Fairfield[Fort_Fairfield.length] = createMarker(new GPoint(-67.84052277,46.76902008),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fort Fairfield Middle/high School",'Fort_Fairfield=' + Fort_Fairfield.length);
Fort_Kent[Fort_Kent.length] = createMarker(new GPoint(-68.58672333,47.24881744),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fort Kent Community High School",'Fort_Kent=' + Fort_Kent.length);
Fort_Kent[Fort_Kent.length] = createMarker(new GPoint(-68.58409119,47.24805832),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fort Kent Elementary School",'Fort_Kent=' + Fort_Kent.length);
Mars_Hill[Mars_Hill.length] = createMarker(new GPoint(-67.85900116,46.53269958),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fort Street School",'Mars_Hill=' + Mars_Hill.length);
Van_Buren[Van_Buren.length] = createMarker(new GPoint(-67.94886780,47.17621231),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Gateway Elementary School",'Van_Buren=' + Van_Buren.length);
Caribou[Caribou.length] = createMarker(new GPoint(-68.01572418,46.84781647),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hilltop Elementary School",'Caribou=' + Caribou.length);
Hodgdon[Hodgdon.length] = createMarker(new GPoint(-67.83999634,46.08670044),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hodgdon High School",'Hodgdon=' + Hodgdon.length);
Houlton[Houlton.length] = createMarker(new GPoint(-67.84650421,46.11210251),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Houlton Elementary School",'Houlton=' + Houlton.length);
Houlton[Houlton.length] = createMarker(new GPoint(-67.82707977,46.12709427),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Houlton High School",'Houlton=' + Houlton.length);
Houlton[Houlton.length] = createMarker(new GPoint(-67.82707977,46.12709427),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Houlton Junior High School",'Houlton=' + Houlton.length);
Houlton[Houlton.length] = createMarker(new GPoint(-67.84649658,46.11443710),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Houlton Southside School",'Houlton=' + Houlton.length);
Limestone[Limestone.length] = createMarker(new GPoint(-67.82790375,46.90903473),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Limestone Community School",'Limestone=' + Limestone.length);
Madawaska[Madawaska.length] = createMarker(new GPoint(-68.32790375,47.35570145),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Madawaska Elementary School",'Madawaska=' + Madawaska.length);
Madawaska[Madawaska.length] = createMarker(new GPoint(-68.32898712,47.34818649),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Madawaska Middle/high School",'Madawaska=' + Madawaska.length);
Limestone[Limestone.length] = createMarker(new GPoint(-67.82790375,46.90900040),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Maine School Of Science & Math",'Limestone=' + Limestone.length);
Mapleton[Mapleton.length] = createMarker(new GPoint(-68.15647888,46.68166351),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mapleton Elementary School",'Mapleton=' + Mapleton.length);
Presque_Isle[Presque_Isle.length] = createMarker(new GPoint(-68.03114319,46.69823837),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Msad#1 Alternative Education High School",'Presque_Isle=' + Presque_Isle.length);
New_Sweden[New_Sweden.length] = createMarker(new GPoint(-68.16796112,46.94131470),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("New Sweden Consolidated School",'New_Sweden=' + New_Sweden.length);
Sinclair[Sinclair.length] = createMarker(new GPoint(-68.26593781,47.16548157),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Patrick Therriault School",'Sinclair=' + Sinclair.length);
Presque_Isle[Presque_Isle.length] = createMarker(new GPoint(-68.00957489,46.67276382),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pine Street Elementary School",'Presque_Isle=' + Presque_Isle.length);
Presque_Isle[Presque_Isle.length] = createMarker(new GPoint(-68.00708771,46.68459320),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Presque Isle High School",'Presque_Isle=' + Presque_Isle.length);
Presque_Isle[Presque_Isle.length] = createMarker(new GPoint(-68.00600433,46.68453598),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Presque Isle Regional Technical Center",'Presque_Isle=' + Presque_Isle.length);
Houlton[Houlton.length] = createMarker(new GPoint(-67.82707977,46.12707901),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Region Two School Of Applied Technical",'Houlton=' + Houlton.length);
Hodgdon[Hodgdon.length] = createMarker(new GPoint(-67.83999634,46.08670044),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sad 70 Elementary School",'Hodgdon=' + Hodgdon.length);
Presque_Isle[Presque_Isle.length] = createMarker(new GPoint(-68.03266144,46.69777679),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Skyway Education Learning Center",'Presque_Isle=' + Presque_Isle.length);
Presque_Isle[Presque_Isle.length] = createMarker(new GPoint(-68.03480530,46.69954681),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Skyway Middle School",'Presque_Isle=' + Presque_Isle.length);
Dyer_Brook[Dyer_Brook.length] = createMarker(new GPoint(-68.25700378,46.01470184),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("So Aroostook Csd School",'Dyer_Brook=' + Dyer_Brook.length);
St_Francis[St_Francis.length] = createMarker(new GPoint(-69.06310272,47.17470169),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("St Francis Elementary School",'St_Francis=' + St_Francis.length);
Frenchville[Frenchville.length] = createMarker(new GPoint(-68.39080048,47.28590012),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("St John Valley Technology Center",'Frenchville=' + Frenchville.length);
Stockholm[Stockholm.length] = createMarker(new GPoint(-68.09635925,47.02341843),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Stockholm Elementary School",'Stockholm=' + Stockholm.length);
Caribou[Caribou.length] = createMarker(new GPoint(-68.00679779,46.86212540),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Teague Park School",'Caribou=' + Caribou.length);
Van_Buren[Van_Buren.length] = createMarker(new GPoint(-67.94061279,47.16149139),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Van Buren District Secondary School",'Van_Buren=' + Van_Buren.length);
Van_Buren[Van_Buren.length] = createMarker(new GPoint(-67.94058228,47.16141510),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Van Buren Regional Technology Center",'Van_Buren=' + Van_Buren.length);
Soldier_Pond[Soldier_Pond.length] = createMarker(new GPoint(-68.57203674,47.16104126),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wallagrass Elementary School",'Soldier_Pond=' + Soldier_Pond.length);
Washburn[Washburn.length] = createMarker(new GPoint(-68.15640259,46.79016113),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Washburn District Elementary School",'Washburn=' + Washburn.length);
Washburn[Washburn.length] = createMarker(new GPoint(-68.15164948,46.79216385),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Washburn District High School",'Washburn=' + Washburn.length);
Monticello[Monticello.length] = createMarker(new GPoint(-67.84285736,46.30659103),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wellington School",'Monticello=' + Monticello.length);
St_Agatha[St_Agatha.length] = createMarker(new GPoint(-68.31356812,47.24298096),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Wisdom Middle High School",'St_Agatha=' + St_Agatha.length);
Woodland_aroos[Woodland_aroos.length] = createMarker(new GPoint(-69.29499817,45.84260178),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Woodland Consolidated School",'Woodland_aroos=' + Woodland_aroos.length);
Wytopitlock[Wytopitlock.length] = createMarker(new GPoint(-68.07865906,45.64072037),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Wytopitlock Elementary School",'Wytopitlock=' + Wytopitlock.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(Ashland);
map.removeOverlays(Benedicta);
map.removeOverlays(Bridgewater);
map.removeOverlays(Caribou);
map.removeOverlays(Caswell);
map.removeOverlays(Connor_Twp);
map.removeOverlays(Dyer_Brook);
map.removeOverlays(Eagle_Lake);
map.removeOverlays(Easton);
map.removeOverlays(Fort_Fairfield);
map.removeOverlays(Fort_Kent);
map.removeOverlays(Frenchville);
map.removeOverlays(Hodgdon);
map.removeOverlays(Houlton);
map.removeOverlays(Limestone);
map.removeOverlays(Madawaska);
map.removeOverlays(Mapleton);
map.removeOverlays(Mars_Hill);
map.removeOverlays(Monticello);
map.removeOverlays(New_Sweden);
map.removeOverlays(Presque_Isle);
map.removeOverlays(Sinclair);
map.removeOverlays(Soldier_Pond);
map.removeOverlays(St_Agatha);
map.removeOverlays(St_Francis);
map.removeOverlays(Stockholm);
map.removeOverlays(Van_Buren);
map.removeOverlays(Washburn);
map.removeOverlays(Woodland_aroos);
map.removeOverlays(Wytopitlock);
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(Ashland);map.removeOverlays(Ashland);
map.removeOverlays(Benedicta);
map.removeOverlays(Bridgewater);
map.removeOverlays(Caribou);
map.removeOverlays(Caswell);
map.removeOverlays(Connor_Twp);
map.removeOverlays(Dyer_Brook);
map.removeOverlays(Eagle_Lake);
map.removeOverlays(Easton);
map.removeOverlays(Fort_Fairfield);
map.removeOverlays(Fort_Kent);
map.removeOverlays(Frenchville);
map.removeOverlays(Hodgdon);
map.removeOverlays(Houlton);
map.removeOverlays(Limestone);
map.removeOverlays(Madawaska);
map.removeOverlays(Mapleton);
map.removeOverlays(Mars_Hill);
map.removeOverlays(Monticello);
map.removeOverlays(New_Sweden);
map.removeOverlays(Presque_Isle);
map.removeOverlays(Sinclair);
map.removeOverlays(Soldier_Pond);
map.removeOverlays(St_Agatha);
map.removeOverlays(St_Francis);
map.removeOverlays(Stockholm);
map.removeOverlays(Van_Buren);
map.removeOverlays(Washburn);
map.removeOverlays(Woodland_aroos);
map.removeOverlays(Wytopitlock);
map.addOverlays(Ashland);
centerByArray(Ashland, false, false);
cntMarker += Ashland.length;
map.addOverlays(Benedicta);
centerByArray(Benedicta, false, false);
cntMarker += Benedicta.length;
map.addOverlays(Bridgewater);
centerByArray(Bridgewater, false, false);
cntMarker += Bridgewater.length;
map.addOverlays(Caribou);
centerByArray(Caribou, false, false);
cntMarker += Caribou.length;
map.addOverlays(Caswell);
centerByArray(Caswell, false, false);
cntMarker += Caswell.length;
map.addOverlays(Connor_Twp);
centerByArray(Connor_Twp, false, false);
cntMarker += Connor_Twp.length;
map.addOverlays(Dyer_Brook);
centerByArray(Dyer_Brook, false, false);
cntMarker += Dyer_Brook.length;
map.addOverlays(Eagle_Lake);
centerByArray(Eagle_Lake, false, false);
cntMarker += Eagle_Lake.length;
map.addOverlays(Easton);
centerByArray(Easton, false, false);
cntMarker += Easton.length;
map.addOverlays(Fort_Fairfield);
centerByArray(Fort_Fairfield, false, false);
cntMarker += Fort_Fairfield.length;
map.addOverlays(Fort_Kent);
centerByArray(Fort_Kent, false, false);
cntMarker += Fort_Kent.length;
map.addOverlays(Frenchville);
centerByArray(Frenchville, false, false);
cntMarker += Frenchville.length;
map.addOverlays(Hodgdon);
centerByArray(Hodgdon, false, false);
cntMarker += Hodgdon.length;
map.addOverlays(Houlton);
centerByArray(Houlton, false, false);
cntMarker += Houlton.length;
map.addOverlays(Limestone);
centerByArray(Limestone, false, false);
cntMarker += Limestone.length;
map.addOverlays(Madawaska);
centerByArray(Madawaska, false, false);
cntMarker += Madawaska.length;
map.addOverlays(Mapleton);
centerByArray(Mapleton, false, false);
cntMarker += Mapleton.length;
map.addOverlays(Mars_Hill);
centerByArray(Mars_Hill, false, false);
cntMarker += Mars_Hill.length;
map.addOverlays(Monticello);
centerByArray(Monticello, false, false);
cntMarker += Monticello.length;
map.addOverlays(New_Sweden);
centerByArray(New_Sweden, false, false);
cntMarker += New_Sweden.length;
map.addOverlays(Presque_Isle);
centerByArray(Presque_Isle, false, false);
cntMarker += Presque_Isle.length;
map.addOverlays(Sinclair);
centerByArray(Sinclair, false, false);
cntMarker += Sinclair.length;
map.addOverlays(Soldier_Pond);
centerByArray(Soldier_Pond, false, false);
cntMarker += Soldier_Pond.length;
map.addOverlays(St_Agatha);
centerByArray(St_Agatha, false, false);
cntMarker += St_Agatha.length;
map.addOverlays(St_Francis);
centerByArray(St_Francis, false, false);
cntMarker += St_Francis.length;
map.addOverlays(Stockholm);
centerByArray(Stockholm, false, false);
cntMarker += Stockholm.length;
map.addOverlays(Van_Buren);
centerByArray(Van_Buren, false, false);
cntMarker += Van_Buren.length;
map.addOverlays(Washburn);
centerByArray(Washburn, false, false);
cntMarker += Washburn.length;
map.addOverlays(Woodland_aroos);
centerByArray(Woodland_aroos, false, false);
cntMarker += Woodland_aroos.length;
map.addOverlays(Wytopitlock);
centerByArray(Wytopitlock, false, false);
cntMarker += Wytopitlock.length;
centerByArray(Ashland,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');
}
}