function addMarkers() { mySelect = document.getElementById('selection'); Anthony = [];Ocala = [];Belleview = [];Dunnellon = [];Silver_Springs = [];Fort_Mccoy = [];Summerfield = [];Lowell = [];Mcintosh = [];Citra = [];Reddick = [];Sparr = [];Weirsdale = [];mySelect.options[mySelect.options.length] = new Option("Anthony schools",'all=Anthony'); mySelect.options[mySelect.options.length] = new Option("Belleview schools",'all=Belleview'); mySelect.options[mySelect.options.length] = new Option("Citra schools",'all=Citra'); mySelect.options[mySelect.options.length] = new Option("Dunnellon schools",'all=Dunnellon'); mySelect.options[mySelect.options.length] = new Option("Fort Mccoy schools",'all=Fort_Mccoy'); mySelect.options[mySelect.options.length] = new Option("Lowell schools",'all=Lowell'); mySelect.options[mySelect.options.length] = new Option("Mcintosh schools",'all=Mcintosh'); mySelect.options[mySelect.options.length] = new Option("Ocala schools",'all=Ocala'); mySelect.options[mySelect.options.length] = new Option("Reddick schools",'all=Reddick'); mySelect.options[mySelect.options.length] = new Option("Silver Springs schools",'all=Silver_Springs'); mySelect.options[mySelect.options.length] = new Option("Sparr schools",'all=Sparr'); mySelect.options[mySelect.options.length] = new Option("Summerfield schools",'all=Summerfield'); mySelect.options[mySelect.options.length] = new Option("Weirsdale schools",'all=Weirsdale'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Anthony[Anthony.length] = createMarker(new GPoint(-82.11160278,29.28945732),"
Anthony Elementary School
9501 Ne Jacksonville Road
Anthony, FL 32617

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Anthony Elementary School",'Anthony=' + Anthony.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.14019775,29.18689919),"
Arc Idea Part H Birth-3 Elementary School
P. O. Box 670
Ocala, FL 34478

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arc Idea Part H Birth-3 Elementary School",'Ocala=' + Ocala.length); Belleview[Belleview.length] = createMarker(new GPoint(-82.05577850,29.05492973),"
Belleview Elementary School
5556 Se Cnty Highway 484
Belleview, FL 34420

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Belleview Elementary School",'Belleview=' + Belleview.length); Belleview[Belleview.length] = createMarker(new GPoint(-82.08685303,29.07390404),"
Belleview High School
10400 Se 36th Avenue
Belleview, FL 34420

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Belleview High School",'Belleview=' + Belleview.length); Belleview[Belleview.length] = createMarker(new GPoint(-82.08685303,29.07301521),"
Belleview Middle School
10500 Se 36th Ave
Belleview, FL 34420

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Belleview Middle School",'Belleview=' + Belleview.length); Belleview[Belleview.length] = createMarker(new GPoint(-81.99484253,29.04907036),"
Belleview-santos Elementary School
9600 S Us Highway 441
Belleview, FL 34420

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Belleview-santos Elementary School",'Belleview=' + Belleview.length); Belleview[Belleview.length] = createMarker(new GPoint(-82.08685303,29.07390404),"
Cfcc Academy
10400 Se 36th Avenue
Belleview, FL 34420

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cfcc Academy",'Belleview=' + Belleview.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.17723083,29.17501831),"
College Park Elementary School
1330 Sw 33rd Ave
Ocala, FL 34474

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("College Park Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.14730072,29.17856026),"
Community Technical & Adult Education Center
1014 Sw 7th Rd
Ocala, FL 34474

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Community Technical & Adult Education Center",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.15665436,29.18236351),"
Dr. N.h. Jones Elementary School
1900 Sw 5th Street
Ocala, FL 34474

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dr. N.h. Jones Elementary School",'Ocala=' + Ocala.length); Dunnellon[Dunnellon.length] = createMarker(new GPoint(-82.41923523,29.07465553),"
Dunnellon Elementary School
10235 Sw 180th Avenue Rd
Dunnellon, FL 34432

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dunnellon Elementary School",'Dunnellon=' + Dunnellon.length); Dunnellon[Dunnellon.length] = createMarker(new GPoint(-82.41921997,29.07884979),"
Dunnellon High School
10055 Sw 180th Avenue Rd
Dunnellon, FL 34432

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dunnellon High School",'Dunnellon=' + Dunnellon.length); Dunnellon[Dunnellon.length] = createMarker(new GPoint(-82.46710100,29.05127800),"
Dunnellon Middle School
21005 Chestnut Street
Dunnellon, FL 34432

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Dunnellon Middle School",'Dunnellon=' + Dunnellon.length); Silver_Springs[Silver_Springs.length] = createMarker(new GPoint(-81.91179657,29.20106316),"
East Marion Elementary School
14550 Ne 14th Street Rd
Silver Springs, FL 34488

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Marion Elementary School",'Silver_Springs=' + Silver_Springs.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.13240051,29.18053627),"
Eighth Street Elementary School
513 Se 8th Street
Ocala, FL 34471

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eighth Street Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.00483704,29.08308411),"
Emerald Shores Elementary School
404 Emerald Road
Ocala, FL 34472

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Emerald Shores Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.14256287,29.22766495),"
Evergreen Elementary School
4000 W Anthony Road
Ocala, FL 34475

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Evergreen Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.18888855,29.28066254),"
Fessenden Elementary School
4200 Nw 89th Place
Ocala, FL 34482

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fessenden Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.11619568,29.18516350),"
Forest High School
5000 Se Maricamp Rd
Ocala, FL 34480

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Forest High School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.11540985,29.19206810),"
Fort King Middle School
545 Ne 17th Avenue
Ocala, FL 34470

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fort King Middle School",'Ocala=' + Ocala.length); Fort_Mccoy[Fort_Mccoy.length] = createMarker(new GPoint(-81.85569763,29.37199974),"
Fort Mccoy School
P. O. Box 2100
Fort Mccoy, FL 32134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fort Mccoy School",'Fort_Mccoy=' + Fort_Mccoy.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.14019775,29.18689919),"
Future Leaders Academy For Arts And Science
P. O. Box 4995
Ocala, FL 34478

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Future Leaders Academy For Arts And Science",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.01550293,29.11993790),"
Greenway Elementary School
207 Midway Road
Ocala, FL 34472

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greenway Elementary School",'Ocala=' + Ocala.length); Summerfield[Summerfield.length] = createMarker(new GPoint(-82.01285553,29.00773621),"
Harbour View Elementary School
8445 Se 147th Place
Summerfield, FL 34491

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Harbour View Elementary School",'Summerfield=' + Summerfield.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.09363556,29.17163658),"
Hillcrest
3143 Se 17th Street
Ocala, FL 34471

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hillcrest",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.13951874,29.18702126),"
Howard Middle School
1108 Nw Martin Luther King Jr
Ocala, FL 34475

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Howard Middle School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.10937200,29.22297700),"
Infinity School/marion County Elementary School
2091 Ne 35th Street
Ocala, FL 34479

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Infinity School/marion County Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.22595600,29.10154100),"
Kingsbury Academy
5895 Se 83rd Street
Ocala, FL 34472

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kingsbury Academy",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-81.98065948,29.07732391),"
Lake Weir High School
10351 Se Maricamp Road
Ocala, FL 34472

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lake Weir High School",'Ocala=' + Ocala.length); Summerfield[Summerfield.length] = createMarker(new GPoint(-81.98335266,28.99852371),"
Lake Weir Middle School
10220 Se Sunset Harbor Rd
Summerfield, FL 34491

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lake Weir Middle School",'Summerfield=' + Summerfield.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.14939880,29.18993759),"
Madison Street Academy Of Visual And Performing Ar
401 Nw Martin Luther King Jr A
Ocala, FL 34475

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Madison Street Academy Of Visual And Performing Ar",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.06984711,29.16403770),"
Maplewood Elementary School
4751 Se 24th Street
Ocala, FL 34471

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Maplewood Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.08357239,29.14223671),"
Marion Charter School
3839 Se 45th Place
Ocala, FL 34480

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Marion Charter School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.10907745,29.22313690),"
Marion County Jail
700 Nw 30th Avenue
Ocala, FL 34475

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marion County Jail",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.13236237,29.18386269),"
Marion County Prek Program
512 S.e. 3rd Street
Ocala, FL 34478

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marion County Prek Program",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.14037900,29.18752000),"
Marion County Superintendent's Office
2p.o. Box 670
Ocala, FL 34478

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marion County Superintendent's Office",'Ocala=' + Ocala.length); Lowell[Lowell.length] = createMarker(new GPoint(-82.20501709,29.38146019),"
Marion Juvenile Correction
P.o. Box 6
Lowell, FL 32663

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marion Juvenile Correction",'Lowell=' + Lowell.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.17283630,29.19706345),"
Marion Reg. Juvenile Detention Center
3040 Nw 10th Street
Ocala, FL 34475

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marion Reg. Juvenile Detention Center",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.11630400,29.18536600),"
Marion Technical Institute
1614 Se Ft. King Street
Ocala, FL 34471

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marion Technical Institute",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.10907745,29.22313690),"
Marion Youth Development Center
4055 Nw 105th Street
Ocala, FL 34482

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marion Youth Development Center",'Ocala=' + Ocala.length); Mcintosh[Mcintosh.length] = createMarker(new GPoint(-82.28109741,29.37929916),"
Mcintosh Area Charter School
P O Box 769
Mcintosh, FL 32664

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mcintosh Area Charter School",'Mcintosh=' + Mcintosh.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.14019775,29.18689919),"
Mrmc Speech/language Elementary School
P. O. Box 670
Ocala, FL 34478

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mrmc Speech/language Elementary School",'Ocala=' + Ocala.length); Citra[Citra.length] = createMarker(new GPoint(-82.13946533,29.33839798),"
North Marion High School
151 W Hwy 329
Citra, FL 32113

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Marion High School",'Citra=' + Citra.length); Citra[Citra.length] = createMarker(new GPoint(-82.10965729,29.41183090),"
North Marion Middle School
2085 W Hwy 329
Citra, FL 32113

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("North Marion Middle School",'Citra=' + Citra.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.12348938,29.21516228),"
Oakcrest Elementary School
1112 Ne 28th Street
Ocala, FL 34470

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakcrest Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.08312988,29.24700165),"
Ocala Springs Elementary School
5757 Ne 40th Avenue Road
Ocala, FL 34479

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ocala Springs Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.13215637,29.18232346),"
Osceola Middle School
526 Se Tuscawilla Avenue
Ocala, FL 34471

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Osceola Middle School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.10314178,29.20293808),"
Pace Center For Girls, Inc.
1601 Ne 25th Ave 302
Ocala, FL 34470

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pace Center For Girls, Inc.",'Ocala=' + Ocala.length); Reddick[Reddick.length] = createMarker(new GPoint(-82.20314026,29.36703682),"
Reddick-collier Elementary School
4595 W Highway 316
Reddick, FL 32686

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Reddick-collier Elementary School",'Reddick=' + Reddick.length); Dunnellon[Dunnellon.length] = createMarker(new GPoint(-82.44625854,29.15306282),"
Romeo Elementary School
19550 Sw 36th Street
Dunnellon, FL 34431

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Romeo Elementary School",'Dunnellon=' + Dunnellon.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.19408417,29.15073395),"
Saddlewood Elementary School
3700 Sw 43rd Court
Ocala, FL 34474

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Saddlewood Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.13606262,29.12768173),"
Shady Hill Elementary School
5959 S Magnolia Avenue
Ocala, FL 34474

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shady Hill Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.10723877,29.20160484),"
Silver River Marine Institute
2500 Se 44th Court
Ocala, FL 34471

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Silver River Marine Institute",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.12197876,29.16047859),"
South Ocala Elementary School
2831 Se Lake Weir Avenue
Ocala, FL 34471

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Ocala Elementary School",'Ocala=' + Ocala.length); Sparr[Sparr.length] = createMarker(new GPoint(-82.11270142,29.33830070),"
Sparr Elementary School
P.o. Box 539
Sparr, FL 32192

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sparr Elementary School",'Sparr=' + Sparr.length); Weirsdale[Weirsdale.length] = createMarker(new GPoint(-81.92967987,28.97903633),"
Stanton-weirsdale Elementary School
16700 Se 134th Terrace
Weirsdale, FL 32195

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stanton-weirsdale Elementary School",'Weirsdale=' + Weirsdale.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.10907745,29.22313690),"
Storefront High School
2091 Ne 35th Street
Ocala, FL 34479

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Storefront High School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.13236237,29.18386269),"
Student Services/ese
P O Box 670
Ocala, FL 34478

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Student Services/ese",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.19784546,29.00605774),"
Sunrise Elementary School
375 Marion Oaks Course
Ocala, FL 34473

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunrise Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.13637543,29.21543694),"
Vanguard High School
7 Nw 28th Street
Ocala, FL 34475

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Vanguard High School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.08671570,29.18185616),"
Ward-highlands Elementary School
537 Se 36th Avenue
Ocala, FL 34471

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ward-highlands Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.25173950,29.15088844),"
West Port High School
3733 Sw 80th Avenue
Ocala, FL 34481

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Port High School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.25173950,29.15088844),"
West Port Middle School
3733 Sw 80th Avenue
Ocala, FL 34481

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("West Port Middle School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.12351990,29.19189262),"
Wyomina Park Elementary School
511 Ne 12th Avenue
Ocala, FL 34470

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wyomina Park Elementary School",'Ocala=' + Ocala.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(Anthony); map.removeOverlays(Belleview); map.removeOverlays(Citra); map.removeOverlays(Dunnellon); map.removeOverlays(Fort_Mccoy); map.removeOverlays(Lowell); map.removeOverlays(Mcintosh); map.removeOverlays(Ocala); map.removeOverlays(Reddick); map.removeOverlays(Silver_Springs); map.removeOverlays(Sparr); map.removeOverlays(Summerfield); map.removeOverlays(Weirsdale); 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(Anthony);map.removeOverlays(Anthony); map.removeOverlays(Belleview); map.removeOverlays(Citra); map.removeOverlays(Dunnellon); map.removeOverlays(Fort_Mccoy); map.removeOverlays(Lowell); map.removeOverlays(Mcintosh); map.removeOverlays(Ocala); map.removeOverlays(Reddick); map.removeOverlays(Silver_Springs); map.removeOverlays(Sparr); map.removeOverlays(Summerfield); map.removeOverlays(Weirsdale); map.addOverlays(Anthony); centerByArray(Anthony, false, false); cntMarker += Anthony.length; map.addOverlays(Belleview); centerByArray(Belleview, false, false); cntMarker += Belleview.length; map.addOverlays(Citra); centerByArray(Citra, false, false); cntMarker += Citra.length; map.addOverlays(Dunnellon); centerByArray(Dunnellon, false, false); cntMarker += Dunnellon.length; map.addOverlays(Fort_Mccoy); centerByArray(Fort_Mccoy, false, false); cntMarker += Fort_Mccoy.length; map.addOverlays(Lowell); centerByArray(Lowell, false, false); cntMarker += Lowell.length; map.addOverlays(Mcintosh); centerByArray(Mcintosh, false, false); cntMarker += Mcintosh.length; map.addOverlays(Ocala); centerByArray(Ocala, false, false); cntMarker += Ocala.length; map.addOverlays(Reddick); centerByArray(Reddick, false, false); cntMarker += Reddick.length; map.addOverlays(Silver_Springs); centerByArray(Silver_Springs, false, false); cntMarker += Silver_Springs.length; map.addOverlays(Sparr); centerByArray(Sparr, false, false); cntMarker += Sparr.length; map.addOverlays(Summerfield); centerByArray(Summerfield, false, false); cntMarker += Summerfield.length; map.addOverlays(Weirsdale); centerByArray(Weirsdale, false, false); cntMarker += Weirsdale.length; centerByArray(Anthony,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'); } }