function addMarkers() { mySelect = document.getElementById('selection'); Rockville = [];Rockville[Rockville.length] = createMarker(new GPoint(-77.07828522,39.06146240),"
Alternative Programs
850 Hungerford Dr Cesc Rm 170
Rockville, MD 20850

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alternative Programs",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.16192627,39.08723831),"
Beall Elementary School
451 Beall Ave
Rockville, MD 20850

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Beall Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.09116364,39.08279419),"
Brookhaven Elementary School
4610 Renn St
Rockville, MD 20853

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brookhaven Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.14531708,39.12886810),"
Candlewood Elementary School
7210 Osprey Dr
Rockville, MD 20855

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Candlewood Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.11065674,39.07611465),"
Carl Sandburg Center
451 Meadow Hall Dr
Rockville, MD 20851

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carl Sandburg Center",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.08678436,39.13690567),"
Cashell Elementary School
17101 Cashell Rd
Rockville, MD 20853

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cashell Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.11931610,39.12966156),"
Col. Zadok Magruder High School
5939 Muncaster Mill Rd
Rockville, MD 20855

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Col. Zadok Magruder High School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.16190338,39.10375977),"
College Gardens Elementary School
1700 Yale Pl
Rockville, MD 20850

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("College Gardens Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.10889435,39.09257126),"
Earle B. Wood Middle School
14615 Bauer Dr
Rockville, MD 20853

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Earle B. Wood Middle School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.17698669,39.07889938),"
Fallsmead Elementary School
1800 Greenplace Ter
Rockville, MD 20850

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fallsmead Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.14388275,39.04750061),"
Farmland Elementary School
7000 Old Gate Rd
Rockville, MD 20852

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Farmland Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.09089661,39.10638428),"
Flower Valley Elementary School
4615 Sunflower Dr
Rockville, MD 20853

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Flower Valley Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.17839813,39.04679489),"
Herbert Hoover Middle School
8810 Post Oak Rd
Rockville, MD 20854

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Herbert Hoover Middle School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.16451263,39.07391739),"
Julius West Middle School
651 Great Falls Rd
Rockville, MD 20850

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Julius West Middle School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.10288239,39.10390854),"
Lakewood Elementary School
2534 Lindley Terrace
Rockville, MD 20850

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lakewood Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.10294342,39.09469986),"
Lucy V. Barnsley Elementary School
14516 Nadine Dr
Rockville, MD 20853

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lucy V. Barnsley Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.12928772,39.04352951),"
Luxmanor Elementary School
6201 Tilden Ln
Rockville, MD 20852

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Luxmanor Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.12288666,39.09310913),"
Mark Twain School
14501 Avery Rd
Rockville, MD 20853

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mark Twain School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.13571930,39.08724213),"
Maryvale Elementary School
1000 First St
Rockville, MD 20851

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Maryvale Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.12375400,39.09469700),"
Mcps Transitions School
14501 Avery Rd
Rockville, MD 20853

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mcps Transitions School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.11682129,39.08384705),"
Meadow Hall Elementary School
951 Twinbrook Pkwy
Rockville, MD 20851

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Meadow Hall Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.15226746,39.14618301),"
Mill Creek Towne Elementary School
17700 Park Mill Dr
Rockville, MD 20855

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mill Creek Towne Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.07828522,39.06146240),"
Montgomery County Evening High School
850 Hungerford Dr Cesc Rm 167
Rockville, MD 20850

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montgomery County Evening High School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.09104156,39.08526230),"
Parkland Middle School
6300 Tilden Ln
Rockville, MD 20852

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Parkland Middle School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.13085937,39.13840485),"
Redland Middle School
6505 Muncaster Mill Rd
Rockville, MD 20855

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Redland Middle School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.20031738,39.10178375),"
Regional Institute For Children & Adolescents
15000 Broschart Rd
Rockville, MD 20850

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Regional Institute For Children & Adolescents",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.14456940,39.07809448),"
Richard Montgomery High School
250 Richard Montgomery Dr
Rockville, MD 20852

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Richard Montgomery High School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.17237854,39.06241989),"
Ritchie Park Elementary School
1514 Dunster Rd
Rockville, MD 20854

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ritchie Park Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.18663788,39.07383347),"
Robert Frost Middle School
9201 Scott Dr
Rockville, MD 20850

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Robert Frost Middle School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.10211945,39.08208466),"
Rock Creek Valley Elementary School
5121 Russett Rd
Rockville, MD 20853

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rock Creek Valley Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.15969849,39.09277725),"
Rock Terrace School
390 Martins Ln
Rockville, MD 20850

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rock Terrace School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.02416992,39.03406143),"
Rockville High School
2100 Baltimore Rd
Rockville, MD 20853

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rockville High School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.18157196,39.07277298),"
Thomas S. Wootton High School
2100 Wootton Pkwy
Rockville, MD 20850

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Thomas S. Wootton High School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.12306976,39.03803635),"
Tilden Middle School
11211 Old Georgetown Rd
Rockville, MD 20852

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Tilden Middle School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.11936951,39.06714249),"
Twinbrook Elementary School
5911 Ridgeway Ave
Rockville, MD 20851

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Twinbrook Elementary School",'Rockville=' + Rockville.length); Rockville[Rockville.length] = createMarker(new GPoint(-77.08881378,39.06878662),"
Wheaton Woods Elementary School
4510 Faroe Pl
Rockville, MD 20853

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