function addMarkers() { mySelect = document.getElementById('selection'); Aldie = [];Sterling = [];Ashburn = [];Leesburg = [];Middleburg = [];Purcellville = [];South_Riding = [];Hamilton = [];Lovettsville = [];Ashburg = [];Potomac_Falls = [];Round_Hill = [];Waterford = [];mySelect.options[mySelect.options.length] = new Option("Aldie schools",'all=Aldie'); mySelect.options[mySelect.options.length] = new Option("Ashburg schools",'all=Ashburg'); mySelect.options[mySelect.options.length] = new Option("Ashburn schools",'all=Ashburn'); mySelect.options[mySelect.options.length] = new Option("Hamilton schools",'all=Hamilton'); mySelect.options[mySelect.options.length] = new Option("Leesburg schools",'all=Leesburg'); mySelect.options[mySelect.options.length] = new Option("Lovettsville schools",'all=Lovettsville'); mySelect.options[mySelect.options.length] = new Option("Middleburg schools",'all=Middleburg'); mySelect.options[mySelect.options.length] = new Option("Potomac Falls schools",'all=Potomac_Falls'); mySelect.options[mySelect.options.length] = new Option("Purcellville schools",'all=Purcellville'); mySelect.options[mySelect.options.length] = new Option("Round Hill schools",'all=Round_Hill'); mySelect.options[mySelect.options.length] = new Option("South Riding schools",'all=South_Riding'); mySelect.options[mySelect.options.length] = new Option("Sterling schools",'all=Sterling'); mySelect.options[mySelect.options.length] = new Option("Waterford schools",'all=Waterford'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Aldie[Aldie.length] = createMarker(new GPoint(-77.64361572,38.97438812),"
Aldie Elementary School
23269 Meetinghouse Ln
Aldie, VA 20105

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Aldie Elementary School",'Aldie=' + Aldie.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.41118622,39.05612183),"
Algonkian Elementary School
20196 Carter Court
Sterling, VA 20165

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Algonkian Elementary School",'Sterling=' + Sterling.length); Aldie[Aldie.length] = createMarker(new GPoint(-77.56337738,38.94360352),"
Arcola Elementary School
24328 Goshen Rd
Aldie, VA 20105

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arcola Elementary School",'Aldie=' + Aldie.length); Ashburn[Ashburn.length] = createMarker(new GPoint(-77.47640991,39.05075836),"
Ashburn Elementary School
44062 Fincastle Dr
Ashburn, VA 20147

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ashburn Elementary School",'Ashburn=' + Ashburn.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.53388214,39.12321472),"
Ball's Bluff Elementary School
0821 Battlefield Pkwy Ne
Leesburg, VA 20176

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ball's Bluff Elementary School",'Leesburg=' + Leesburg.length); Middleburg[Middleburg.length] = createMarker(new GPoint(-77.78755188,39.00405502),"
Banneker Elementary School
35231 Snake Hill Rd
Middleburg, VA 20117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Banneker Elementary School",'Middleburg=' + Middleburg.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.51682281,39.09896088),"
Belmont Ridge Middle School
19045 Upper Belmont Place
Leesburg, VA 20176

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Belmont Ridge Middle School",'Leesburg=' + Leesburg.length); Ashburn[Ashburn.length] = createMarker(new GPoint(-77.51185400,39.05779400),"
Belmont Station Elementary School
20235 Nightwatch St.
Ashburn, VA 20147

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Belmont Station Elementary School",'Ashburn=' + Ashburn.length); Purcellville[Purcellville.length] = createMarker(new GPoint(-77.70499420,39.12722778),"
Blue Ridge Middle School
551 East A St
Purcellville, VA 20132

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Blue Ridge Middle School",'Purcellville=' + Purcellville.length); Ashburn[Ashburn.length] = createMarker(new GPoint(-77.53430900,38.99383100),"
Briar Woods High School
22525 Belmont Ridge Road
Ashburn, VA 20148

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Briar Woods High School",'Ashburn=' + Ashburn.length); Ashburn[Ashburn.length] = createMarker(new GPoint(-77.49161530,39.02386093),"
Broad Run High School
21670 Ashburn Rd
Ashburn, VA 20147

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Broad Run High School",'Ashburn=' + Ashburn.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.58224487,39.11601257),"
C S Monroe Technology Center
715 Childrens Ctr Rd Sw
Leesburg, VA 20175

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("C S Monroe Technology Center",'Leesburg=' + Leesburg.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.57527924,39.10963440),"
Catoctin Elementary School
311 Catoctin Circle Sw
Leesburg, VA 20175

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Catoctin Elementary School",'Leesburg=' + Leesburg.length); Ashburn[Ashburn.length] = createMarker(new GPoint(-77.49018097,39.03780365),"
Cedar Lane Elementary School
43700 Tolamac Dr
Ashburn, VA 20147

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cedar Lane Elementary School",'Ashburn=' + Ashburn.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.54762268,39.09100342),"
Cool Spring Elementary School
501 Tavistock Dr Se
Leesburg, VA 20175

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cool Spring Elementary School",'Leesburg=' + Leesburg.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.41216278,39.04341888),"
Countryside Elementary School
20624 Countryside Blvd.
Sterling, VA 20165

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Countryside Elementary School",'Sterling=' + Sterling.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.41230011,39.04301834),"
Dominion High School
21326 Augusta Dr.
Sterling, VA 20164

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dominion High School",'Sterling=' + Sterling.length); Ashburn[Ashburn.length] = createMarker(new GPoint(-77.47777557,39.03644943),"
Dominion Trail Elementary School
44045 Bruceton Mills Circle
Ashburn, VA 20147

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dominion Trail Elementary School",'Ashburn=' + Ashburn.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.55528259,39.11036682),"
Douglass School
407 E. Market St.
Leesburg, VA 20176

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Douglass School",'Leesburg=' + Leesburg.length); Ashburn[Ashburn.length] = createMarker(new GPoint(-77.51875305,39.01641464),"
Eagle Ridge Middle School
42901 Waxpool Rd
Ashburn, VA 20148

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Eagle Ridge Middle School",'Ashburn=' + Ashburn.length); Purcellville[Purcellville.length] = createMarker(new GPoint(-77.71892548,39.13124847),"
Emerick Elementary School
440 S Nursery Ave
Purcellville, VA 20132

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Emerick Elementary School",'Purcellville=' + Purcellville.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.57151031,39.08970642),"
Evergreen Mill Elementary School
491 Evergreen Mill Rd Se
Leesburg, VA 20175

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Evergreen Mill Elementary School",'Leesburg=' + Leesburg.length); Ashburn[Ashburn.length] = createMarker(new GPoint(-77.47164917,39.03780746),"
Farmwell Station Middle School
44281 Gloucester Pkwy
Ashburn, VA 20147

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Farmwell Station Middle School",'Ashburn=' + Ashburn.length); Sterling[Sterling.length] = createMarker(new GPoint(-105.49540710,44.29695511),"
Forest Grove Elementary School
46245 Forest Ridge Dr.
Sterling, VA 20164

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Forest Grove Elementary School",'Sterling=' + Sterling.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.51682281,39.09896088),"
Frances Hazel Reid Elementary School
800 N. King St.
Leesburg, VA 20176

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Frances Hazel Reid Elementary School",'Leesburg=' + Leesburg.length); South_Riding[South_Riding.length] = createMarker(new GPoint(-77.53503200,38.91388500),"
Freedom High School
25450 Riding Center Drive
South Riding, VA 20152

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Freedom High School",'South_Riding=' + South_Riding.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.41754913,39.00128937),"
Guilford Elementary School
600 W Poplar Rd
Sterling, VA 20164

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Guilford Elementary School",'Sterling=' + Sterling.length); Hamilton[Hamilton.length] = createMarker(new GPoint(-77.66192627,39.13321304),"
Hamilton Elementary School
54 S Kerr St
Hamilton, VA 20158

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hamilton Elementary School",'Hamilton=' + Hamilton.length); Hamilton[Hamilton.length] = createMarker(new GPoint(-77.68266296,39.13614273),"
Harmony Intermediate
38174 W. Colonial Hwy.
Hamilton, VA 20158

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Harmony Intermediate",'Hamilton=' + Hamilton.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.52091980,39.09584045),"
Harper Park Middle School
701 Potomac Station Dr Ne
Leesburg, VA 20176

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Harper Park Middle School",'Leesburg=' + Leesburg.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.57134247,39.08879471),"
Heritage High School
520 Evergreen Mill Rd. Se
Leesburg, VA 20175

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage High School",'Leesburg=' + Leesburg.length); Purcellville[Purcellville.length] = createMarker(new GPoint(-77.71956635,39.19807816),"
Hillsboro Elementary School
37110 Charles Town Pike
Purcellville, VA 20132

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hillsboro Elementary School",'Purcellville=' + Purcellville.length); Ashburn[Ashburn.length] = createMarker(new GPoint(-77.51308441,39.02000046),"
Hillside Elementary School
43000 Ellzey Dr
Ashburn, VA 20148

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hillside Elementary School",'Ashburn=' + Ashburn.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.38502502,39.04624557),"
Horizon Elementary School
46665 Broadmore Dr
Sterling, VA 20165

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Horizon Elementary School",'Sterling=' + Sterling.length); South_Riding[South_Riding.length] = createMarker(new GPoint(-77.52156067,38.91436386),"
Hutchison Farms Elementary School
42819 Center St.
South Riding, VA 20152

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hutchison Farms Elementary School",'South_Riding=' + South_Riding.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.57115936,39.08968353),"
J. Lupton Simpson Middle School
490 Evergreen Mill Rd Se
Leesburg, VA 20175

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("J. Lupton Simpson Middle School",'Leesburg=' + Leesburg.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.52107239,39.09593201),"
John W. Tolbert, Junior Elementary School
691 Potomac Station Dr Ne
Leesburg, VA 20176

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John W. Tolbert, Junior Elementary School",'Leesburg=' + Leesburg.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.54759216,39.12062836),"
Leesburg Elementary School
323 Plaza St Ne
Leesburg, VA 20176

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Leesburg Elementary School",'Leesburg=' + Leesburg.length); Ashburn[Ashburn.length] = createMarker(new GPoint(-77.52458900,38.98052900),"
Legacy Elementary School
22995 Minerva Drive
Ashburn, VA 20148

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Legacy Elementary School",'Ashburn=' + Ashburn.length); Purcellville[Purcellville.length] = createMarker(new GPoint(-77.69692230,39.11827469),"
Lincoln Elementary School
18048 Lincoln Rd
Purcellville, VA 20132

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Purcellville=' + Purcellville.length); South_Riding[South_Riding.length] = createMarker(new GPoint(-77.49866486,38.89773560),"
Little River Elementary School
43464 Hyland Hills St
South Riding, VA 20152

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Little River Elementary School",'South_Riding=' + South_Riding.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.54748700,39.07608200),"
Loudoun Co. Juvenile Detention Home
42020 Loudoun Center Place
Leesburg, VA 20175

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Loudoun Co. Juvenile Detention Home",'Leesburg=' + Leesburg.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.57841492,39.11063385),"
Loudoun County High School
415 Dry Mill Rd Sw
Leesburg, VA 20175

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Loudoun County High School",'Leesburg=' + Leesburg.length); Purcellville[Purcellville.length] = createMarker(new GPoint(-77.70209503,39.14137268),"
Loudoun Valley High School
340 N Maple Ave
Purcellville, VA 20132

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Loudoun Valley High School",'Purcellville=' + Purcellville.length); Lovettsville[Lovettsville.length] = createMarker(new GPoint(-77.64096069,39.26573181),"
Lovettsville Elementary School
49 S Loudoun St
Lovettsville, VA 20180

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lovettsville Elementary School",'Lovettsville=' + Lovettsville.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.34884644,39.04081345),"
Lowes Island Elementary School
20755 Whitewater Dr
Sterling, VA 20165

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lowes Island Elementary School",'Sterling=' + Sterling.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.53511810,39.21283340),"
Lucketts Elementary School
14550 James Monroe Hwy
Leesburg, VA 20176

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lucketts Elementary School",'Leesburg=' + Leesburg.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.36985779,39.03518677),"
Meadowland Elementary School
729 S Sugarland Run Dr
Sterling, VA 20164

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Meadowland Elementary School",'Sterling=' + Sterling.length); Aldie[Aldie.length] = createMarker(new GPoint(-77.54689100,38.92530500),"
Mercer Middle School
42149 Greenstone Dr.
Aldie, VA 20105

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mercer Middle School",'Aldie=' + Aldie.length); Middleburg[Middleburg.length] = createMarker(new GPoint(-77.72260284,39.00389862),"
Middleburg Elementary School
Po Box 25
Middleburg, VA 20117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Middleburg Elementary School",'Middleburg=' + Middleburg.length); Ashburn[Ashburn.length] = createMarker(new GPoint(-77.51871490,39.01649475),"
Mill Run Elementary School
42905 Waxpool Rd
Ashburn, VA 20148

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mill Run Elementary School",'Ashburn=' + Ashburn.length); Purcellville[Purcellville.length] = createMarker(new GPoint(-76.57450104,39.05472183),"
Mountain View Elementary School
36803 Allder School Rd.
Purcellville, VA 21032

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mountain View Elementary School",'Purcellville=' + Purcellville.length); Ashburg[Ashburg.length] = createMarker(new GPoint(-77.47287600,39.03692300),"
Newton-lee Elementary School
43335 Gloucester Parkway
Ashburg, VA 20147

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Newton-lee Elementary School",'Ashburg=' + Ashburg.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.39901733,39.01347351),"
Park View High School
400 W Laurel Ave
Sterling, VA 20164

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Park View High School",'Sterling=' + Sterling.length); Aldie[Aldie.length] = createMarker(new GPoint(-10.00000000,10.00000000),"
Pinebrook Elementary School
25480 Mindful Court
Aldie, VA 20105

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pinebrook Elementary School",'Aldie=' + Aldie.length); Potomac_Falls[Potomac_Falls.length] = createMarker(new GPoint(-77.39070129,39.05011749),"
Potomac Falls High School
46400 Algonkian Pkwy
Potomac Falls, VA 20165

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Potomac Falls High School",'Potomac_Falls=' + Potomac_Falls.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.39541626,39.03874588),"
Potowmack Elementary School
46465 Esterbrook Pkwy
Sterling, VA 20165

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Potowmack Elementary School",'Sterling=' + Sterling.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.39294434,39.04994202),"
River Bend Middle School
46240 Algonkian Pkwy.
Sterling, VA 20165

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("River Bend Middle School",'Sterling=' + Sterling.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.38535309,39.01452637),"
Rolling Ridge Elementary School
500 E Frederick Dr
Sterling, VA 20164

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rolling Ridge Elementary School",'Sterling=' + Sterling.length); Round_Hill[Round_Hill.length] = createMarker(new GPoint(-77.76442719,39.14555359),"
Round Hill Elementary School
17115 Evening Star Dr
Round Hill, VA 20141

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Round Hill Elementary School",'Round_Hill=' + Round_Hill.length); Ashburn[Ashburn.length] = createMarker(new GPoint(-77.51030731,39.03697968),"
Sanders Corner Elementary School
43100 Ashburn Farm Pkwy
Ashburn, VA 20147

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sanders Corner Elementary School",'Ashburn=' + Ashburn.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-77.49897766,39.08386612),"
Seldens Landing Elementary School
43345 Coton Commons Dr.
Leesburg, VA 20176

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Seldens Landing Elementary School",'Leesburg=' + Leesburg.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.37189484,39.02945709),"
Seneca Ridge Middle School
98 Seneca Ridge Dr
Sterling, VA 20164

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Seneca Ridge Middle School",'Sterling=' + Sterling.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-91.88776300,45.84026900),"
Smart's Mill Middle School
0850 N. King St.
Leesburg, VA 20176

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Smart's Mill Middle School",'Leesburg=' + Leesburg.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.40172577,39.00848007),"
Sterling Elementary School
200 W Church Rd
Sterling, VA 20164

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sterling Elementary School",'Sterling=' + Sterling.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.40456390,39.00249481),"
Sterling Middle School
201 W Holly Ave
Sterling, VA 20164

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sterling Middle School",'Sterling=' + Sterling.length); Ashburn[Ashburn.length] = createMarker(new GPoint(-77.51030731,39.04653549),"
Stone Bridge High School
43100 Hay Road
Ashburn, VA 20147

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Stone Bridge High School",'Ashburn=' + Ashburn.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.38327789,39.03758621),"
Sugarland Elementary School
65 Sugarland Run Dr
Sterling, VA 20164

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sugarland Elementary School",'Sterling=' + Sterling.length); Sterling[Sterling.length] = createMarker(new GPoint(-77.40058899,38.99608231),"
Sully Elementary School
300 Circle Dr
Sterling, VA 20164

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sully Elementary School",'Sterling=' + Sterling.length); Waterford[Waterford.length] = createMarker(new GPoint(-77.60669708,39.18653870),"
Waterford Elementary School
15513 Loyalty Rd
Waterford, VA 20197

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Waterford Elementary School",'Waterford=' + Waterford.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(Aldie); map.removeOverlays(Ashburg); map.removeOverlays(Ashburn); map.removeOverlays(Hamilton); map.removeOverlays(Leesburg); map.removeOverlays(Lovettsville); map.removeOverlays(Middleburg); map.removeOverlays(Potomac_Falls); map.removeOverlays(Purcellville); map.removeOverlays(Round_Hill); map.removeOverlays(South_Riding); map.removeOverlays(Sterling); map.removeOverlays(Waterford); 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(Aldie);map.removeOverlays(Aldie); map.removeOverlays(Ashburg); map.removeOverlays(Ashburn); map.removeOverlays(Hamilton); map.removeOverlays(Leesburg); map.removeOverlays(Lovettsville); map.removeOverlays(Middleburg); map.removeOverlays(Potomac_Falls); map.removeOverlays(Purcellville); map.removeOverlays(Round_Hill); map.removeOverlays(South_Riding); map.removeOverlays(Sterling); map.removeOverlays(Waterford); map.addOverlays(Aldie); centerByArray(Aldie, false, false); cntMarker += Aldie.length; map.addOverlays(Ashburg); centerByArray(Ashburg, false, false); cntMarker += Ashburg.length; map.addOverlays(Ashburn); centerByArray(Ashburn, false, false); cntMarker += Ashburn.length; map.addOverlays(Hamilton); centerByArray(Hamilton, false, false); cntMarker += Hamilton.length; map.addOverlays(Leesburg); centerByArray(Leesburg, false, false); cntMarker += Leesburg.length; map.addOverlays(Lovettsville); centerByArray(Lovettsville, false, false); cntMarker += Lovettsville.length; map.addOverlays(Middleburg); centerByArray(Middleburg, false, false); cntMarker += Middleburg.length; map.addOverlays(Potomac_Falls); centerByArray(Potomac_Falls, false, false); cntMarker += Potomac_Falls.length; map.addOverlays(Purcellville); centerByArray(Purcellville, false, false); cntMarker += Purcellville.length; map.addOverlays(Round_Hill); centerByArray(Round_Hill, false, false); cntMarker += Round_Hill.length; map.addOverlays(South_Riding); centerByArray(South_Riding, false, false); cntMarker += South_Riding.length; map.addOverlays(Sterling); centerByArray(Sterling, false, false); cntMarker += Sterling.length; map.addOverlays(Waterford); centerByArray(Waterford, false, false); cntMarker += Waterford.length; centerByArray(Aldie,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'); } }