function addMarkers() { mySelect = document.getElementById('selection'); Woodbridge = [];Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.27616119,38.63323212),"
Ann Ludwig
2221 Opitz Blvd
Woodbridge, VA 22191

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ann Ludwig",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.29679871,38.69308853),"
Antietam Elementary School
12000 Antietam Rd
Woodbridge, VA 22192

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Antietam Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.31976318,38.64550400),"
Bel Air Elementary School
14151 Ferndale Dr
Woodbridge, VA 22193

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bel Air Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.23983765,38.65768051),"
Belmont Elementary School
751 Norwood Ln
Woodbridge, VA 22191

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Belmont Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.27758026,38.61999130),"
Blackburn Traditional
15311 Forest Grove Dr.
Woodbridge, VA 22191

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blackburn Traditional",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.38791656,38.65048599),"
C. D. Hylton High School
14051 Spriggs Rd
Woodbridge, VA 22193

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("C. D. Hylton High School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.31229401,38.63813019),"
Dale City Elementary School
14450 Brook Dr
Woodbridge, VA 22193

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dale City Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.28054047,38.65292358),"
Elizabeth Vaughan Elementary School
2200 York Dr
Woodbridge, VA 22191

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Elizabeth Vaughan Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.35968018,38.65077591),"
Enterprise Elementary School
13900 Lindendale Rd
Woodbridge, VA 22193

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Enterprise Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.26751709,38.63043976),"
Featherstone Elementary School
14805 Blackburn Rd
Woodbridge, VA 22191

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Featherstone Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.36803436,38.61268616),"
Forest Park High School
15721 Spriggs Rd
Woodbridge, VA 22193

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Forest Park High School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.26438141,38.65122223),"
Fred M. Lynn Middle School
2451 Longview Dr
Woodbridge, VA 22191

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fred M. Lynn Middle School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.28775600,38.62147200),"
Freedom High School
15201 Neabsco Mills Rd.
Woodbridge, VA 22191

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Freedom High School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.30168152,38.64426041),"
Gar-field High School
14000 Smoketown Rd
Woodbridge, VA 22192

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gar-field High School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.34512329,38.66633606),"
Kerrydale Elementary School
13199 Kerrydale Rd
Woodbridge, VA 22193

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kerrydale Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.31172943,38.69673538),"
Lake Ridge Elementary School
11970 Hedges Run Dr
Woodbridge, VA 22192

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lake Ridge Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.30405426,38.68555450),"
Lake Ridge Middle School
12350 Mohican Rd
Woodbridge, VA 22192

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lake Ridge Middle School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.28594208,38.60650635),"
Leesylvania Elementary School
15800 Neabsco Rd
Woodbridge, VA 22191

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Leesylvania Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.37847900,38.66799927),"
Martin Luther King Junior Elementary School
13224 Nickleson Dr
Woodbridge, VA 22193

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Martin Luther King Junior Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.28087616,38.64640808),"
Marumsco Hills Elementary School
14100 Page St
Woodbridge, VA 22191

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Marumsco Hills Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.34262085,38.63538742),"
Mills E. Godwin Middle School
14800 Darbydale Av
Woodbridge, VA 22193

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mills E. Godwin Middle School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.34321594,38.65311050),"
Minnieville Elementary School
13639 Greenwood Dr
Woodbridge, VA 22193

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Minnieville Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.32594299,38.62528992),"
Neabsco Elementary School
3800 Cordell Ave
Woodbridge, VA 22193

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Neabsco Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.26007843,38.67214966),"
Occoquan Elementary School
12915 Occoquan Rd
Woodbridge, VA 22192

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Occoquan Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.30332184,38.68315125),"
Old Bridge Elementary School
3051 Old Bridge Road
Woodbridge, VA 22192

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Old Bridge Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.25621796,38.63705444),"
Potomac View Elementary School
14601 Lamar Rd
Woodbridge, VA 22191

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Potomac View Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.26931000,38.65737534),"
R. Dean Kilby Elementary School
1800 Horner Rd
Woodbridge, VA 22191

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("R. Dean Kilby Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.27108765,38.62290955),"
Rippon Middle School
15101 Blackburn Rd
Woodbridge, VA 22191

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rippon Middle School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.29546356,38.58504868),"
River Oaks Elementary School
16950 Mcguffeys Trail
Woodbridge, VA 22191

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("River Oaks Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.27673340,38.68316650),"
Rockledge Elementary School
2300 Mariner Ln
Woodbridge, VA 22192

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rockledge Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.37657166,38.65058517),"
Sharon C. Mcauliffe Elementary School
13540 Princedale Dr
Woodbridge, VA 22193

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sharon C. Mcauliffe Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.36725616,38.67412186),"
Sonnie Penn Elementary School
12980 Queen Chapel Rd
Woodbridge, VA 22193

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sonnie Penn Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.32735443,38.68683243),"
Springwoods Elementary School
3815 Marquis Place
Woodbridge, VA 22192

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Springwoods Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.35607147,38.65956116),"
Stuart M. Beville Middle School
4901 Dale Blvd
Woodbridge, VA 22193

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Stuart M. Beville Middle School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.33449554,38.68504715),"
Westridge Elementary School
12400 Knightsbridge Dr
Woodbridge, VA 22192

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westridge Elementary School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.30186462,38.68301010),"
Woodbridge High School
3001 Old Bridge Rd
Woodbridge, VA 22192

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodbridge High School",'Woodbridge=' + Woodbridge.length); Woodbridge[Woodbridge.length] = createMarker(new GPoint(-77.28083038,38.65307999),"
Woodbridge Middle School
2201 York Dr
Woodbridge, VA 22191

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