function addMarkers() { mySelect = document.getElementById('selection'); Washington = [];Washington[Washington.length] = createMarker(new GPoint(-77.01412000,38.94245200),"
Abc Bilingual Community Academy Pcs
209 Upshur St., Mw
Washington, DC 20011

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Abc Bilingual Community Academy Pcs",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.01114655,38.96256256),"
Barbara Jordan Public Charter School
100 Peabody Street, Nw
Washington, DC 20011

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Barbara Jordan Public Charter School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.01806641,38.94851685),"
Barnard Elementary School
430 Decatur St Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Barnard Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02864200,38.94063400),"
Bridges Public Charter School
1250 Taylor Street, Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bridges Public Charter School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02969360,38.96021271),"
Brightwood Elementary School
1300 Nicholson St Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brightwood Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02177429,38.94519043),"
Clark Elementary School
4501 7th St Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clark Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02987671,38.94496155),"
Community Academy Public Charter School
1300 Allison Street, Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Community Academy Public Charter School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.01989746,38.96624756),"
Coolidge High School
6315 5th St Nw
Washington, DC 20011

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Coolidge High School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.01114655,38.96256256),"
Ideal Academy Public Charter School
100 Peabody Street, Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ideal Academy Public Charter School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.00888824,38.96480560),"
Jackie Robinson Center
6135 Kansas Ave Ne
Washington, DC 20011

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jackie Robinson Center",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02814484,38.96169662),"
Kamit Institute Public Charter School
100 Peabody Street, Nw
Washington, DC 20011

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kamit Institute Public Charter School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-76.99862671,38.96112061),"
Lasalle Elementary School
501 Riggs Rd Ne
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lasalle Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.00782776,38.95237350),"
Lee, Mamie
100 Gallatin St Ne
Washington, DC 20011

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lee, Mamie",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02732849,38.94395447),"
Macfarland Middle School
4400 Iowa Ave Nw
Washington, DC 20011

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Macfarland Middle School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02700700,38.98217300),"
Mary Mcleod Bethune Day Academy Pcs
7600 Georgia Ave., Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mary Mcleod Bethune Day Academy Pcs",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02420044,38.96016312),"
Paul Junior High School Public Charter School
5800 8th St Nw
Washington, DC 20011

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Paul Junior High School Public Charter School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.03231049,38.94187164),"
Powell Elementary School
1350 Upshur St Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Powell Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02970123,38.94248199),"
Roosevelt High School
4301 13th St Nw
Washington, DC 20011

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Roosevelt High School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02952576,38.94302750),"
Roosevelt Stay
4301 13th St Nw
Washington, DC 20011

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Roosevelt Stay",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.00949860,38.95673752),"
Roots Public Charter School
15 Kenedy St, Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roots Public Charter School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.01351166,38.95332336),"
Rudolph Elementary School
5200 2nd St Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rudolph Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02970123,38.94277954),"
Sharpe Health School
4300 13th St Nw
Washington, DC 20011

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sharpe Health School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02020264,38.95249939),"
Tri-community Public Charter School
4324 Georgia Avenue, Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tri-community Public Charter School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02393341,38.95418930),"
Truesdell Elementary School
800 Ingraham St Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Truesdell Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.03114319,38.95080185),"
West Elementary School
1338 Farragut St Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.01989746,38.96495056),"
Whittier Elementary School
6201 5th St Nw
Washington, DC 20011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Whittier Elementary School",'Washington=' + Washington.length); Washington[Washington.length] = createMarker(new GPoint(-77.02323300,38.92690800),"
Young America Works Public Charter School
2828 Georgia Ave., Nw
Washington, DC 20011

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Young America Works Public Charter School",'Washington=' + Washington.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(Washington); 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(Washington);map.removeOverlays(Washington); map.addOverlays(Washington); centerByArray(Washington, false, false); cntMarker += Washington.length; centerByArray(Washington,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'); } }