function addMarkers() { mySelect = document.getElementById('selection'); Fairfax = [];Fairfax[Fairfax.length] = createMarker(new GPoint(-77.30824280,38.83731461),"
Alc At Eleven Oaks
10515 School St
Fairfax, VA 22030

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alc At Eleven Oaks",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.30924225,38.80315781),"
Bonnie Brae Elementary School
5420 Sideburn Rd
Fairfax, VA 22032

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bonnie Brae Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.29540253,38.85305023),"
Daniels Run Elementary School
3705 Old Lee Hwy
Fairfax, VA 22030

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Daniels Run Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.28392792,38.85937119),"
Fairfax High School
3500 Old Lee Hwy
Fairfax, VA 22030

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fairfax High School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.31291000,38.84542200),"
Fairfax Juvenile Detention Home
10650 Page Ave.
Fairfax, VA 22030

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fairfax Juvenile Detention Home",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.32341766,38.83927536),"
Fairfax Villa Elementary School
10900 Santa Clara Dr
Fairfax, VA 22030

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairfax Villa Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.24877167,38.86854172),"
Fairhill Elementary School
3001 Chichester Ln
Fairfax, VA 22031

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairhill Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.27186584,38.83689880),"
Frost Middle School
4101 Pickett Rd
Fairfax, VA 22032

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Frost Middle School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.39420319,38.87076187),"
Greenbriar East Elementary School
13006 Point Pleasant Dr
Fairfax, VA 22033

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greenbriar East Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.40678406,38.87573624),"
Greenbriar West Elementary School
13300 Poplar Tree Rd
Fairfax, VA 22033

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greenbriar West Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.32521820,38.86120224),"
Lanier Middle School
3710 Bevan Dr
Fairfax, VA 22030

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lanier Middle School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.29578400,38.81326294),"
Laurel Ridge Elementary School
10110 Commonwealth Blvd
Fairfax, VA 22032

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Laurel Ridge Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.41072083,38.88959503),"
Lees Corner Elementary School
13500 Hollinger Ave
Fairfax, VA 22033

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lees Corner Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.26738739,38.82508469),"
Little Run Elementary School
4511 Olley Ln
Fairfax, VA 22032

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Little Run Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.25907135,38.84820557),"
Mantua Elementary School
9107 Horner Court
Fairfax, VA 22031

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mantua Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.28537750,38.87156296),"
Mosby Woods Elementary School
9819 Five Oaks Rd
Fairfax, VA 22031

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mosby Woods Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.37836456,38.88971329),"
Navy Elementary School
3500 W Ox Rd
Fairfax, VA 22033

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Navy Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.28687900,38.82630900),"
Northern Va. Tr. Ctr. E.p
9901 Braddock Rd
Fairfax, VA 22032

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northern Va. Tr. Ctr. E.p",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.30895996,38.81990814),"
Oak View Elementary School
5004 Sideburn Rd
Fairfax, VA 22032

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak View Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.27596283,38.83165359),"
Olde Creek Elementary School
9524 Old Creek Dr
Fairfax, VA 22032

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Olde Creek Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.32432556,38.86408997),"
Providence Elementary School
3616 Jermantown Rd
Fairfax, VA 22030

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Providence Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.30858612,38.81874847),"
Robinson Secondary
5035 Sideburn Rd
Fairfax, VA 22032

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Robinson Secondary",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.24727631,38.83736038),"
Wakefield Forest Elementary School
4011 Iva Ln
Fairfax, VA 22032

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wakefield Forest Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.37965393,38.83143234),"
Willow Springs Elementary School
5400 Willow Sprgs Sch Rd
Fairfax, VA 22030

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Willow Springs Elementary School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.27329254,38.84112930),"
Woodson Adult High School
9525 Main Street
Fairfax, VA 22031

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodson Adult High School",'Fairfax=' + Fairfax.length); Fairfax[Fairfax.length] = createMarker(new GPoint(-77.27329254,38.84112930),"
Woodson High School
9525 Main St
Fairfax, VA 22031

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodson High School",'Fairfax=' + Fairfax.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(Fairfax); 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(Fairfax);map.removeOverlays(Fairfax); map.addOverlays(Fairfax); centerByArray(Fairfax, false, false); cntMarker += Fairfax.length; centerByArray(Fairfax,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'); } }