function addMarkers(){ mySelect = document.getElementById('selection'); Springfield = [];Centreville = [];Alexandria = [];Chantilly = [];Fairfax_Station = [];Vienna = [];Herndon = [];Oakton = [];Baileys_Crossroads = [];Fairfax = [];Mclean = [];Reston = [];Annandale = [];Falls_Church = [];mySelect.options[mySelect.options.length] = new Option("Alexandria schools",'all=Alexandria'); mySelect.options[mySelect.options.length] = new Option("Annandale schools",'all=Annandale'); mySelect.options[mySelect.options.length] = new Option("Baileys Crossroads schools",'all=Baileys_Crossroads'); mySelect.options[mySelect.options.length] = new Option("Centreville schools",'all=Centreville'); mySelect.options[mySelect.options.length] = new Option("Chantilly schools",'all=Chantilly'); mySelect.options[mySelect.options.length] = new Option("Fairfax schools",'all=Fairfax'); mySelect.options[mySelect.options.length] = new Option("Fairfax Station schools",'all=Fairfax_Station'); mySelect.options[mySelect.options.length] = new Option("Falls Church schools",'all=Falls_Church'); mySelect.options[mySelect.options.length] = new Option("Herndon schools",'all=Herndon'); mySelect.options[mySelect.options.length] = new Option("Mclean schools",'all=Mclean'); mySelect.options[mySelect.options.length] = new Option("Oakton schools",'all=Oakton'); mySelect.options[mySelect.options.length] = new Option("Reston schools",'all=Reston'); mySelect.options[mySelect.options.length] = new Option("Springfield schools",'all=Springfield'); mySelect.options[mySelect.options.length] = new Option("Vienna schools",'all=Vienna'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Springfield[Springfield.length] = createMarker(new GPoint(-77.23874800,38.78442900),"
Accotink Academy
8519 Tuttle Road
Springfield, VA 22152
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Accotink Academy",'Springfield=' + Springfield.length); Springfield[Springfield.length] = createMarker(new GPoint(-77.23527400,38.78189700),"
Accotink Alternative
6228 Rolling Road F
Springfield, VA 22152
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Accotink Alternative",'Springfield=' + Springfield.length); Centreville[Centreville.length] = createMarker(new GPoint(-77.48120400,38.82936400),"
Ad Fontes Academy
15450 Lee Highway
Centreville, VA 20120
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ad Fontes Academy",'Centreville=' + Centreville.length); Springfield[Springfield.length] = createMarker(new GPoint(-77.16729900,38.80138400),"
Chesapeake Academy
5533 Industrial Drive
Springfield, VA 22151
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chesapeake Academy",'Springfield=' + Springfield.length); Alexandria[Alexandria.length] = createMarker(new GPoint(-77.12770900,38.78385700),"
Christian Center School
5411 Franconia Road
Alexandria, VA 22310
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Center School",'Alexandria=' + Alexandria.length); Chantilly[Chantilly.length] = createMarker(new GPoint(-77.44068700,38.88259000),"
Different Drum Inc.
4451 Brookfield Corporate Dr.
Chantilly, VA 20151
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Different Drum Inc.",'Chantilly=' + Chantilly.length); Springfield[Springfield.length] = createMarker(new GPoint(-77.21999500,38.80843300),"
The Dominion School
8000 Forbes Place Suite 102
Springfield, VA 22151
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Dominion School",'Springfield=' + Springfield.length); Alexandria[Alexandria.length] = createMarker(new GPoint(-77.12047000,38.72802100),"
Engleside Christian School
8428 Highland Lane
Alexandria, VA 22309
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Engleside Christian School",'Alexandria=' + Alexandria.length); Fairfax_Station[Fairfax_Station.length] = createMarker(new GPoint(-77.30104200,38.77506000),"
Fairfax Baptist Temple Academy
6401 Missionary Ln
Fairfax Station, VA 22039
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fairfax Baptist Temple Academy",'Fairfax_Station=' + Fairfax_Station.length); Vienna[Vienna.length] = createMarker(new GPoint(-77.31180900,38.95158600),"
Fairfax Christian School
1624 Hunter Mill Road
Vienna, VA 22182
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fairfax Christian School",'Vienna=' + Vienna.length); Herndon[Herndon.length] = createMarker(new GPoint(-77.37907000,38.96936600),"
Fairfax Collegiate Summer Program
722 Grant St., Suite J
Herndon, VA 22070
Co-ed school, 4-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fairfax Collegiate Summer Program",'Herndon=' + Herndon.length); Oakton[Oakton.length] = createMarker(new GPoint(-77.31870000,38.87083700),"
Flint Hill School
3320 Jermantown Road
Oakton, VA 22124
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Flint Hill School",'Oakton=' + Oakton.length); Chantilly[Chantilly.length] = createMarker(new GPoint(-77.43494900,38.89403100),"
High Road School Of Northern Virginia
14102 Sullyfield Circle Suite 350
Chantilly, VA 20151
Co-ed school, 4-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("High Road School Of Northern Virginia",'Chantilly=' + Chantilly.length); Alexandria[Alexandria.length] = createMarker(new GPoint(-77.10248300,38.73178000),"
Islamic Saudi Academy
8333 Richmond Highway
Alexandria, VA 22309
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Islamic Saudi Academy",'Alexandria=' + Alexandria.length); Baileys_Crossroads[Baileys_Crossroads.length] = createMarker(new GPoint(-77.12310500,38.85111400),"
Khadijah Academy
3431c Carlin Springs Road Suite 200
Baileys Crossroads, VA 22041
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Khadijah Academy",'Baileys_Crossroads=' + Baileys_Crossroads.length); Alexandria[Alexandria.length] = createMarker(new GPoint(-77.14776600,38.82833900),"
Leary School Of Virginia
6349 Lincolnia Road
Alexandria, VA 22312
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Leary School Of Virginia",'Alexandria=' + Alexandria.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.35700900,38.83043000),"
Little Flock Christian School
11911 Braddock Rd
Fairfax, VA 22030
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Flock Christian School",'Fairfax=' + Fairfax.length); Mclean[Mclean.length] = createMarker(new GPoint(-77.23215100,38.96433500),"
The Madeira School
8328 Georgetown Pike
Mclean, VA 22102
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("The Madeira School",'Mclean=' + Mclean.length); Reston[Reston.length] = createMarker(new GPoint(-77.34276100,38.95213200),"
Oak Hill Christian School
11480 Sunset Hills Road
Reston, VA 20190
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oak Hill Christian School",'Reston=' + Reston.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.33404200,38.85986500),"
Oak Valley Center
3953 Pender Dr 105
Fairfax, VA 22030
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oak Valley Center",'Fairfax=' + Fairfax.length); Mclean[Mclean.length] = createMarker(new GPoint(-77.19168400,38.95731800),"
Oakcrest School
850 Balls Hill Road
Mclean, VA 22101
All-girls school, 6-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakcrest School",'Mclean=' + Mclean.length); Reston[Reston.length] = createMarker(new GPoint(-77.34276100,38.95213200),"
Oasis School
11480 Sunset Hills Road
Reston, VA 20190
Co-ed school, 1-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oasis School",'Reston=' + Reston.length); Annandale[Annandale.length] = createMarker(new GPoint(-77.18671000,38.81203700),"
Phillips School-Annandale
7010 Braddock Road
Annandale, VA 22003
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Phillips School-Annandale",'Annandale=' + Annandale.length); Mclean[Mclean.length] = createMarker(new GPoint(-77.15303900,38.93870000),"
Potomac School
Po Box 430
Mclean, VA 22101
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Potomac School",'Mclean=' + Mclean.length); Herndon[Herndon.length] = createMarker(new GPoint(-77.37658900,38.98917400),"
Temple Baptist School
1545 Dranesville Road
Herndon, VA 20170
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Temple Baptist School",'Herndon=' + Herndon.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.33597500,38.83302000),"
Trinity Christian School
11204 Braddock Road
Fairfax, VA 22030
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Christian School",'Fairfax=' + Fairfax.length); Falls_Church[Falls_Church.length] = createMarker(new GPoint(-77.20549900,38.87469100),"
Trinity School At Meadow View
2849 Meadow View Road
Falls Church, VA 22042
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity School At Meadow View",'Falls_Church=' + Falls_Church.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.24938200,38.86552900),"
Way Of Faith Christian Academy
8800 Arlington Blvd
Fairfax, VA 22031
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Way Of Faith Christian Academy",'Fairfax=' + Fairfax.length); Springfield[Springfield.length] = createMarker(new GPoint(-77.18494500,38.80802600),"
Word Of Life Christian Academy
5225 Backlick Road
Springfield, VA 22151
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Word Of Life Christian Academy",'Springfield=' + Springfield.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,11); /* 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/////2/' + showArray); map.removeOverlays(Alexandria); map.removeOverlays(Annandale); map.removeOverlays(Baileys_Crossroads); map.removeOverlays(Centreville); map.removeOverlays(Chantilly); map.removeOverlays(Fairfax); map.removeOverlays(Fairfax_Station); map.removeOverlays(Falls_Church); map.removeOverlays(Herndon); map.removeOverlays(Mclean); map.removeOverlays(Oakton); map.removeOverlays(Reston); map.removeOverlays(Springfield); map.removeOverlays(Vienna); 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(Springfield);map.removeOverlays(Alexandria); map.removeOverlays(Annandale); map.removeOverlays(Baileys_Crossroads); map.removeOverlays(Centreville); map.removeOverlays(Chantilly); map.removeOverlays(Fairfax); map.removeOverlays(Fairfax_Station); map.removeOverlays(Falls_Church); map.removeOverlays(Herndon); map.removeOverlays(Mclean); map.removeOverlays(Oakton); map.removeOverlays(Reston); map.removeOverlays(Springfield); map.removeOverlays(Vienna); map.addOverlays(Alexandria); centerByArray(Alexandria, false, false); cntMarker += Alexandria.length; map.addOverlays(Annandale); centerByArray(Annandale, false, false); cntMarker += Annandale.length; map.addOverlays(Baileys_Crossroads); centerByArray(Baileys_Crossroads, false, false); cntMarker += Baileys_Crossroads.length; map.addOverlays(Centreville); centerByArray(Centreville, false, false); cntMarker += Centreville.length; map.addOverlays(Chantilly); centerByArray(Chantilly, false, false); cntMarker += Chantilly.length; map.addOverlays(Fairfax); centerByArray(Fairfax, false, false); cntMarker += Fairfax.length; map.addOverlays(Fairfax_Station); centerByArray(Fairfax_Station, false, false); cntMarker += Fairfax_Station.length; map.addOverlays(Falls_Church); centerByArray(Falls_Church, false, false); cntMarker += Falls_Church.length; map.addOverlays(Herndon); centerByArray(Herndon, false, false); cntMarker += Herndon.length; map.addOverlays(Mclean); centerByArray(Mclean, false, false); cntMarker += Mclean.length; map.addOverlays(Oakton); centerByArray(Oakton, false, false); cntMarker += Oakton.length; map.addOverlays(Reston); centerByArray(Reston, false, false); cntMarker += Reston.length; map.addOverlays(Springfield); centerByArray(Springfield, false, false); cntMarker += Springfield.length; map.addOverlays(Vienna); centerByArray(Vienna, false, false); cntMarker += Vienna.length; centerByArray(Springfield,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'); //window.open('/map.php?type=1&schools=&school_level=2&radius=&zipcode=&school_type_search=&school_type_code='); } } function createMarker(point, label, icon) { var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }