function addMarkers() { mySelect = document.getElementById('selection'); Arlington = [];Arlington[Arlington.length] = createMarker(new GPoint(-77.09731293,38.83884048),"
Abingdon Elementary School
3035 S Abingdon St
Arlington, VA 22206

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Abingdon Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.10312653,38.88935471),"
Arlington Science Focus School
1501 N. Lincoln Street
Arlington, VA 22201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arlington Science Focus School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.12256622,38.87945557),"
Arlington Traditional Elementary School
855 N Edison St
Arlington, VA 22205

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arlington Traditional Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.13597870,38.87343979),"
Ashlawn Elementary School
5950 N. 8th Road
Arlington, VA 22205

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ashlawn Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.10862732,38.86213303),"
Barcroft Elementary School
625 S Wakefield St
Arlington, VA 22204

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Barcroft Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.11141968,38.87328339),"
Barrett Elementary School
4401 N Henderson Rd
Arlington, VA 22203

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Barrett Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.12616730,38.85749817),"
Campbell Elementary School
737 S. Carlin Springs Rd.
Arlington, VA 22204

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Campbell Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.13156891,38.86187363),"
Carlin Springs Elementary School
5995 South 5th Road
Arlington, VA 22204

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carlin Springs Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.10723114,38.84921265),"
Claremont Center
4700 S Chesterfield Rd
Arlington, VA 22206

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Claremont Center",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.11315918,38.90208054),"
Claremont Immersion School
4700 S. Chesterfield Rd.
Arlington, VA 22206

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Claremont Immersion School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.08573151,38.84891129),"
Drew Model Elementary School
3500 South 23rd Street
Arlington, VA 22206

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Drew Model Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.08709717,38.89302063),"
Francis Scott Key Elementary School
2300 Key Blvd
Arlington, VA 22201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Francis Scott Key Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.11957550,38.89203262),"
Glebe Elementary School
1770 N. Glebe Road
Arlington, VA 22207

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glebe Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.06754303,38.84804535),"
Gunston Middle School
2700 S Lang St
Arlington, VA 22206

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Gunston Middle School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.08969116,38.86627197),"
Henry Elementary School
701 S Highland St
Arlington, VA 22204

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Henry Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.07229614,38.86088181),"
Hoffman-boston Elementary School
1415 S Queen St
Arlington, VA 22204

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hoffman-boston Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.13929749,38.91637802),"
Jamestown Elementary School
3700 N Delaware St
Arlington, VA 22207

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jamestown Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.09696960,38.86919403),"
Jefferson Middle School
125 S Old Glebe Rd
Arlington, VA 22204

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Jefferson Middle School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.12889099,38.86437607),"
Kenmore Middle School
200 S Carlin Springs Rd
Arlington, VA 22204

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kenmore Middle School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.08954620,38.87427902),"
Long Branch Elementary School
33 N Fillmore St
Arlington, VA 22201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Long Branch Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.14566803,38.87866211),"
Mckinley Elementary School
1030 N Mckinley Rd
Arlington, VA 22205

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.15074158,38.90114212),"
Nottingham Elementary School
5900 Little Falls Road
Arlington, VA 22207

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Nottingham Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.06976318,38.85076141),"
Oakridge Elementary School
1414 24th St S
Arlington, VA 22202

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakridge Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.09797668,38.85686111),"
Randolph Elementary School
1306 S Quincy St
Arlington, VA 22204

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Randolph Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.11082458,38.90045547),"
Stratford Program
4102 N. Vacation Ln.
Arlington, VA 22207

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Stratford Program",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.13804626,38.88338089),"
Swanson Middle School
5800 N Washington Blvd
Arlington, VA 22205

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Swanson Middle School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.11306000,38.90633774),"
Taylor Elementary School
2600 N Stuart St
Arlington, VA 22207

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Taylor Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.08777618,38.86540985),"
Tech Ed & Career Center
816 S Walter Reed Dr
Arlington, VA 22204

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tech Ed & Career Center",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.15921021,38.89358139),"
Tuckahoe Elementary School
6550 26th St N
Arlington, VA 22213

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tuckahoe Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.10820007,38.84611893),"
Wakefield High School
4901 South Chesterfield Rd
Arlington, VA 22206

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wakefield High School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.10839081,38.88762665),"
Washington Lee High School
1300 N Quincy St
Arlington, VA 22201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Washington Lee High School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.14568329,38.90979385),"
Williamsburg Middle School
3600 N Harrison St
Arlington, VA 22207

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Williamsburg Middle School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-77.13945007,38.90225220),"
Yorktown High School
5201 28th St N
Arlington, VA 22207

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