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),"
Ashland Central School
Oak St Po Box 449
Ashland, ME 04732

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ashland Central School",'Ashland=' + Ashland.length); Ashland[Ashland.length] = createMarker(new GPoint(-68.39550018,46.62969971),"
Ashland Community High School
46 Hayward St Po Box 369
Ashland, ME 04732

[ View School Profile ]
",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),"
Benedicta Elementary School
Aroostook Rd Po Box 159
Benedicta, ME 04733

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Benedicta Elementary School",'Benedicta=' + Benedicta.length); Bridgewater[Bridgewater.length] = createMarker(new GPoint(-67.84401703,46.42142105),"
Bridgewater Grammar School
School St Po Box 205
Bridgewater, ME 04735

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bridgewater Grammar School",'Bridgewater=' + Bridgewater.length); Caribou[Caribou.length] = createMarker(new GPoint(-68.03061500,46.86360300),"
Caribou High School
308 Sweden Street
Caribou, ME 04736

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Caribou High School",'Caribou=' + Caribou.length); Caribou[Caribou.length] = createMarker(new GPoint(-68.00452423,46.86222458),"
Caribou Learning Center
75 Bennett Drive
Caribou, ME 04736

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Caribou Learning Center",'Caribou=' + Caribou.length); Caribou[Caribou.length] = createMarker(new GPoint(-68.00685120,46.86120987),"
Caribou Middle School
21 Glenn Street
Caribou, ME 04736

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Caribou Middle School",'Caribou=' + Caribou.length); Caribou[Caribou.length] = createMarker(new GPoint(-68.03065491,46.86336517),"
Caribou Regional Applied Technical Center
308 Sweden Street
Caribou, ME 04736

[ View School Profile ]
",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),"
Central Aroostook Junior Senior High School
25 Pleasant St Po Box 310
Mars Hill, ME 04758

[ View School Profile ]
",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),"
Connor Consolidated School
1581 Van Buren Road
Connor Twp, ME 04736

[ View School Profile ]
",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),"
Cunningham Middle School
5 Third Street
Presque Isle, ME 04769

[ View School Profile ]
",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),"
Dawn F Barnes Elementary School
1025 Van Buren Road
Caswell, ME 04750

[ View School Profile ]
",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),"
Dr Levesque Elementary School
443 Us Rte 1 Po Box 489
Frenchville, ME 04745

[ View School Profile ]
",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),"
Eagle Lake Elem/jr High School
24 School St Po Box 190
Eagle Lake, ME 04739

[ View School Profile ]
",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),"
Easton Elementary School
Bangor Rd Po Box 126
Easton, ME 04740

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Easton Elementary School",'Easton=' + Easton.length); Easton[Easton.length] = createMarker(new GPoint(-67.91017914,46.64112091),"
Easton Junior-senior High School
173 Center Rd Po Box 66
Easton, ME 04740

[ View School Profile ]
",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),"
Eva Hoyt Zippel School
42 Griffin Street
Presque Isle, ME 04769

[ View School Profile ]
",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),"
Fort Fairfield Elementary School
76 Brunswick Avenue
Fort Fairfield, ME 04742

[ View School Profile ]
",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),"
Fort Fairfield Middle/high School
28 High School Drive Suite A
Fort Fairfield, ME 04742

[ View School Profile ]
",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),"
Fort Kent Community High School
84 Pleasant Street
Fort Kent, ME 04743

[ View School Profile ]
",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),"
Fort Kent Elementary School
108 Pleasant Street
Fort Kent, ME 04743

[ View School Profile ]
",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),"
Fort Street School
Po Box 509
Mars Hill, ME 04758

[ View School Profile ]
",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),"
Gateway Elementary School
160 Wright Street
Van Buren, ME 04785

[ View School Profile ]
",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),"
Hilltop Elementary School
19 Marshall Avenue
Caribou, ME 04736

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hilltop Elementary School",'Caribou=' + Caribou.length); Hodgdon[Hodgdon.length] = createMarker(new GPoint(-67.83999634,46.08670044),"
Hodgdon High School
175 Hodgdon Mills Road
Hodgdon, ME 04730

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hodgdon High School",'Hodgdon=' + Hodgdon.length); Houlton[Houlton.length] = createMarker(new GPoint(-67.84650421,46.11210251),"
Houlton Elementary School
60 South Street
Houlton, ME 04730

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Houlton Elementary School",'Houlton=' + Houlton.length); Houlton[Houlton.length] = createMarker(new GPoint(-67.82707977,46.12709427),"
Houlton High School
7 Bird Street
Houlton, ME 04730

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Houlton High School",'Houlton=' + Houlton.length); Houlton[Houlton.length] = createMarker(new GPoint(-67.82707977,46.12709427),"
Houlton Junior High School
7 Bird Street
Houlton, ME 04730

[ View School Profile ]
",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),"
Houlton Southside School
65 South Street
Houlton, ME 04730

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Houlton Southside School",'Houlton=' + Houlton.length); Limestone[Limestone.length] = createMarker(new GPoint(-67.82790375,46.90903473),"
Limestone Community School
93 High Street
Limestone, ME 04750

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Limestone Community School",'Limestone=' + Limestone.length); Madawaska[Madawaska.length] = createMarker(new GPoint(-68.32790375,47.35570145),"
Madawaska Elementary School
353 Eleventh Avenue
Madawaska, ME 04756

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Madawaska Elementary School",'Madawaska=' + Madawaska.length); Madawaska[Madawaska.length] = createMarker(new GPoint(-68.32898712,47.34818649),"
Madawaska Middle/high School
135 Seventh Avenue
Madawaska, ME 04756

[ View School Profile ]
",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),"
Maine School Of Science & Math
95 High Street
Limestone, ME 04750

[ View School Profile ]
",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),"
Mapleton Elementary School
1642 Main Street
Mapleton, ME 04757

[ View School Profile ]
",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),"
Msad#1 Alternative Education High School
25 Northern Road
Presque Isle, ME 04769

[ View School Profile ]
",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),"
New Sweden Consolidated School
113 Westmanland Road
New Sweden, ME 04762

[ View School Profile ]
",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),"
Patrick Therriault School
425 Martin Rd Po Box 62
Sinclair, ME 04779

[ View School Profile ]
",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),"
Pine Street Elementary School
50 Pine Street
Presque Isle, ME 04769

[ View School Profile ]
",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),"
Presque Isle High School
16 Griffin Street
Presque Isle, ME 04769

[ View School Profile ]
",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),"
Presque Isle Regional Technical Center
79 Blake St Ste 3
Presque Isle, ME 04769

[ View School Profile ]
",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),"
Region Two School Of Applied Technical
5 Bird St Po Box 307
Houlton, ME 04730

[ View School Profile ]
",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),"
Sad 70 Elementary School
175 Hodgdon Mills Road
Hodgdon, ME 04730

[ View School Profile ]
",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),"
Skyway Education Learning Center
1 Skyspot Lane
Presque Isle, ME 04769

[ View School Profile ]
",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),"
Skyway Middle School
569 Skyway Street
Presque Isle, ME 04769

[ View School Profile ]
",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),"
So Aroostook Csd School
922 Dyer Brook Road
Dyer Brook, ME 04747

[ View School Profile ]
",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),"
St Francis Elementary School
857 Main St Po Box 99
St Francis, ME 04774

[ View School Profile ]
",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),"
St John Valley Technology Center
431 Us Rte 1 Po Box 509
Frenchville, ME 04745

[ View School Profile ]
",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),"
Stockholm Elementary School
School Street
Stockholm, ME 04783

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stockholm Elementary School",'Stockholm=' + Stockholm.length); Caribou[Caribou.length] = createMarker(new GPoint(-68.00679779,46.86212540),"
Teague Park School
59 Glenn Street
Caribou, ME 04736

[ View School Profile ]
",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),"
Van Buren District Secondary School
169 Main Street
Van Buren, ME 04785

[ View School Profile ]
",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),"
Van Buren Regional Technology Center
169 Main Street
Van Buren, ME 04785

[ View School Profile ]
",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),"
Wallagrass Elementary School
45 Church St Po Box 9
Soldier Pond, ME 04781

[ View School Profile ]
",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),"
Washburn District Elementary School
33 School Street
Washburn, ME 04786

[ View School Profile ]
",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),"
Washburn District High School
1359 Main Street
Washburn, ME 04786

[ View School Profile ]
",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),"
Wellington School
Rr 1 Box 11
Monticello, ME 04760

[ View School Profile ]
",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),"
Wisdom Middle High School
368 Main St Po Box 69
St Agatha, ME 04772

[ View School Profile ]
",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),"
Woodland Consolidated School
844 Woodland Ctr Road
Woodland (aroos), ME 04736

[ View School Profile ]
",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),"
Wytopitlock Elementary School
Springer Rd Po Box 112
Wytopitlock, ME 04497

[ View School Profile ]
",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'); } }