function addMarkers() { mySelect = document.getElementById('selection'); Ellicott_City = [];Columbia = [];Jessup = [];Glenwood = [];Fulton = [];Clarksville = [];Elkridge = [];Glenelg = [];Woodbine = [];Marriottsville = [];Mount_Airy = [];West_Friendship = [];mySelect.options[mySelect.options.length] = new Option("Clarksville schools",'all=Clarksville'); mySelect.options[mySelect.options.length] = new Option("Columbia schools",'all=Columbia'); mySelect.options[mySelect.options.length] = new Option("Elkridge schools",'all=Elkridge'); mySelect.options[mySelect.options.length] = new Option("Ellicott City schools",'all=Ellicott_City'); mySelect.options[mySelect.options.length] = new Option("Fulton schools",'all=Fulton'); mySelect.options[mySelect.options.length] = new Option("Glenelg schools",'all=Glenelg'); mySelect.options[mySelect.options.length] = new Option("Glenwood schools",'all=Glenwood'); mySelect.options[mySelect.options.length] = new Option("Jessup schools",'all=Jessup'); mySelect.options[mySelect.options.length] = new Option("Marriottsville schools",'all=Marriottsville'); mySelect.options[mySelect.options.length] = new Option("Mount Airy schools",'all=Mount_Airy'); mySelect.options[mySelect.options.length] = new Option("West Friendship schools",'all=West_Friendship'); mySelect.options[mySelect.options.length] = new Option("Woodbine schools",'all=Woodbine'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.79882812,39.26710892),"
Applications And Research Laboratory High School
10920 Route 108
Ellicott City, MD 21042

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Applications And Research Laboratory High School",'Ellicott_City=' + Ellicott_City.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.86256409,39.18647766),"
Atholton Elementary School
6700 Seneca Dr
Columbia, MD 21046

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Atholton Elementary School",'Columbia=' + Columbia.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.88101196,39.19459534),"
Atholton High School
6520 Freetown Rd
Columbia, MD 21044

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Atholton High School",'Columbia=' + Columbia.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.80139923,39.25479889),"
Bellows Spring Elementary School
8125 Old Stockbridge Dr
Ellicott City, MD 21043

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bellows Spring Elementary School",'Ellicott_City=' + Ellicott_City.length); Jessup[Jessup.length] = createMarker(new GPoint(-76.82637787,39.14542389),"
Bollman Bridge Elementary School
8200 Savage-guilford Road
Jessup, MD 20794

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bollman Bridge Elementary School",'Jessup=' + Jessup.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.77156830,39.23566818),"
Bonnie Branch Middle School
4979 Ilchester Rd
Ellicott City, MD 21043

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bonnie Branch Middle School",'Ellicott_City=' + Ellicott_City.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.86634064,39.22197342),"
Bryant Woods Elementary School
5450 Blue Heron Ln
Columbia, MD 21044

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bryant Woods Elementary School",'Columbia=' + Columbia.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.86550140,39.25678253),"
Burleigh Manor Middle School
4200 Centennial Lane
Ellicott City, MD 21042

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Burleigh Manor Middle School",'Ellicott_City=' + Ellicott_City.length); Glenwood[Glenwood.length] = createMarker(new GPoint(-77.02241516,39.29785156),"
Bushy Park Elementary School
2670 Rt 97
Glenwood, MD 21738

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bushy Park Elementary School",'Glenwood=' + Glenwood.length); Fulton[Fulton.length] = createMarker(new GPoint(-76.88690948,39.22309113),"
Cedar Lane Special Center
11630 Scaggsville Rd
Fulton, MD 20759

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cedar Lane Special Center",'Fulton=' + Fulton.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.86719513,39.25302124),"
Centennial High School
4300 Centennial Ln
Ellicott City, MD 21042

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Centennial High School",'Ellicott_City=' + Ellicott_City.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.86199951,39.26461029),"
Centennial Lane Elementary School
3825 Centennial Ln
Ellicott City, MD 21042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Centennial Lane Elementary School",'Ellicott_City=' + Ellicott_City.length); Clarksville[Clarksville.length] = createMarker(new GPoint(-76.92939758,39.21937943),"
Clarksville Elementary School
12041 Route 108
Clarksville, MD 21029

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clarksville Elementary School",'Clarksville=' + Clarksville.length); Clarksville[Clarksville.length] = createMarker(new GPoint(-76.92438507,39.19148254),"
Clarksville Middle School
6535 S Trotter Rd
Clarksville, MD 21029

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Clarksville Middle School",'Clarksville=' + Clarksville.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.87397766,39.19342422),"
Clemens Crossing Elementary School
10320 Quarterstaff Rd
Columbia, MD 21044

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clemens Crossing Elementary School",'Columbia=' + Columbia.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.84386444,39.19229126),"
Dasher Green Elementary School
6700 Cradlerock Way
Columbia, MD 21045

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dasher Green Elementary School",'Columbia=' + Columbia.length); Elkridge[Elkridge.length] = createMarker(new GPoint(-76.78753662,39.18453979),"
Deep Run Elementary School
6925 Old Waterloo Rd
Elkridge, MD 21075

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Deep Run Elementary School",'Elkridge=' + Elkridge.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.82794189,39.25634384),"
Dunloggin Middle School
9129 Northfield Rd
Ellicott City, MD 21042

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Dunloggin Middle School",'Ellicott_City=' + Ellicott_City.length); Elkridge[Elkridge.length] = createMarker(new GPoint(-76.73260498,39.21111298),"
Elkridge Elementary School
7075 Montgomery Rd
Elkridge, MD 21075

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Elkridge Elementary School",'Elkridge=' + Elkridge.length); Elkridge[Elkridge.length] = createMarker(new GPoint(-76.73242187,39.21108627),"
Elkridge Landing Middle School
7085 Montgomery Rd
Elkridge, MD 21075

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Elkridge Landing Middle School",'Elkridge=' + Elkridge.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.81077576,39.24914169),"
Ellicott Mills Middle School
4445 Montgomery Rd
Ellicott City, MD 21043

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ellicott Mills Middle School",'Ellicott_City=' + Ellicott_City.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.86409760,39.27379990),"
Folly Quarter Middle School
13500 Triadelphia Rd
Ellicott City, MD 21042

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Folly Quarter Middle School",'Ellicott_City=' + Ellicott_City.length); Fulton[Fulton.length] = createMarker(new GPoint(-76.91653442,39.15021515),"
Fulton Elementary School
11600 Scaggsville Rd
Fulton, MD 20759

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fulton Elementary School",'Fulton=' + Fulton.length); Glenelg[Glenelg.length] = createMarker(new GPoint(-77.00179291,39.27594376),"
Glenelg High School
14025 Burnt Woods Rd
Glenelg, MD 21737

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Glenelg High School",'Glenelg=' + Glenelg.length); Glenwood[Glenwood.length] = createMarker(new GPoint(-77.02259827,39.29760742),"
Glenwood Middle School
2680 Rt 97
Glenwood, MD 21738

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Glenwood Middle School",'Glenwood=' + Glenwood.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.83066559,39.17064667),"
Guilford Elementary School
7335 Oakland Mills Rd
Columbia, MD 21046

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Guilford Elementary School",'Columbia=' + Columbia.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.85951996,39.16856766),"
Hammond High School
8800 Guilford Rd
Columbia, MD 21046

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hammond High School",'Columbia=' + Columbia.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.88704681,39.22272873),"
Harpers Choice Middle School
5450 Beaverkill Rd
Columbia, MD 21044

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Harpers Choice Middle School",'Columbia=' + Columbia.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.81607056,39.30203247),"
Hollifield Station Elementary School
8701 Stonehouse Dr
Ellicott City, MD 21043

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hollifield Station Elementary School",'Ellicott_City=' + Ellicott_City.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.79882812,39.26710892),"
Homewood School
10914 Route 108
Ellicott City, MD 21042

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Homewood School",'Ellicott_City=' + Ellicott_City.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.83969879,39.24075699),"
Howard High School
8700 Old Annapolis Rd
Ellicott City, MD 21043

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Howard High School",'Ellicott_City=' + Ellicott_City.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.77160645,39.23561096),"
Ilchester Elementary School
4981 Ilchester Rd
Ellicott City, MD 21043

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ilchester Elementary School",'Ellicott_City=' + Ellicott_City.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.82825470,39.20532227),"
Jeffers Hill Elementary School
6000 Tamar Dr
Columbia, MD 21045

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jeffers Hill Elementary School",'Columbia=' + Columbia.length); Fulton[Fulton.length] = createMarker(new GPoint(-76.91680908,39.15025330),"
Lime Kiln Middle School
11650 Scaggsville Rd
Fulton, MD 20759

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lime Kiln Middle School",'Fulton=' + Fulton.length); Woodbine[Woodbine.length] = createMarker(new GPoint(-77.01889801,39.32033920),"
Lisbon Elementary School
15901 Frederick Rd
Woodbine, MD 21797

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lisbon Elementary School",'Woodbine=' + Woodbine.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.81235504,39.20729446),"
Long Reach High School
6101 Old Dobbin Ln
Columbia, MD 21045

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Long Reach High School",'Columbia=' + Columbia.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.88249969,39.22542191),"
Longfellow Elementary School
5470 Hesperus Dr
Columbia, MD 21044

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Longfellow Elementary School",'Columbia=' + Columbia.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.91687775,39.29341125),"
Manor Woods Elementary School
11575 Frederick Rd
Ellicott City, MD 21042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Manor Woods Elementary School",'Ellicott_City=' + Ellicott_City.length); Marriottsville[Marriottsville.length] = createMarker(new GPoint(-76.93363000,39.32820200),"
Marriotts Ridge High School
12100 Woodford Dr
Marriottsville, MD 21104

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marriotts Ridge High School",'Marriottsville=' + Marriottsville.length); Elkridge[Elkridge.length] = createMarker(new GPoint(-76.78531647,39.19580841),"
Mayfield Woods Middle School
7950 Redbarn Way
Elkridge, MD 21075

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mayfield Woods Middle School",'Elkridge=' + Elkridge.length); Mount_Airy[Mount_Airy.length] = createMarker(new GPoint(-77.10423279,39.36791992),"
Mount Airy Middle School
102 Watersville Rd
Mount Airy, MD 21771

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mount Airy Middle School",'Mount_Airy=' + Mount_Airy.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.79882812,39.26710892),"
Mount Hebron High School
9440 Rt 99
Ellicott City, MD 21042

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount Hebron High School",'Ellicott_City=' + Ellicott_City.length); Marriottsville[Marriottsville.length] = createMarker(new GPoint(-76.93500519,39.32003403),"
Mount View Middle School
12101 Woodford Dr
Marriottsville, MD 21104

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mount View Middle School",'Marriottsville=' + Marriottsville.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.82780457,39.25631714),"
Northfield Elementary School
9125 Northfield Rd
Ellicott City, MD 21042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northfield Elementary School",'Ellicott_City=' + Ellicott_City.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.83455658,39.20741653),"
Oakland Mills High School
9410 Kilimanjaro Rd
Columbia, MD 21045

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oakland Mills High School",'Columbia=' + Columbia.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.84627533,39.20595932),"
Oakland Mills Middle School
9540 Kilimanjaro Rd
Columbia, MD 21045

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Oakland Mills Middle School",'Columbia=' + Columbia.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.84386444,39.19229126),"
Owen Brown Middle School
6700 Cradlewrock Way
Columbia, MD 21045

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Owen Brown Middle School",'Columbia=' + Columbia.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.81693268,39.30004120),"
Patapsco Middle School
8885 Old Frederick Rd
Ellicott City, MD 21043

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Patapsco Middle School",'Ellicott_City=' + Ellicott_City.length); Jessup[Jessup.length] = createMarker(new GPoint(-76.82936859,39.14765167),"
Patuxent Valley Middle School
9151 Vollmerhausen Rd
Jessup, MD 20794

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Patuxent Valley Middle School",'Jessup=' + Jessup.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.81703186,39.22304916),"
Phelps Luck Elementary School
5370 Oldstone Ct
Columbia, MD 21045

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Phelps Luck Elementary School",'Columbia=' + Columbia.length); Clarksville[Clarksville.length] = createMarker(new GPoint(-76.92555237,39.18961334),"
Pointers Run Elementary School
6600 Trotter Rd
Clarksville, MD 21029

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pointers Run Elementary School",'Clarksville=' + Clarksville.length); Fulton[Fulton.length] = createMarker(new GPoint(-76.91374969,39.14979172),"
Reservoir High School
11550 Scaggsville Rd
Fulton, MD 20759

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Reservoir High School",'Fulton=' + Fulton.length); Clarksville[Clarksville.length] = createMarker(new GPoint(-76.93105316,39.21772385),"
River Hill High School
12101 Route 108
Clarksville, MD 21029

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("River Hill High School",'Clarksville=' + Clarksville.length); Elkridge[Elkridge.length] = createMarker(new GPoint(-76.76882172,39.21416473),"
Rockburn Elementary School
6145 Montgomery Rd
Elkridge, MD 21075

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rockburn Elementary School",'Elkridge=' + Elkridge.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.85910797,39.22883224),"
Running Brook Elementary School
5215 W Running Brook Rd
Columbia, MD 21044

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Running Brook Elementary School",'Columbia=' + Columbia.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.83193207,39.29021454),"
Saint Johns Lane Elementary School
2960 Saint Johns Ln
Ellicott City, MD 21042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Saint Johns Lane Elementary School",'Ellicott_City=' + Ellicott_City.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.84612274,39.20468521),"
Stevens Forest Elementary School
6045 Stevens Forest Rd
Columbia, MD 21045

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stevens Forest Elementary School",'Columbia=' + Columbia.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.88790131,39.21723557),"
Swansfield Elementary School
5610 Cedar Ln
Columbia, MD 21044

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Swansfield Elementary School",'Columbia=' + Columbia.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.84586334,39.21347427),"
Talbott Springs Elementary School
9550 Basket Ring Rd
Columbia, MD 21045

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Talbott Springs Elementary School",'Columbia=' + Columbia.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.83581543,39.22951889),"
Thunder Hill Elementary School
9357 Mellenbrook Rd
Columbia, MD 21045

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thunder Hill Elementary School",'Columbia=' + Columbia.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.97737122,39.26616287),"
Triadelphia Ridge Elementary School
13400 Triadelphia Rd
Ellicott City, MD 21042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Triadelphia Ridge Elementary School",'Ellicott_City=' + Ellicott_City.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.79679871,39.20743179),"
Waterloo Elementary School
5940 Waterloo Rd
Columbia, MD 21045

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Waterloo Elementary School",'Columbia=' + Columbia.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.86823273,39.30345535),"
Waverly Elementary School
10220 Wetherburn Rd
Ellicott City, MD 21042

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Waverly Elementary School",'Ellicott_City=' + Ellicott_City.length); West_Friendship[West_Friendship.length] = createMarker(new GPoint(-76.94751740,39.30128860),"
West Friendship Elementary School
12500 Frederick Road
West Friendship, MD 21794

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Friendship Elementary School",'West_Friendship=' + West_Friendship.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.87354279,39.21824646),"
Wilde Lake High School
5460 Trumpeter Rd
Columbia, MD 21044

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wilde Lake High School",'Columbia=' + Columbia.length); Columbia[Columbia.length] = createMarker(new GPoint(-76.87582397,39.21990585),"
Wilde Lake Middle School
10481 Cross Fox Ln
Columbia, MD 21044

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Wilde Lake Middle School",'Columbia=' + Columbia.length); Ellicott_City[Ellicott_City.length] = createMarker(new GPoint(-76.79286194,39.24454498),"
Worthington Elementary School
4570 Roundhill Rd
Ellicott City, MD 21043

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Worthington Elementary School",'Ellicott_City=' + Ellicott_City.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(Clarksville); map.removeOverlays(Columbia); map.removeOverlays(Elkridge); map.removeOverlays(Ellicott_City); map.removeOverlays(Fulton); map.removeOverlays(Glenelg); map.removeOverlays(Glenwood); map.removeOverlays(Jessup); map.removeOverlays(Marriottsville); map.removeOverlays(Mount_Airy); map.removeOverlays(West_Friendship); map.removeOverlays(Woodbine); 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(Ellicott_City);map.removeOverlays(Clarksville); map.removeOverlays(Columbia); map.removeOverlays(Elkridge); map.removeOverlays(Ellicott_City); map.removeOverlays(Fulton); map.removeOverlays(Glenelg); map.removeOverlays(Glenwood); map.removeOverlays(Jessup); map.removeOverlays(Marriottsville); map.removeOverlays(Mount_Airy); map.removeOverlays(West_Friendship); map.removeOverlays(Woodbine); map.addOverlays(Clarksville); centerByArray(Clarksville, false, false); cntMarker += Clarksville.length; map.addOverlays(Columbia); centerByArray(Columbia, false, false); cntMarker += Columbia.length; map.addOverlays(Elkridge); centerByArray(Elkridge, false, false); cntMarker += Elkridge.length; map.addOverlays(Ellicott_City); centerByArray(Ellicott_City, false, false); cntMarker += Ellicott_City.length; map.addOverlays(Fulton); centerByArray(Fulton, false, false); cntMarker += Fulton.length; map.addOverlays(Glenelg); centerByArray(Glenelg, false, false); cntMarker += Glenelg.length; map.addOverlays(Glenwood); centerByArray(Glenwood, false, false); cntMarker += Glenwood.length; map.addOverlays(Jessup); centerByArray(Jessup, false, false); cntMarker += Jessup.length; map.addOverlays(Marriottsville); centerByArray(Marriottsville, false, false); cntMarker += Marriottsville.length; map.addOverlays(Mount_Airy); centerByArray(Mount_Airy, false, false); cntMarker += Mount_Airy.length; map.addOverlays(West_Friendship); centerByArray(West_Friendship, false, false); cntMarker += West_Friendship.length; map.addOverlays(Woodbine); centerByArray(Woodbine, false, false); cntMarker += Woodbine.length; centerByArray(Ellicott_City,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'); } }