function addMarkers() { mySelect = document.getElementById('selection'); Acton = [];Alfred = [];Berwick = [];Biddeford = [];Buxton = [];Saco = [];Springvale = [];South_Berwick = [];York = [];Lyman = [];Kennebunk = [];Dayton = [];Eliot = [];Bar_Mills = [];Sanford = [];Parsonsfield = [];Kittery = [];Limington = [];Hollis = [];Kittery_Point = [];Old_Orchard_Bch = [];Kennebunkport = [];E_Lebanon = [];West_Newfield = [];Waterboro = [];Arundel = [];North_Berwick = [];N_Berwick = [];Ogunquit = [];Shapleigh = [];E_Waterboro = [];Wells = [];mySelect.options[mySelect.options.length] = new Option("Acton schools",'all=Acton'); mySelect.options[mySelect.options.length] = new Option("Alfred schools",'all=Alfred'); mySelect.options[mySelect.options.length] = new Option("Arundel schools",'all=Arundel'); mySelect.options[mySelect.options.length] = new Option("Bar Mills schools",'all=Bar_Mills'); mySelect.options[mySelect.options.length] = new Option("Berwick schools",'all=Berwick'); mySelect.options[mySelect.options.length] = new Option("Biddeford schools",'all=Biddeford'); mySelect.options[mySelect.options.length] = new Option("Buxton schools",'all=Buxton'); mySelect.options[mySelect.options.length] = new Option("Dayton schools",'all=Dayton'); mySelect.options[mySelect.options.length] = new Option("E Lebanon schools",'all=E_Lebanon'); mySelect.options[mySelect.options.length] = new Option("E Waterboro schools",'all=E_Waterboro'); mySelect.options[mySelect.options.length] = new Option("Eliot schools",'all=Eliot'); mySelect.options[mySelect.options.length] = new Option("Hollis schools",'all=Hollis'); mySelect.options[mySelect.options.length] = new Option("Kennebunk schools",'all=Kennebunk'); mySelect.options[mySelect.options.length] = new Option("Kennebunkport schools",'all=Kennebunkport'); mySelect.options[mySelect.options.length] = new Option("Kittery schools",'all=Kittery'); mySelect.options[mySelect.options.length] = new Option("Kittery Point schools",'all=Kittery_Point'); mySelect.options[mySelect.options.length] = new Option("Limington schools",'all=Limington'); mySelect.options[mySelect.options.length] = new Option("Lyman schools",'all=Lyman'); mySelect.options[mySelect.options.length] = new Option("N Berwick schools",'all=N_Berwick'); mySelect.options[mySelect.options.length] = new Option("North Berwick schools",'all=North_Berwick'); mySelect.options[mySelect.options.length] = new Option("Ogunquit schools",'all=Ogunquit'); mySelect.options[mySelect.options.length] = new Option("Old Orchard Bch schools",'all=Old_Orchard_Bch'); mySelect.options[mySelect.options.length] = new Option("Parsonsfield schools",'all=Parsonsfield'); mySelect.options[mySelect.options.length] = new Option("Saco schools",'all=Saco'); mySelect.options[mySelect.options.length] = new Option("Sanford schools",'all=Sanford'); mySelect.options[mySelect.options.length] = new Option("Shapleigh schools",'all=Shapleigh'); mySelect.options[mySelect.options.length] = new Option("South Berwick schools",'all=South_Berwick'); mySelect.options[mySelect.options.length] = new Option("Springvale schools",'all=Springvale'); mySelect.options[mySelect.options.length] = new Option("Waterboro schools",'all=Waterboro'); mySelect.options[mySelect.options.length] = new Option("Wells schools",'all=Wells'); mySelect.options[mySelect.options.length] = new Option("West Newfield schools",'all=West_Newfield'); mySelect.options[mySelect.options.length] = new Option("York schools",'all=York'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Acton[Acton.length] = createMarker(new GPoint(-70.89555359,43.50665665),"
Acton Elementary School
700 Milton Mills Road
Acton, ME 04001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Acton Elementary School",'Acton=' + Acton.length); Alfred[Alfred.length] = createMarker(new GPoint(-70.71526337,43.47607040),"
Alfred Elementary School
21 Sanford Road
Alfred, ME 04002

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Alfred Elementary School",'Alfred=' + Alfred.length); Berwick[Berwick.length] = createMarker(new GPoint(-70.86244965,43.26793289),"
Berwick Elementary School
20 Wilson Street
Berwick, ME 03901

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Berwick Elementary School",'Berwick=' + Berwick.length); Biddeford[Biddeford.length] = createMarker(new GPoint(-70.47023010,43.49640656),"
Biddeford High School
20 Maplewood Avenue
Biddeford, ME 04005

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Biddeford High School",'Biddeford=' + Biddeford.length); Biddeford[Biddeford.length] = createMarker(new GPoint(-70.46752167,43.47415161),"
Biddeford Middle School
335 Hill Street
Biddeford, ME 04005

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Biddeford Middle School",'Biddeford=' + Biddeford.length); Biddeford[Biddeford.length] = createMarker(new GPoint(-70.46666718,43.47579575),"
Biddeford Primary
320 Hill Street
Biddeford, ME 04005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Biddeford Primary",'Biddeford=' + Biddeford.length); Biddeford[Biddeford.length] = createMarker(new GPoint(-70.46982574,43.49680710),"
Biddeford Regional Center Of Technical
10 Maplewood Avenue
Biddeford, ME 04005

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Biddeford Regional Center Of Technical",'Biddeford=' + Biddeford.length); Buxton[Buxton.length] = createMarker(new GPoint(-70.59616852,43.69403458),"
Bonny Eagle Middle School
92 Sokokis Trail
Buxton, ME 04093

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bonny Eagle Middle School",'Buxton=' + Buxton.length); Saco[Saco.length] = createMarker(new GPoint(-70.44062805,43.50150299),"
C K Burns School
135 Middle Street
Saco, ME 04072

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("C K Burns School",'Saco=' + Saco.length); Springvale[Springvale.length] = createMarker(new GPoint(-70.78147888,43.46089554),"
Carl J Lamb School
233 Shaws Ridge Road
Springvale, ME 04083

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carl J Lamb School",'Springvale=' + Springvale.length); South_Berwick[South_Berwick.length] = createMarker(new GPoint(-70.80891418,43.23328018),"
Central School
197 Main Street
South Berwick, ME 03908

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central School",'South_Berwick=' + South_Berwick.length); York[York.length] = createMarker(new GPoint(-70.64477539,43.15699768),"
Coastal Ridge Elementary School
1 Coastal Ridge Drive
York, ME 03909

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Coastal Ridge Elementary School",'York=' + York.length); Lyman[Lyman.length] = createMarker(new GPoint(-70.59114838,43.49773026),"
Cousens Memorial School
382 Goodwins Mills Road
Lyman, ME 04002

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cousens Memorial School",'Lyman=' + Lyman.length); Kennebunk[Kennebunk.length] = createMarker(new GPoint(-70.54510498,43.38065338),"
Cousens School
12 Day Street
Kennebunk, ME 04043

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cousens School",'Kennebunk=' + Kennebunk.length); Dayton[Dayton.length] = createMarker(new GPoint(-70.59282684,43.54462433),"
Dayton Consolidated School
21 Clarks Mills Road
Dayton, ME 04005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dayton Consolidated School",'Dayton=' + Dayton.length); Eliot[Eliot.length] = createMarker(new GPoint(-70.78793335,43.12269211),"
Eliot Elementary School
1298 State Road
Eliot, ME 03903

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eliot Elementary School",'Eliot=' + Eliot.length); Bar_Mills[Bar_Mills.length] = createMarker(new GPoint(-70.55020142,43.61299896),"
Eliza Libby Elementary School
Po Box 57
Bar Mills, ME 04004

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eliza Libby Elementary School",'Bar_Mills=' + Bar_Mills.length); Sanford[Sanford.length] = createMarker(new GPoint(-70.77237701,43.43481445),"
Emerson School
975 Main Street
Sanford, ME 04073

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Emerson School",'Sanford=' + Sanford.length); Buxton[Buxton.length] = createMarker(new GPoint(-70.54013824,43.64979935),"
Frank Jewett School
24 Groveville Road
Buxton, ME 04093

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Frank Jewett School",'Buxton=' + Buxton.length); Parsonsfield[Parsonsfield.length] = createMarker(new GPoint(-70.92839050,43.75896835),"
Fred W Morrill School
634 North Road
Parsonsfield, ME 04047

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fred W Morrill School",'Parsonsfield=' + Parsonsfield.length); Kittery[Kittery.length] = createMarker(new GPoint(-70.73806000,43.09692383),"
Frisbee Elementary School
120 Rogers Road
Kittery, ME 03904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Frisbee Elementary School",'Kittery=' + Kittery.length); Saco[Saco.length] = createMarker(new GPoint(-70.43904877,43.49955368),"
Governor John Fairfield School
75 Beach Street
Saco, ME 04072

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Governor John Fairfield School",'Saco=' + Saco.length); Limington[Limington.length] = createMarker(new GPoint(-70.70883942,43.72743988),"
H B Emery Junior Memorial School
908 Cape Road
Limington, ME 04049

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("H B Emery Junior Memorial School",'Limington=' + Limington.length); Hollis[Hollis.length] = createMarker(new GPoint(-70.59076691,43.60440063),"
Hollis Consolidated School
554 River Road
Hollis, ME 04042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hollis Consolidated School",'Hollis=' + Hollis.length); Hollis[Hollis.length] = createMarker(new GPoint(-70.59076691,43.60440063),"
Hollis School
554 River Road
Hollis, ME 04042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hollis School",'Hollis=' + Hollis.length); Kittery_Point[Kittery_Point.length] = createMarker(new GPoint(-70.70001984,43.08368683),"
Horace Mitchell Primary School
7 School Lane
Kittery Point, ME 03905

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Horace Mitchell Primary School",'Kittery_Point=' + Kittery_Point.length); Buxton[Buxton.length] = createMarker(new GPoint(-70.58255768,43.68011856),"
Jack Memorial School
290 Parker Farm Road
Buxton, ME 04093

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jack Memorial School",'Buxton=' + Buxton.length); Old_Orchard_Bch[Old_Orchard_Bch.length] = createMarker(new GPoint(-70.39366150,43.51255417),"
Jameson Elementary School
28 Jameson Hill Road
Old Orchard Bch, ME 04064

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jameson Elementary School",'Old_Orchard_Bch=' + Old_Orchard_Bch.length); Biddeford[Biddeford.length] = createMarker(new GPoint(-70.46375275,43.47863388),"
John F Kennedy Memorial School
64 West Street
Biddeford, ME 04005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John F Kennedy Memorial School",'Biddeford=' + Biddeford.length); Kennebunk[Kennebunk.length] = createMarker(new GPoint(-70.54955292,43.39542007),"
Kennebunk High School
89 Fletcher Street
Kennebunk, ME 04043

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kennebunk High School",'Kennebunk=' + Kennebunk.length); Kennebunkport[Kennebunkport.length] = createMarker(new GPoint(-70.46963501,43.36248016),"
Kennebunkport Consolidated School
25 School Street
Kennebunkport, ME 04046

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kennebunkport Consolidated School",'Kennebunkport=' + Kennebunkport.length); Sanford[Sanford.length] = createMarker(new GPoint(-70.77080536,43.44431305),"
Lafayette School
69 Brook Street
Sanford, ME 04073

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lafayette School",'Sanford=' + Sanford.length); E_Lebanon[E_Lebanon.length] = createMarker(new GPoint(-69.29499817,45.84260178),"
Lebanon School
53 Upper Guinea Rd Pob 159
E Lebanon, ME 04027

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lebanon School",'E_Lebanon=' + E_Lebanon.length); West_Newfield[West_Newfield.length] = createMarker(new GPoint(-70.83914948,43.65360260),"
Line Elementary School
818 Water Street
West Newfield, ME 04095

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Line Elementary School",'West_Newfield=' + West_Newfield.length); Old_Orchard_Bch[Old_Orchard_Bch.length] = createMarker(new GPoint(-70.39001465,43.51364899),"
Loranger Middle School
148 Saco Avenue
Old Orchard Bch, ME 04064

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Loranger Middle School",'Old_Orchard_Bch=' + Old_Orchard_Bch.length); Lyman[Lyman.length] = createMarker(new GPoint(-70.63240814,43.48547363),"
Lyman Elementary School
39 Schoolhouse Road
Lyman, ME 04002

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lyman Elementary School",'Lyman=' + Lyman.length); Sanford[Sanford.length] = createMarker(new GPoint(-70.77731323,43.42397690),"
Margaret Chase Smith School
248 Twombly Road
Sanford, ME 04073

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Margaret Chase Smith School",'Sanford=' + Sanford.length); South_Berwick[South_Berwick.length] = createMarker(new GPoint(-70.79242706,43.20300674),"
Marshwood High School
260 Route 236
South Berwick, ME 03908

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marshwood High School",'South_Berwick=' + South_Berwick.length); Eliot[Eliot.length] = createMarker(new GPoint(-70.79821777,43.15275574),"
Marshwood Junior High School
626 Dow Highway
Eliot, ME 03903

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Marshwood Junior High School",'Eliot=' + Eliot.length); South_Berwick[South_Berwick.length] = createMarker(new GPoint(-70.80168152,43.22509003),"
Marshwood Middle School
49 Academy Street
South Berwick, ME 03908

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Marshwood Middle School",'South_Berwick=' + South_Berwick.length); Waterboro[Waterboro.length] = createMarker(new GPoint(-70.71494293,43.53546143),"
Massabesic High School
88 West Road
Waterboro, ME 04087

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Massabesic High School",'Waterboro=' + Waterboro.length); Waterboro[Waterboro.length] = createMarker(new GPoint(-70.71494293,43.53546143),"
Massabesic Junior High School
84 West Road
Waterboro, ME 04087

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Massabesic Junior High School",'Waterboro=' + Waterboro.length); Kennebunk[Kennebunk.length] = createMarker(new GPoint(-70.57651520,43.41194916),"
Middle School Of Kennebunks
60 Thompson Road
Kennebunk, ME 04043

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Middle School Of Kennebunks",'Kennebunk=' + Kennebunk.length); Arundel[Arundel.length] = createMarker(new GPoint(-70.53845215,43.44473267),"
Mildred L Day School
600 Limerick Road
Arundel, ME 04046

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mildred L Day School",'Arundel=' + Arundel.length); North_Berwick[North_Berwick.length] = createMarker(new GPoint(-70.77825165,43.29874039),"
Noble High School
388 Somersworth Road
North Berwick, ME 03906

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Noble High School",'North_Berwick=' + North_Berwick.length); Berwick[Berwick.length] = createMarker(new GPoint(-70.82695770,43.28881454),"
Noble Middle School
46 Cranberry Meadow Road
Berwick, ME 03901

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Noble Middle School",'Berwick=' + Berwick.length); Berwick[Berwick.length] = createMarker(new GPoint(-70.82281494,43.28493118),"
Noble Vi Middle School
356 School Street
Berwick, ME 03901

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Noble Vi Middle School",'Berwick=' + Berwick.length); N_Berwick[N_Berwick.length] = createMarker(new GPoint(-70.73949432,43.30715561),"
North Berwick Elementary School
25 Varney St Pob 609
N Berwick, ME 03906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Berwick Elementary School",'N_Berwick=' + N_Berwick.length); Ogunquit[Ogunquit.length] = createMarker(new GPoint(-70.60009766,43.25000000),"
Ogunquit Village School
Po Box 2399
Ogunquit, ME 03907

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ogunquit Village School",'Ogunquit=' + Ogunquit.length); Old_Orchard_Bch[Old_Orchard_Bch.length] = createMarker(new GPoint(-70.39202881,43.51422119),"
Old Orchard Beach High School
40 E Emerson Cummings Blvd
Old Orchard Bch, ME 04064

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Old Orchard Beach High School",'Old_Orchard_Bch=' + Old_Orchard_Bch.length); Kennebunk[Kennebunk.length] = createMarker(new GPoint(-70.53549957,43.38513565),"
Park Street School
177 Alewive Road
Kennebunk, ME 04043

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Park Street School",'Kennebunk=' + Kennebunk.length); Kittery[Kittery.length] = createMarker(new GPoint(-70.73878479,43.08749008),"
Robert W Traip Academy
12 Williams Avenue
Kittery, ME 03904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Robert W Traip Academy",'Kittery=' + Kittery.length); Saco[Saco.length] = createMarker(new GPoint(-70.46588898,43.52716064),"
Saco Middle School
40 Buxton Road
Saco, ME 04072

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Saco Middle School",'Saco=' + Saco.length); Saco[Saco.length] = createMarker(new GPoint(-70.41275787,43.53804016),"
Saco Transition Program
80 Common St Bldg 2
Saco, ME 04072

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Saco Transition Program",'Saco=' + Saco.length); Buxton[Buxton.length] = createMarker(new GPoint(-70.54158020,43.64900970),"
Samuel D Hanson School
932 Long Plains Road
Buxton, ME 04093

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Samuel D Hanson School",'Buxton=' + Buxton.length); Sanford[Sanford.length] = createMarker(new GPoint(-70.78659058,43.45346069),"
Sanford High School
52 Sanford High School Blvd
Sanford, ME 04073

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sanford High School",'Sanford=' + Sanford.length); Sanford[Sanford.length] = createMarker(new GPoint(-70.78722382,43.44959641),"
Sanford Junior High School
708 Main Street
Sanford, ME 04073

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sanford Junior High School",'Sanford=' + Sanford.length); Sanford[Sanford.length] = createMarker(new GPoint(-70.78659058,43.45346069),"
Sanford Regional Vocational Center
52 Sanford High School Blvd
Sanford, ME 04073

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sanford Regional Vocational Center",'Sanford=' + Sanford.length); Kennebunk[Kennebunk.length] = createMarker(new GPoint(-70.52690125,43.37136841),"
Sea Road School
71 Sea Road
Kennebunk, ME 04043

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sea Road School",'Kennebunk=' + Kennebunk.length); Shapleigh[Shapleigh.length] = createMarker(new GPoint(-70.84999847,43.53849030),"
Shapleigh Memorial School
467 Shapleigh Corner Road
Shapleigh, ME 04076

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shapleigh Memorial School",'Shapleigh=' + Shapleigh.length); Kittery[Kittery.length] = createMarker(new GPoint(-70.74645996,43.11509323),"
Shapleigh Middle School
43 Stevenson Road
Kittery, ME 03904

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Shapleigh Middle School",'Kittery=' + Kittery.length); York[York.length] = createMarker(new GPoint(-70.65724182,43.14599609),"
Village Elementary School
124 York Street
York, ME 03909

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Village Elementary School",'York=' + York.length); Berwick[Berwick.length] = createMarker(new GPoint(-70.84159088,43.26330948),"
Vivian E Hussey Primary
20 Blackberry Hill Rd Pob 1156
Berwick, ME 03901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Vivian E Hussey Primary",'Berwick=' + Berwick.length); E_Waterboro[E_Waterboro.length] = createMarker(new GPoint(-70.69480133,43.59479904),"
Waterboro Elementary School
340 So Ko Kis Trail
E Waterboro, ME 04030

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Waterboro Elementary School",'E_Waterboro=' + E_Waterboro.length); Wells[Wells.length] = createMarker(new GPoint(-70.58233643,43.31933594),"
Wells Elementary School
276 Sanford Rd Po Box 429
Wells, ME 04090

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wells Elementary School",'Wells=' + Wells.length); Wells[Wells.length] = createMarker(new GPoint(-70.59087372,43.32168961),"
Wells High School
222 Sanford Rd Po Box 579
Wells, ME 04090

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wells High School",'Wells=' + Wells.length); Wells[Wells.length] = createMarker(new GPoint(-70.58220673,43.31963730),"
Wells Junior High School
1470 Post Rd Po Box 310
Wells, ME 04090

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Wells Junior High School",'Wells=' + Wells.length); Sanford[Sanford.length] = createMarker(new GPoint(-70.78813934,43.45195770),"
Willard School
668 Main Street
Sanford, ME 04073

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Willard School",'Sanford=' + Sanford.length); York[York.length] = createMarker(new GPoint(-70.62846375,43.15188599),"
York High School
1 Robert Stevens Drive
York, ME 03909

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("York High School",'York=' + York.length); York[York.length] = createMarker(new GPoint(-70.66265869,43.14534378),"
York Middle School
30 Organug Road
York, ME 03909

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("York Middle School",'York=' + York.length); Saco[Saco.length] = createMarker(new GPoint(-70.45323181,43.51222992),"
Young School
36 Tasker Street
Saco, ME 04072

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Young School",'Saco=' + Saco.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(Acton); map.removeOverlays(Alfred); map.removeOverlays(Arundel); map.removeOverlays(Bar_Mills); map.removeOverlays(Berwick); map.removeOverlays(Biddeford); map.removeOverlays(Buxton); map.removeOverlays(Dayton); map.removeOverlays(E_Lebanon); map.removeOverlays(E_Waterboro); map.removeOverlays(Eliot); map.removeOverlays(Hollis); map.removeOverlays(Kennebunk); map.removeOverlays(Kennebunkport); map.removeOverlays(Kittery); map.removeOverlays(Kittery_Point); map.removeOverlays(Limington); map.removeOverlays(Lyman); map.removeOverlays(N_Berwick); map.removeOverlays(North_Berwick); map.removeOverlays(Ogunquit); map.removeOverlays(Old_Orchard_Bch); map.removeOverlays(Parsonsfield); map.removeOverlays(Saco); map.removeOverlays(Sanford); map.removeOverlays(Shapleigh); map.removeOverlays(South_Berwick); map.removeOverlays(Springvale); map.removeOverlays(Waterboro); map.removeOverlays(Wells); map.removeOverlays(West_Newfield); map.removeOverlays(York); 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(Acton);map.removeOverlays(Acton); map.removeOverlays(Alfred); map.removeOverlays(Arundel); map.removeOverlays(Bar_Mills); map.removeOverlays(Berwick); map.removeOverlays(Biddeford); map.removeOverlays(Buxton); map.removeOverlays(Dayton); map.removeOverlays(E_Lebanon); map.removeOverlays(E_Waterboro); map.removeOverlays(Eliot); map.removeOverlays(Hollis); map.removeOverlays(Kennebunk); map.removeOverlays(Kennebunkport); map.removeOverlays(Kittery); map.removeOverlays(Kittery_Point); map.removeOverlays(Limington); map.removeOverlays(Lyman); map.removeOverlays(N_Berwick); map.removeOverlays(North_Berwick); map.removeOverlays(Ogunquit); map.removeOverlays(Old_Orchard_Bch); map.removeOverlays(Parsonsfield); map.removeOverlays(Saco); map.removeOverlays(Sanford); map.removeOverlays(Shapleigh); map.removeOverlays(South_Berwick); map.removeOverlays(Springvale); map.removeOverlays(Waterboro); map.removeOverlays(Wells); map.removeOverlays(West_Newfield); map.removeOverlays(York); map.addOverlays(Acton); centerByArray(Acton, false, false); cntMarker += Acton.length; map.addOverlays(Alfred); centerByArray(Alfred, false, false); cntMarker += Alfred.length; map.addOverlays(Arundel); centerByArray(Arundel, false, false); cntMarker += Arundel.length; map.addOverlays(Bar_Mills); centerByArray(Bar_Mills, false, false); cntMarker += Bar_Mills.length; map.addOverlays(Berwick); centerByArray(Berwick, false, false); cntMarker += Berwick.length; map.addOverlays(Biddeford); centerByArray(Biddeford, false, false); cntMarker += Biddeford.length; map.addOverlays(Buxton); centerByArray(Buxton, false, false); cntMarker += Buxton.length; map.addOverlays(Dayton); centerByArray(Dayton, false, false); cntMarker += Dayton.length; map.addOverlays(E_Lebanon); centerByArray(E_Lebanon, false, false); cntMarker += E_Lebanon.length; map.addOverlays(E_Waterboro); centerByArray(E_Waterboro, false, false); cntMarker += E_Waterboro.length; map.addOverlays(Eliot); centerByArray(Eliot, false, false); cntMarker += Eliot.length; map.addOverlays(Hollis); centerByArray(Hollis, false, false); cntMarker += Hollis.length; map.addOverlays(Kennebunk); centerByArray(Kennebunk, false, false); cntMarker += Kennebunk.length; map.addOverlays(Kennebunkport); centerByArray(Kennebunkport, false, false); cntMarker += Kennebunkport.length; map.addOverlays(Kittery); centerByArray(Kittery, false, false); cntMarker += Kittery.length; map.addOverlays(Kittery_Point); centerByArray(Kittery_Point, false, false); cntMarker += Kittery_Point.length; map.addOverlays(Limington); centerByArray(Limington, false, false); cntMarker += Limington.length; map.addOverlays(Lyman); centerByArray(Lyman, false, false); cntMarker += Lyman.length; map.addOverlays(N_Berwick); centerByArray(N_Berwick, false, false); cntMarker += N_Berwick.length; map.addOverlays(North_Berwick); centerByArray(North_Berwick, false, false); cntMarker += North_Berwick.length; map.addOverlays(Ogunquit); centerByArray(Ogunquit, false, false); cntMarker += Ogunquit.length; map.addOverlays(Old_Orchard_Bch); centerByArray(Old_Orchard_Bch, false, false); cntMarker += Old_Orchard_Bch.length; map.addOverlays(Parsonsfield); centerByArray(Parsonsfield, false, false); cntMarker += Parsonsfield.length; map.addOverlays(Saco); centerByArray(Saco, false, false); cntMarker += Saco.length; map.addOverlays(Sanford); centerByArray(Sanford, false, false); cntMarker += Sanford.length; map.addOverlays(Shapleigh); centerByArray(Shapleigh, false, false); cntMarker += Shapleigh.length; map.addOverlays(South_Berwick); centerByArray(South_Berwick, false, false); cntMarker += South_Berwick.length; map.addOverlays(Springvale); centerByArray(Springvale, false, false); cntMarker += Springvale.length; map.addOverlays(Waterboro); centerByArray(Waterboro, false, false); cntMarker += Waterboro.length; map.addOverlays(Wells); centerByArray(Wells, false, false); cntMarker += Wells.length; map.addOverlays(West_Newfield); centerByArray(West_Newfield, false, false); cntMarker += West_Newfield.length; map.addOverlays(York); centerByArray(York, false, false); cntMarker += York.length; centerByArray(Acton,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'); } }