function addMarkers() { mySelect = document.getElementById('selection'); Bangor = [];Alton = [];Orono = [];Bradford = [];Brewer = [];Carmel = [];Orrington = [];N_New_Portland = [];E_Corinth = [];Corinna = [];Dexter = [];Mattawamkeag = [];Milford = [];Hampden = [];Eddington = [];Springfield = [];Lincoln = [];Enfield = [];Etna = [];Exeter = [];Garland = [];Glenburn = [];Millinocket = [];Old_Town = [];Greenbush = [];Stillwater = [];Hermon = [];Howland = [];Holden = [];Hudson = [];Stacyville = [];Kenduskeag = [];Kingman = [];Winn = [];Levant = [];Lagrange = [];Medway = [];Charleston = [];Lee = [];Newburgh = [];Newport = [];East_Millinocket = [];Stetson = [];Veazie = [];Bradley = [];mySelect.options[mySelect.options.length] = new Option("Alton schools",'all=Alton'); mySelect.options[mySelect.options.length] = new Option("Bangor schools",'all=Bangor'); mySelect.options[mySelect.options.length] = new Option("Bradford schools",'all=Bradford'); mySelect.options[mySelect.options.length] = new Option("Bradley schools",'all=Bradley'); mySelect.options[mySelect.options.length] = new Option("Brewer schools",'all=Brewer'); mySelect.options[mySelect.options.length] = new Option("Carmel schools",'all=Carmel'); mySelect.options[mySelect.options.length] = new Option("Charleston schools",'all=Charleston'); mySelect.options[mySelect.options.length] = new Option("Corinna schools",'all=Corinna'); mySelect.options[mySelect.options.length] = new Option("Dexter schools",'all=Dexter'); mySelect.options[mySelect.options.length] = new Option("E Corinth schools",'all=E_Corinth'); mySelect.options[mySelect.options.length] = new Option("East Millinocket schools",'all=East_Millinocket'); mySelect.options[mySelect.options.length] = new Option("Eddington schools",'all=Eddington'); mySelect.options[mySelect.options.length] = new Option("Enfield schools",'all=Enfield'); mySelect.options[mySelect.options.length] = new Option("Etna schools",'all=Etna'); mySelect.options[mySelect.options.length] = new Option("Exeter schools",'all=Exeter'); mySelect.options[mySelect.options.length] = new Option("Garland schools",'all=Garland'); mySelect.options[mySelect.options.length] = new Option("Glenburn schools",'all=Glenburn'); mySelect.options[mySelect.options.length] = new Option("Greenbush schools",'all=Greenbush'); mySelect.options[mySelect.options.length] = new Option("Hampden schools",'all=Hampden'); mySelect.options[mySelect.options.length] = new Option("Hermon schools",'all=Hermon'); mySelect.options[mySelect.options.length] = new Option("Holden schools",'all=Holden'); mySelect.options[mySelect.options.length] = new Option("Howland schools",'all=Howland'); mySelect.options[mySelect.options.length] = new Option("Hudson schools",'all=Hudson'); mySelect.options[mySelect.options.length] = new Option("Kenduskeag schools",'all=Kenduskeag'); mySelect.options[mySelect.options.length] = new Option("Kingman schools",'all=Kingman'); mySelect.options[mySelect.options.length] = new Option("Lagrange schools",'all=Lagrange'); mySelect.options[mySelect.options.length] = new Option("Lee schools",'all=Lee'); mySelect.options[mySelect.options.length] = new Option("Levant schools",'all=Levant'); mySelect.options[mySelect.options.length] = new Option("Lincoln schools",'all=Lincoln'); mySelect.options[mySelect.options.length] = new Option("Mattawamkeag schools",'all=Mattawamkeag'); mySelect.options[mySelect.options.length] = new Option("Medway schools",'all=Medway'); mySelect.options[mySelect.options.length] = new Option("Milford schools",'all=Milford'); mySelect.options[mySelect.options.length] = new Option("Millinocket schools",'all=Millinocket'); mySelect.options[mySelect.options.length] = new Option("N New Portland schools",'all=N_New_Portland'); mySelect.options[mySelect.options.length] = new Option("Newburgh schools",'all=Newburgh'); mySelect.options[mySelect.options.length] = new Option("Newport schools",'all=Newport'); mySelect.options[mySelect.options.length] = new Option("Old Town schools",'all=Old_Town'); mySelect.options[mySelect.options.length] = new Option("Orono schools",'all=Orono'); mySelect.options[mySelect.options.length] = new Option("Orrington schools",'all=Orrington'); mySelect.options[mySelect.options.length] = new Option("Springfield schools",'all=Springfield'); mySelect.options[mySelect.options.length] = new Option("Stacyville schools",'all=Stacyville'); mySelect.options[mySelect.options.length] = new Option("Stetson schools",'all=Stetson'); mySelect.options[mySelect.options.length] = new Option("Stillwater schools",'all=Stillwater'); mySelect.options[mySelect.options.length] = new Option("Veazie schools",'all=Veazie'); mySelect.options[mySelect.options.length] = new Option("Winn schools",'all=Winn'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Bangor[Bangor.length] = createMarker(new GPoint(-68.76296234,44.80646133),"
",iconRd); mySelect.options[mySelect.options.length] = new Option("Abraham Lincoln School",'Bangor=' + Bangor.length); Alton[Alton.length] = createMarker(new GPoint(-68.72373962,45.04658890),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Alton Elementary School",'Alton=' + Alton.length); Orono[Orono.length] = createMarker(new GPoint(-68.67392731,44.88216400),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Asa C Adams School",'Orono=' + Orono.length); Bangor[Bangor.length] = createMarker(new GPoint(-68.78591919,44.83066177),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Bangor High School",'Bangor=' + Bangor.length); Bradford[Bradford.length] = createMarker(new GPoint(-68.94202423,45.07872391),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Bradford Elementary School",'Bradford=' + Bradford.length); Brewer[Brewer.length] = createMarker(new GPoint(-68.75353241,44.78176117),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Brewer High School",'Brewer=' + Brewer.length); Brewer[Brewer.length] = createMarker(new GPoint(-68.76020813,44.79207611),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Brewer Middle School",'Brewer=' + Brewer.length); Brewer[Brewer.length] = createMarker(new GPoint(-68.74847412,44.79422760),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Capri Street School",'Brewer=' + Brewer.length); Carmel[Carmel.length] = createMarker(new GPoint(-68.92910004,44.80810165),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Caravel Middle School",'Carmel=' + Carmel.length); Carmel[Carmel.length] = createMarker(new GPoint(-69.05088806,44.79700851),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Carmel Elementary School",'Carmel=' + Carmel.length); Orrington[Orrington.length] = createMarker(new GPoint(-68.81460571,44.72747421),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Center Drive School",'Orrington=' + Orrington.length); N_New_Portland[N_New_Portland.length] = createMarker(new GPoint(-70.06120300,44.95069885),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'N_New_Portland=' + N_New_Portland.length); E_Corinth[E_Corinth.length] = createMarker(new GPoint(-69.02019501,44.99696350),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Central High School",'E_Corinth=' + E_Corinth.length); E_Corinth[E_Corinth.length] = createMarker(new GPoint(-69.01977539,44.99607468),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Central Middle School",'E_Corinth=' + E_Corinth.length); Corinna[Corinna.length] = createMarker(new GPoint(-69.26274109,44.92110062),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Corinna Elementary School",'Corinna=' + Corinna.length); Corinna[Corinna.length] = createMarker(new GPoint(-69.26274109,44.92110062),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Corinna Junior High School",'Corinna=' + Corinna.length); Dexter[Dexter.length] = createMarker(new GPoint(-69.29876709,45.02827454),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Dexter Middle School",'Dexter=' + Dexter.length); Dexter[Dexter.length] = createMarker(new GPoint(-69.29888153,45.02809143),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Dexter Primary School",'Dexter=' + Dexter.length); Dexter[Dexter.length] = createMarker(new GPoint(-69.29774475,45.02500916),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Dexter Regional High School",'Dexter=' + Dexter.length); Bangor[Bangor.length] = createMarker(new GPoint(-68.82212067,44.83920670),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Downeast School",'Bangor=' + Bangor.length); Mattawamkeag[Mattawamkeag.length] = createMarker(new GPoint(-68.35668182,45.51531982),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Dr Carl E Troutt School",'Mattawamkeag=' + Mattawamkeag.length); Milford[Milford.length] = createMarker(new GPoint(-68.64041901,44.94214630),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Dr Lewis S Libby School",'Milford=' + Milford.length); Hampden[Hampden.length] = createMarker(new GPoint(-68.83845520,44.74066544),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Earl C Mcgraw School",'Hampden=' + Hampden.length); Eddington[Eddington.length] = createMarker(new GPoint(-68.65966034,44.82858658),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Eddington School",'Eddington=' + Eddington.length); Springfield[Springfield.length] = createMarker(new GPoint(-68.14394379,45.39446259),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Edith A Lombard School",'Springfield=' + Springfield.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-68.50079346,45.37652969),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Ella P Burr School",'Lincoln=' + Lincoln.length); Enfield[Enfield.length] = createMarker(new GPoint(-68.63723755,45.24000168),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Enfield Station Elementary School",'Enfield=' + Enfield.length); Etna[Etna.length] = createMarker(new GPoint(-69.15350342,44.81684113),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Etna-dixmont Elementary School",'Etna=' + Etna.length); Exeter[Exeter.length] = createMarker(new GPoint(-69.12809753,44.96630096),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Exeter Consolidated School",'Exeter=' + Exeter.length); Bangor[Bangor.length] = createMarker(new GPoint(-68.79073334,44.80243683),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Fairmount School",'Bangor=' + Bangor.length); Bangor[Bangor.length] = createMarker(new GPoint(-68.79406738,44.80349350),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Fourteenth Street School",'Bangor=' + Bangor.length); Bangor[Bangor.length] = createMarker(new GPoint(-68.75773621,44.81426239),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Fruit Street School",'Bangor=' + Bangor.length); Garland[Garland.length] = createMarker(new GPoint(-69.15309906,45.04589844),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Garland Elementary School",'Garland=' + Garland.length); Hampden[Hampden.length] = createMarker(new GPoint(-68.83840942,44.74082947),"",iconRd); mySelect.options[mySelect.options.length] = new Option("George B Weatherbee School",'Hampden=' + Hampden.length); Glenburn[Glenburn.length] = createMarker(new GPoint(-68.84821320,44.91591263),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Glenburn Elementary School",'Glenburn=' + Glenburn.length); Millinocket[Millinocket.length] = createMarker(new GPoint(-68.70571899,45.65202332),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Granite Street School",'Millinocket=' + Millinocket.length); Hampden[Hampden.length] = createMarker(new GPoint(-68.83874512,44.73907471),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Hampden Academy",'Hampden=' + Hampden.length); Old_Town[Old_Town.length] = createMarker(new GPoint(-68.64858246,44.93572617),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Helen Hunt School",'Old_Town=' + Old_Town.length); Greenbush[Greenbush.length] = createMarker(new GPoint(-68.61608124,45.11396027),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Helen S Dunn Elementary School",'Greenbush=' + Greenbush.length); Old_Town[Old_Town.length] = createMarker(new GPoint(-68.65344238,44.93602753),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Herbert Gray School",'Old_Town=' + Old_Town.length); Stillwater[Stillwater.length] = createMarker(new GPoint(-68.68804169,44.91077805),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Herbert Sargent School",'Stillwater=' + Stillwater.length); Hermon[Hermon.length] = createMarker(new GPoint(-68.91156006,44.81027985),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Hermon Elementary School",'Hermon=' + Hermon.length); Hermon[Hermon.length] = createMarker(new GPoint(-68.90059662,44.80490112),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Hermon High School",'Hermon=' + Hermon.length); Hermon[Hermon.length] = createMarker(new GPoint(-68.91156006,44.81027985),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Hermon Middle School",'Hermon=' + Hermon.length); Howland[Howland.length] = createMarker(new GPoint(-68.66233826,45.24588013),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Hichborn Middle School",'Howland=' + Howland.length); Holden[Holden.length] = createMarker(new GPoint(-68.61649323,44.74399948),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Holbrook School",'Holden=' + Holden.length); Holden[Holden.length] = createMarker(new GPoint(-68.66807556,44.75566101),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Holden School",'Holden=' + Holden.length); Hudson[Hudson.length] = createMarker(new GPoint(-68.87808990,44.98704529),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Hudson Elementary School",'Hudson=' + Hudson.length); Old_Town[Old_Town.length] = createMarker(new GPoint(-68.67579651,44.95159912),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Indian Island School",'Old_Town=' + Old_Town.length); Bangor[Bangor.length] = createMarker(new GPoint(-68.78311157,44.79752350),"",iconBl); mySelect.options[mySelect.options.length] = new Option("James F. Doughty School",'Bangor=' + Bangor.length); Old_Town[Old_Town.length] = createMarker(new GPoint(-68.65747833,44.93181229),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Street School",'Old_Town=' + Old_Town.length); Stacyville[Stacyville.length] = createMarker(new GPoint(-68.42970276,45.89965820),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Katahdin Elementary School",'Stacyville=' + Stacyville.length); Stacyville[Stacyville.length] = createMarker(new GPoint(-68.42970276,45.89965820),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Katahdin Middle/high School",'Stacyville=' + Stacyville.length); Kenduskeag[Kenduskeag.length] = createMarker(new GPoint(-68.88050079,44.89490128),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Kenduskeag Elementary School",'Kenduskeag=' + Kenduskeag.length); Kingman[Kingman.length] = createMarker(new GPoint(-68.19603729,45.55195999),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Kingman Elementary School",'Kingman=' + Kingman.length); Winn[Winn.length] = createMarker(new GPoint(-68.31543732,45.42818069),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lee/winn School",'Winn=' + Winn.length); Old_Town[Old_Town.length] = createMarker(new GPoint(-68.65499878,44.93185425),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Leonard Middle School",'Old_Town=' + Old_Town.length); Levant[Levant.length] = createMarker(new GPoint(-68.99077606,44.86076355),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Levant Elementary School",'Levant=' + Levant.length); Lagrange[Lagrange.length] = createMarker(new GPoint(-68.84249115,45.16762161),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Marion C Cook School",'Lagrange=' + Lagrange.length); Bangor[Bangor.length] = createMarker(new GPoint(-68.77265930,44.81664276),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Mary Snow School",'Bangor=' + Bangor.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-68.49932861,45.37844849),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Mattanawcook Academy",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-68.50145721,45.36456299),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Mattanawcook Junior High School",'Lincoln=' + Lincoln.length); Medway[Medway.length] = createMarker(new GPoint(-68.52300262,45.60660172),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Medway Middle School",'Medway=' + Medway.length); Millinocket[Millinocket.length] = createMarker(new GPoint(-68.70639801,45.66136551),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Millinocket Middle School",'Millinocket=' + Millinocket.length); E_Corinth[E_Corinth.length] = createMarker(new GPoint(-69.02076721,44.99825287),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Morison Memorial School",'E_Corinth=' + E_Corinth.length); Charleston[Charleston.length] = createMarker(new GPoint(-69.09832001,45.09789658),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Mountain View Youth Dev Center",'Charleston=' + Charleston.length); Lee[Lee.length] = createMarker(new GPoint(-68.28459930,45.36385727),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Mt Jefferson Junior High School",'Lee=' + Lee.length); Newburgh[Newburgh.length] = createMarker(new GPoint(-68.98079681,44.72859573),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Newburgh Elementary School",'Newburgh=' + Newburgh.length); Newport[Newport.length] = createMarker(new GPoint(-69.26640320,44.83169556),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Newport Elementary School",'Newport=' + Newport.length); Newport[Newport.length] = createMarker(new GPoint(-69.26908875,44.83370209),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Newport Junior High School",'Newport=' + Newport.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-68.50738525,45.36313629),"",iconGr); mySelect.options[mySelect.options.length] = new Option("No Penobscot Tech-region 3 High School",'Lincoln=' + Lincoln.length); Newport[Newport.length] = createMarker(new GPoint(-69.25350189,44.84659958),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Nokomis Regional High School",'Newport=' + Newport.length); Old_Town[Old_Town.length] = createMarker(new GPoint(-68.72646332,45.02677917),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Old Town Elementary School",'Old_Town=' + Old_Town.length); Old_Town[Old_Town.length] = createMarker(new GPoint(-68.65535736,44.93470764),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Old Town High School",'Old_Town=' + Old_Town.length); Old_Town[Old_Town.length] = createMarker(new GPoint(-68.72646332,45.02677917),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Old Town Regional Special Ed Prog",'Old_Town=' + Old_Town.length); East_Millinocket[East_Millinocket.length] = createMarker(new GPoint(-68.57554626,45.62639999),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Opal Myrick Elementary School",'East_Millinocket=' + East_Millinocket.length); Orono[Orono.length] = createMarker(new GPoint(-68.67413330,44.88225555),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Orono High School",'Orono=' + Orono.length); Orono[Orono.length] = createMarker(new GPoint(-68.67413330,44.88225555),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Orono Middle School",'Orono=' + Orono.length); Brewer[Brewer.length] = createMarker(new GPoint(-68.77038574,44.77542877),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Pendleton Street School",'Brewer=' + Brewer.length); Howland[Howland.length] = createMarker(new GPoint(-68.66233826,45.24588013),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Penobscot Valley High School",'Howland=' + Howland.length); Hampden[Hampden.length] = createMarker(new GPoint(-68.84020996,44.73744965),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Reeds Brook Middle School",'Hampden=' + Hampden.length); East_Millinocket[East_Millinocket.length] = createMarker(new GPoint(-68.57408905,45.63223267),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Schenck High School",'East_Millinocket=' + East_Millinocket.length); Newport[Newport.length] = createMarker(new GPoint(-69.29514313,44.88520050),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Sebasticook Valley Middle School",'Newport=' + Newport.length); Brewer[Brewer.length] = createMarker(new GPoint(-68.75769043,44.79173660),"",iconBl); mySelect.options[mySelect.options.length] = new Option("State Street School",'Brewer=' + Brewer.length); Millinocket[Millinocket.length] = createMarker(new GPoint(-68.70639801,45.66136551),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Stearns High School",'Millinocket=' + Millinocket.length); Stetson[Stetson.length] = createMarker(new GPoint(-69.11087036,44.89672470),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Stetson Elementary School",'Stetson=' + Stetson.length); Dexter[Dexter.length] = createMarker(new GPoint(-69.29780579,45.02507401),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Tri-county Regional Technical Center",'Dexter=' + Dexter.length); Bangor[Bangor.length] = createMarker(new GPoint(-68.73918152,44.82003403),"",iconGr); mySelect.options[mySelect.options.length] = new Option("United Technologies Ctr-region 4 High School",'Bangor=' + Bangor.length); Veazie[Veazie.length] = createMarker(new GPoint(-68.70783234,44.83289337),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Veazie Community School",'Veazie=' + Veazie.length); Bangor[Bangor.length] = createMarker(new GPoint(-68.78414154,44.79492950),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Vine Street School",'Bangor=' + Bangor.length); Bradley[Bradley.length] = createMarker(new GPoint(-68.62521362,44.91572189),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Viola Rand School",'Bradley=' + Bradley.length); Brewer[Brewer.length] = createMarker(new GPoint(-68.75380707,44.79671478),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Street School",'Brewer=' + Brewer.length); Bangor[Bangor.length] = createMarker(new GPoint(-68.75634003,44.81029510),"",iconBl); mySelect.options[mySelect.options.length] = new Option("William S Cohen School",'Bangor=' + Bangor.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(Alton); map.removeOverlays(Bangor); map.removeOverlays(Bradford); map.removeOverlays(Bradley); map.removeOverlays(Brewer); map.removeOverlays(Carmel); map.removeOverlays(Charleston); map.removeOverlays(Corinna); map.removeOverlays(Dexter); map.removeOverlays(E_Corinth); map.removeOverlays(East_Millinocket); map.removeOverlays(Eddington); map.removeOverlays(Enfield); map.removeOverlays(Etna); map.removeOverlays(Exeter); map.removeOverlays(Garland); map.removeOverlays(Glenburn); map.removeOverlays(Greenbush); map.removeOverlays(Hampden); map.removeOverlays(Hermon); map.removeOverlays(Holden); map.removeOverlays(Howland); map.removeOverlays(Hudson); map.removeOverlays(Kenduskeag); map.removeOverlays(Kingman); map.removeOverlays(Lagrange); map.removeOverlays(Lee); map.removeOverlays(Levant); map.removeOverlays(Lincoln); map.removeOverlays(Mattawamkeag); map.removeOverlays(Medway); map.removeOverlays(Milford); map.removeOverlays(Millinocket); map.removeOverlays(N_New_Portland); map.removeOverlays(Newburgh); map.removeOverlays(Newport); map.removeOverlays(Old_Town); map.removeOverlays(Orono); map.removeOverlays(Orrington); map.removeOverlays(Springfield); map.removeOverlays(Stacyville); map.removeOverlays(Stetson); map.removeOverlays(Stillwater); map.removeOverlays(Veazie); map.removeOverlays(Winn); 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(Bangor);map.removeOverlays(Alton); map.removeOverlays(Bangor); map.removeOverlays(Bradford); map.removeOverlays(Bradley); map.removeOverlays(Brewer); map.removeOverlays(Carmel); map.removeOverlays(Charleston); map.removeOverlays(Corinna); map.removeOverlays(Dexter); map.removeOverlays(E_Corinth); map.removeOverlays(East_Millinocket); map.removeOverlays(Eddington); map.removeOverlays(Enfield); map.removeOverlays(Etna); map.removeOverlays(Exeter); map.removeOverlays(Garland); map.removeOverlays(Glenburn); map.removeOverlays(Greenbush); map.removeOverlays(Hampden); map.removeOverlays(Hermon); map.removeOverlays(Holden); map.removeOverlays(Howland); map.removeOverlays(Hudson); map.removeOverlays(Kenduskeag); map.removeOverlays(Kingman); map.removeOverlays(Lagrange); map.removeOverlays(Lee); map.removeOverlays(Levant); map.removeOverlays(Lincoln); map.removeOverlays(Mattawamkeag); map.removeOverlays(Medway); map.removeOverlays(Milford); map.removeOverlays(Millinocket); map.removeOverlays(N_New_Portland); map.removeOverlays(Newburgh); map.removeOverlays(Newport); map.removeOverlays(Old_Town); map.removeOverlays(Orono); map.removeOverlays(Orrington); map.removeOverlays(Springfield); map.removeOverlays(Stacyville); map.removeOverlays(Stetson); map.removeOverlays(Stillwater); map.removeOverlays(Veazie); map.removeOverlays(Winn); map.addOverlays(Alton); centerByArray(Alton, false, false); cntMarker += Alton.length; map.addOverlays(Bangor); centerByArray(Bangor, false, false); cntMarker += Bangor.length; map.addOverlays(Bradford); centerByArray(Bradford, false, false); cntMarker += Bradford.length; map.addOverlays(Bradley); centerByArray(Bradley, false, false); cntMarker += Bradley.length; map.addOverlays(Brewer); centerByArray(Brewer, false, false); cntMarker += Brewer.length; map.addOverlays(Carmel); centerByArray(Carmel, false, false); cntMarker += Carmel.length; map.addOverlays(Charleston); centerByArray(Charleston, false, false); cntMarker += Charleston.length; map.addOverlays(Corinna); centerByArray(Corinna, false, false); cntMarker += Corinna.length; map.addOverlays(Dexter); centerByArray(Dexter, false, false); cntMarker += Dexter.length; map.addOverlays(E_Corinth); centerByArray(E_Corinth, false, false); cntMarker += E_Corinth.length; map.addOverlays(East_Millinocket); centerByArray(East_Millinocket, false, false); cntMarker += East_Millinocket.length; map.addOverlays(Eddington); centerByArray(Eddington, false, false); cntMarker += Eddington.length; map.addOverlays(Enfield); centerByArray(Enfield, false, false); cntMarker += Enfield.length; map.addOverlays(Etna); centerByArray(Etna, false, false); cntMarker += Etna.length; map.addOverlays(Exeter); centerByArray(Exeter, false, false); cntMarker += Exeter.length; map.addOverlays(Garland); centerByArray(Garland, false, false); cntMarker += Garland.length; map.addOverlays(Glenburn); centerByArray(Glenburn, false, false); cntMarker += Glenburn.length; map.addOverlays(Greenbush); centerByArray(Greenbush, false, false); cntMarker += Greenbush.length; map.addOverlays(Hampden); centerByArray(Hampden, false, false); cntMarker += Hampden.length; map.addOverlays(Hermon); centerByArray(Hermon, false, false); cntMarker += Hermon.length; map.addOverlays(Holden); centerByArray(Holden, false, false); cntMarker += Holden.length; map.addOverlays(Howland); centerByArray(Howland, false, false); cntMarker += Howland.length; map.addOverlays(Hudson); centerByArray(Hudson, false, false); cntMarker += Hudson.length; map.addOverlays(Kenduskeag); centerByArray(Kenduskeag, false, false); cntMarker += Kenduskeag.length; map.addOverlays(Kingman); centerByArray(Kingman, false, false); cntMarker += Kingman.length; map.addOverlays(Lagrange); centerByArray(Lagrange, false, false); cntMarker += Lagrange.length; map.addOverlays(Lee); centerByArray(Lee, false, false); cntMarker += Lee.length; map.addOverlays(Levant); centerByArray(Levant, false, false); cntMarker += Levant.length; map.addOverlays(Lincoln); centerByArray(Lincoln, false, false); cntMarker += Lincoln.length; map.addOverlays(Mattawamkeag); centerByArray(Mattawamkeag, false, false); cntMarker += Mattawamkeag.length; map.addOverlays(Medway); centerByArray(Medway, false, false); cntMarker += Medway.length; map.addOverlays(Milford); centerByArray(Milford, false, false); cntMarker += Milford.length; map.addOverlays(Millinocket); centerByArray(Millinocket, false, false); cntMarker += Millinocket.length; map.addOverlays(N_New_Portland); centerByArray(N_New_Portland, false, false); cntMarker += N_New_Portland.length; map.addOverlays(Newburgh); centerByArray(Newburgh, false, false); cntMarker += Newburgh.length; map.addOverlays(Newport); centerByArray(Newport, false, false); cntMarker += Newport.length; map.addOverlays(Old_Town); centerByArray(Old_Town, false, false); cntMarker += Old_Town.length; map.addOverlays(Orono); centerByArray(Orono, false, false); cntMarker += Orono.length; map.addOverlays(Orrington); centerByArray(Orrington, false, false); cntMarker += Orrington.length; map.addOverlays(Springfield); centerByArray(Springfield, false, false); cntMarker += Springfield.length; map.addOverlays(Stacyville); centerByArray(Stacyville, false, false); cntMarker += Stacyville.length; map.addOverlays(Stetson); centerByArray(Stetson, false, false); cntMarker += Stetson.length; map.addOverlays(Stillwater); centerByArray(Stillwater, false, false); cntMarker += Stillwater.length; map.addOverlays(Veazie); centerByArray(Veazie, false, false); cntMarker += Veazie.length; map.addOverlays(Winn); centerByArray(Winn, false, false); cntMarker += Winn.length; centerByArray(Bangor,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'); } }