function addMarkers() { mySelect = document.getElementById('selection'); Silver_Spring = [];Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.07183600,39.06450800),"
A. Mario Loiderman Middle School
12701 Goodhill Rd
Silver Spring, MD 20906

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("A. Mario Loiderman Middle School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.04998016,39.09045029),"
Argyle Middle School
2400 Bel Pre Rd
Silver Spring, MD 20906

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Argyle Middle School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.05574799,39.08276749),"
Bel Pre Elementary School
13801 Rippling Brook Dr
Silver Spring, MD 20906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bel Pre Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.97344208,39.11033630),"
Briggs Chaney Middle School
1901 Rainbow Dr
Silver Spring, MD 20904

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Briggs Chaney Middle School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.98432922,39.00815582),"
Broad Acres Elementary School
13313 Old Columbia Pike
Silver Spring, MD 20904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Broad Acres Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.00283813,39.03874207),"
Burnt Mills Elementary School
11211 Childs St
Silver Spring, MD 20901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Burnt Mills Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.99389648,39.06950378),"
Cannon Road Elementary School
901 Cannon Rd
Silver Spring, MD 20904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cannon Road Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.95112610,39.08426666),"
Cloverly Elementary School
800 Briggs Chaney Rd
Silver Spring, MD 20904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cloverly Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.02973938,39.04924393),"
Col. E. Brooke Lee Middle School
11800 Monticello Ave
Silver Spring, MD 20902

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Col. E. Brooke Lee Middle School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.98678589,39.02701569),"
Cresthaven Elementary School
1234 Cresthaven Dr
Silver Spring, MD 20903

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cresthaven Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.98616791,39.09131622),"
Dr. Charles R. Drew Elementary School
1200 Swingingdale Dr
Silver Spring, MD 20905

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dr. Charles R. Drew Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.01441956,38.99199677),"
East Silver Spring Elementary School
631 Silver Spring Ave
Silver Spring, MD 20910

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Silver Spring Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.00266266,39.01215744),"
Eastern Middle School
300 University Blvd East
Silver Spring, MD 20901

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Eastern Middle School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.95722961,39.09129715),"
Fairland Elementary School
14315 Fairdale Rd
Silver Spring, MD 20905

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairland Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.02094269,39.03402710),"
Forest Knolls Elementary School
10830 Eastwood Ave
Silver Spring, MD 20901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Forest Knolls Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.99079132,39.02827072),"
Francis Scott Key Middle School
910 Schindler Dr
Silver Spring, MD 20903

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Francis Scott Key Middle School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.94494629,39.06313324),"
Galway Elementary School
12612 Galway Dr
Silver Spring, MD 20904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Galway Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.02646000,39.04779500),"
Gateway To College Program
11721 Kemp Mill Rd
Silver Spring, MD 20902

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gateway To College Program",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.06307220,39.07586288),"
Georgian Forest Elementary School
3100 Regina Dr
Silver Spring, MD 20906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Georgian Forest Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.11361694,39.02263641),"
Glen Haven Elementary School
109 Inwood Ave
Silver Spring, MD 20902

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glen Haven Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.04000092,39.06082916),"
Glenallan Elementary School
12520 Heurich Rd
Silver Spring, MD 20902

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glenallan Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.94489288,39.07960129),"
Greencastle Elementary School
13611 Robey Rd
Silver Spring, MD 20904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greencastle Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.07720947,39.07601929),"
Harmony Hills Elementary School
13407 Lydia St
Silver Spring, MD 20906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Harmony Hills Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.06219482,39.05017853),"
Highland Elementary School
3100 Medway St
Silver Spring, MD 20902

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Highland Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.01066589,39.00457001),"
Highland View Elementary School
9010 Providence Ave
Silver Spring, MD 20901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Highland View Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.99259949,39.05583572),"
Jackson Road Elementary School
900 Jackson Rd
Silver Spring, MD 20904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jackson Road Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.01460266,39.11407852),"
James Hubert Blake High School
300 Norwood Rd
Silver Spring, MD 20905

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("James Hubert Blake High School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.03712463,39.06518936),"
John F. Kennedy High School
1901 Randolph Rd
Silver Spring, MD 20902

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("John F. Kennedy High School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.05280304,39.02004242),"
Mckenney Hills Center
2600 Hayden Dr
Silver Spring, MD 20902

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mckenney Hills Center",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.01075745,39.01928711),"
Montgomery Blair High School
51 University Blvd E
Silver Spring, MD 20901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montgomery Blair High School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.99408722,39.00654221),"
Montgomery Knolls Elementary School
807 Daleview Dr
Silver Spring, MD 20901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Montgomery Knolls Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.99169159,38.99741364),"
New Hampshire Estates Elementary School
8720 Carroll Ave
Silver Spring, MD 20903

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Hampshire Estates Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.02394300,39.03393700),"
Northwood High School
919 University Blvd W
Silver Spring, MD 20901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northwood High School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.00126648,39.00419617),"
Oak View Elementary School
400 E Wayne Ave
Silver Spring, MD 20901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak View Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.05577087,39.02972031),"
Oakland Terrace Elementary School
13313 Old Columbia Pike
Silver Spring, MD 20904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakland Terrace Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.00541687,39.02073288),"
Pine Crest Elementary School
201 Woodmoor Dr
Silver Spring, MD 20901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pine Crest Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.04542542,39.00067139),"
Rosemary Hills Elementary School
2111 Porter Rd
Silver Spring, MD 20910

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rosemary Hills Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.01231384,38.99982834),"
Silver Spring International Middle School
313 Wayne Ave
Silver Spring, MD 20910

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Silver Spring International Middle School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.01594543,39.00126266),"
Sligo Creek Elementary School
500 Schuyler Rd
Silver Spring, MD 20910

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sligo Creek Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.03101349,39.02500916),"
Sligo Middle School
1401 Dennis Ave
Silver Spring, MD 20902

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sligo Middle School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.00360870,39.05792236),"
Springbrook High School
201 Valleybrook Dr
Silver Spring, MD 20904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Springbrook High School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.01471710,39.09185791),"
Stonegate Elementary School
14811 Notley Rd
Silver Spring, MD 20904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stonegate Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.06322479,39.08731079),"
Strathmore Elementary School
3200 Beaverwood Ln
Silver Spring, MD 20906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Strathmore Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.01468658,38.98484802),"
Takoma Park Middle School
7611 Piney Branch Rd
Silver Spring, MD 20910

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Takoma Park Middle School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.06818500,39.06102500),"
Thomas Edison High School Of Technology
12501 Dalewood Dr
Silver Spring, MD 20906

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Thomas Edison High School Of Technology",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.08551025,39.04730988),"
Viers Mill Elementary School
11711 Joseph Mill Rd
Silver Spring, MD 20906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Viers Mill Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.06578827,39.06480789),"
Weller Road Elementary School
3301 Weller Rd
Silver Spring, MD 20906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Weller Road Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.01671600,39.07467651),"
Westover Elementary School
401 Hawkesbury Ln
Silver Spring, MD 20904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westover Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.06712341,39.06212616),"
Wheaton High School
12601 Dalewood Dr
Silver Spring, MD 20906

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wheaton High School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.99552917,39.05527496),"
White Oak Middle School
12201 New Hampshire Ave
Silver Spring, MD 20904

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("White Oak Middle School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-76.95867920,39.07449722),"
William Tyler Page Elementary School
13400 Tamarack Rd
Silver Spring, MD 20904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("William Tyler Page Elementary School",'Silver_Spring=' + Silver_Spring.length); Silver_Spring[Silver_Spring.length] = createMarker(new GPoint(-77.04669800,39.00598500),"
Woodlin Elementary School
2101 Luzerne Ave
Silver Spring, MD 20910

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodlin Elementary School",'Silver_Spring=' + Silver_Spring.length); maxLng = -76.94489288; maxLat = 39.11407852; minLng = -77.11361694; minLat = 38.98484802; reCenterMap(); } // 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(Silver_Spring); 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(Silver_Spring);map.removeOverlays(Silver_Spring); map.addOverlays(Silver_Spring); centerByArray(Silver_Spring, false, false); cntMarker += Silver_Spring.length; centerByArray(Silver_Spring,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'); } }