function addMarkers() { mySelect = document.getElementById('selection'); Richmond = [];Midlothian = [];Bon_Air = [];Chester = [];Chesterfield = [];Ettrick = [];Moseley = [];Colonial_Heights = [];Matoaca = [];mySelect.options[mySelect.options.length] = new Option("Bon Air schools",'all=Bon_Air'); mySelect.options[mySelect.options.length] = new Option("Chester schools",'all=Chester'); mySelect.options[mySelect.options.length] = new Option("Chesterfield schools",'all=Chesterfield'); mySelect.options[mySelect.options.length] = new Option("Colonial Heights schools",'all=Colonial_Heights'); mySelect.options[mySelect.options.length] = new Option("Ettrick schools",'all=Ettrick'); mySelect.options[mySelect.options.length] = new Option("Matoaca schools",'all=Matoaca'); mySelect.options[mySelect.options.length] = new Option("Midlothian schools",'all=Midlothian'); mySelect.options[mySelect.options.length] = new Option("Moseley schools",'all=Moseley'); mySelect.options[mySelect.options.length] = new Option("Richmond schools",'all=Richmond'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Richmond[Richmond.length] = createMarker(new GPoint(-77.54689789,37.49160004),"
A. M. Davis Elementary School
415 S Providence Rd
Richmond, VA 23236

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("A. M. Davis Elementary School",'Richmond=' + Richmond.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.63885498,37.39755630),"
Alberta Smith Elementary School
13200 Bailey Bridge Rd
Midlothian, VA 23112

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Alberta Smith Elementary School",'Midlothian=' + Midlothian.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.62200928,37.40898895),"
Bailey Bridge Middle School
12501 Bailey Bridge Rd
Midlothian, VA 23112

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bailey Bridge Middle School",'Midlothian=' + Midlothian.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.43959808,37.39126968),"
Bellwood Elementary School
9536 Dawnshire Rd
Richmond, VA 23237

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bellwood Elementary School",'Richmond=' + Richmond.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.45048523,37.43587494),"
Bensley Elementary School
6600 Strathmore Rd
Richmond, VA 23237

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bensley Elementary School",'Richmond=' + Richmond.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.65301514,37.54748154),"
Bettie Weaver Elementary School
3600 James River Rd
Midlothian, VA 23113

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bettie Weaver Elementary School",'Midlothian=' + Midlothian.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.46928406,37.42495346),"
Beulah Elementary School
4216 Beulah Rd
Richmond, VA 23237

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Beulah Elementary School",'Richmond=' + Richmond.length); Bon_Air[Bon_Air.length] = createMarker(new GPoint(-77.56030273,37.53044891),"
Bon Air Elementary School
8701 Polk St
Bon Air, VA 23235

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bon Air Elementary School",'Bon_Air=' + Bon_Air.length); Bon_Air[Bon_Air.length] = createMarker(new GPoint(-77.57643890,37.51455307),"
Bon Air Expansion Corr Center
1900 Chatsworth Rd
Bon Air, VA 23235

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bon Air Expansion Corr Center",'Bon_Air=' + Bon_Air.length); Chester[Chester.length] = createMarker(new GPoint(-77.44069672,37.33707047),"
C. C. Wells Elementary School
13101 S. Chester Rd.
Chester, VA 23831

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("C. C. Wells Elementary School",'Chester=' + Chester.length); Chester[Chester.length] = createMarker(new GPoint(-77.43442535,37.35996628),"
C. E. Curtis Elementary School
3600 W Hundred Rd
Chester, VA 23831

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("C. E. Curtis Elementary School",'Chester=' + Chester.length); Chester[Chester.length] = createMarker(new GPoint(-77.42632294,37.30307770),"
Carver Middle School
3800 Cougar Trail
Chester, VA 23831

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Carver Middle School",'Chester=' + Chester.length); Chester[Chester.length] = createMarker(new GPoint(-77.44002533,37.35863876),"
Chester Middle School
3900 W. Hundred Rd
Chester, VA 23831

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Chester Middle School",'Chester=' + Chester.length); Chester[Chester.length] = createMarker(new GPoint(-77.47154236,37.34841537),"
Chesterfield Community High School
12400 Branders Bridge Road
Chester, VA 23831

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chesterfield Community High School",'Chester=' + Chester.length); Chesterfield[Chesterfield.length] = createMarker(new GPoint(-77.49888700,37.38142900),"
Chesterfield Juvenile Detention Home
9700 Krause Rd.
Chesterfield, VA 23832

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chesterfield Juvenile Detention Home",'Chesterfield=' + Chesterfield.length); Chesterfield[Chesterfield.length] = createMarker(new GPoint(-77.50110626,37.38743591),"
Chesterfield Tech.
10101 Courthouse Rd
Chesterfield, VA 23832

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chesterfield Tech.",'Chesterfield=' + Chesterfield.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.67176819,37.41923523),"
Clover Hill Elementary School
5700 Woodlake Village Pkwy
Midlothian, VA 23112

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clover Hill Elementary School",'Midlothian=' + Midlothian.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.66183472,37.40554428),"
Clover Hill High School
13900 Hull Street Rd.
Midlothian, VA 23112

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clover Hill High School",'Midlothian=' + Midlothian.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.50664900,37.51747000),"
Crestwood Elementary School
7600 Whittington Dr.
Richmond, VA 23225

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Crestwood Elementary School",'Richmond=' + Richmond.length); Chester[Chester.length] = createMarker(new GPoint(-77.46253967,37.35959244),"
Ecoff Elementary School
5200 Ecoff Ave.
Chester, VA 23831

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ecoff Elementary School",'Chester=' + Chester.length); Chester[Chester.length] = createMarker(new GPoint(-77.32321167,37.33070755),"
Enon Elementary School
2001 E. Hundred Rd.
Chester, VA 23836

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Enon Elementary School",'Chester=' + Chester.length); Ettrick[Ettrick.length] = createMarker(new GPoint(-77.42692566,37.23844528),"
Ettrick Elementary School
20910 Chesterfield Ave.
Ettrick, VA 23803

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ettrick Elementary School",'Ettrick=' + Ettrick.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.63283539,37.46456909),"
Evergreen Elementary School
1701 Evergreen East Pkwy.
Midlothian, VA 23114

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Evergreen Elementary School",'Midlothian=' + Midlothian.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.46888733,37.45727158),"
Falling Creek Elementary School
4800 Hopkins Rd.
Richmond, VA 23234

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Falling Creek Elementary School",'Richmond=' + Richmond.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.46871185,37.45899582),"
Falling Creek Middle School
4724 Hopkins Rd.
Richmond, VA 23234

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Falling Creek Middle School",'Richmond=' + Richmond.length); Moseley[Moseley.length] = createMarker(new GPoint(-77.76512909,37.38943481),"
Grange Hall Elementary School
19301 Hull Street Rd.
Moseley, VA 23120

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Grange Hall Elementary School",'Moseley=' + Moseley.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.59129333,37.51987457),"
Greenfield Elementary School
10751 Savoy Rd.
Richmond, VA 23235

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greenfield Elementary School",'Richmond=' + Richmond.length); Chester[Chester.length] = createMarker(new GPoint(-77.42717743,37.30609512),"
Harrowgate Elementary School
15501 Harrowgate Rd.
Chester, VA 23831

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Harrowgate Elementary School",'Chester=' + Chester.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.47338867,37.43692780),"
Hopkins Road Elementary School
6000 Hopkins Rd.
Richmond, VA 23234

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hopkins Road Elementary School",'Richmond=' + Richmond.length); Chesterfield[Chesterfield.length] = createMarker(new GPoint(-77.51965332,37.46425629),"
J. A. Chalkley Elementary School
3301 Turner Rd
Chesterfield, VA 23832

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("J. A. Chalkley Elementary School",'Chesterfield=' + Chesterfield.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.65353394,37.49464035),"
J. B. Watkins Elementary School
501 Coalfield Rd.
Midlothian, VA 23114

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("J. B. Watkins Elementary School",'Midlothian=' + Midlothian.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.48904419,37.44631958),"
J. G. Hening Elementary School
5230 Chicora Dr.
Richmond, VA 23234

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("J. G. Hening Elementary School",'Richmond=' + Richmond.length); Chesterfield[Chesterfield.length] = createMarker(new GPoint(-77.55293274,37.43363571),"
Jacobs Road Elementary School
8800 Jacobs Rd.
Chesterfield, VA 23832

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jacobs Road Elementary School",'Chesterfield=' + Chesterfield.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.64855957,37.55100250),"
James River High School
3700 James River Rd.
Midlothian, VA 23113

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("James River High School",'Midlothian=' + Midlothian.length); Bon_Air[Bon_Air.length] = createMarker(new GPoint(-77.57643890,37.51455307),"
Joseph Mastin School @ Bon Air
1900 Chatsworth Ave
Bon Air, VA 23235

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Joseph Mastin School @ Bon Air",'Bon_Air=' + Bon_Air.length); Chesterfield[Chesterfield.length] = createMarker(new GPoint(-77.49720001,37.38743591),"
Lloyd C. Bird High School
10301 Courthouse Rd.
Chesterfield, VA 23832

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lloyd C. Bird High School",'Chesterfield=' + Chesterfield.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.62416077,37.40771103),"
Manchester High School
12601 Bailey Bridge Rd.
Midlothian, VA 23112

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Manchester High School",'Midlothian=' + Midlothian.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.52919769,37.47025681),"
Manchester Middle School
7401 Hull Street Rd.
Richmond, VA 23235

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Manchester Middle School",'Richmond=' + Richmond.length); Colonial_Heights[Colonial_Heights.length] = createMarker(new GPoint(-77.39226532,37.32209015),"
Marguerite F. Christian Elementary School
14801 Woods Edge Rd.
Colonial Heights, VA 23834

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Marguerite F. Christian Elementary School",'Colonial_Heights=' + Colonial_Heights.length); Matoaca[Matoaca.length] = createMarker(new GPoint(-77.48205900,37.23087000),"
Matoaca Elementary School
6627 River Rd
Matoaca, VA 23803

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Matoaca Elementary School",'Matoaca=' + Matoaca.length); Chesterfield[Chesterfield.length] = createMarker(new GPoint(-77.48480225,37.28710175),"
Matoaca High School
17700 Longhouse Lane
Chesterfield, VA 23838

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Matoaca High School",'Chesterfield=' + Chesterfield.length); Matoaca[Matoaca.length] = createMarker(new GPoint(-77.47493744,37.24614334),"
Matoaca Middle School
20300 Halloway Ave.
Matoaca, VA 23803

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Matoaca Middle School",'Matoaca=' + Matoaca.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.48297119,37.43680191),"
Meadowbrook High School
4901 Cogbill Rd.
Richmond, VA 23234

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Meadowbrook High School",'Richmond=' + Richmond.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.66159058,37.49886703),"
Midlothian High School
401 Charter Colony Dr.
Midlothian, VA 23114

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Midlothian High School",'Midlothian=' + Midlothian.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.64926147,37.50292587),"
Midlothian Middle School
13501 Midlothian Turnpike
Midlothian, VA 23113

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Midlothian Middle School",'Midlothian=' + Midlothian.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.61213684,37.48196411),"
Monacan High School
11501 Smoketree Dr.
Richmond, VA 23236

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Monacan High School",'Richmond=' + Richmond.length); Chesterfield[Chesterfield.length] = createMarker(new GPoint(-77.50602722,37.37704849),"
O. B. Gates Elementary School
10001 Courthouse Rd.
Chesterfield, VA 23832

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("O. B. Gates Elementary School",'Chesterfield=' + Chesterfield.length); Bon_Air[Bon_Air.length] = createMarker(new GPoint(-77.57369995,37.51844025),"
Oak Ridge Juvenile Correctional Center
1801 Old Bon Air Rd
Bon Air, VA 23235

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oak Ridge Juvenile Correctional Center",'Bon_Air=' + Bon_Air.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.43566895,37.40586472),"
Perrymont Middle School
8610 Perrymont Road
Richmond, VA 23237

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Perrymont Middle School",'Richmond=' + Richmond.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.60169983,37.45926666),"
Providence Elementary School
11001 W. Providence Rd.
Richmond, VA 23236

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Providence Elementary School",'Richmond=' + Richmond.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.54207611,37.48840332),"
Providence Middle School
900 Starlight Lane
Richmond, VA 23235

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Providence Middle School",'Richmond=' + Richmond.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.58553314,37.48763657),"
Reams Road Elementary School
10141 Reams Rd.
Richmond, VA 23236

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Reams Road Elementary School",'Richmond=' + Richmond.length); Bon_Air[Bon_Air.length] = createMarker(new GPoint(-77.57486725,37.51684952),"
Reception And Diagnostic Cntr
1601 Old Bon Air Road
Bon Air, VA 23235

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Reception And Diagnostic Cntr",'Bon_Air=' + Bon_Air.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.61454773,37.53072739),"
Robious Elementary School
2801 Robious Crossing Dr.
Midlothian, VA 23113

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robious Elementary School",'Midlothian=' + Midlothian.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.61470795,37.52923965),"
Robious Middle School
2701 Robious Crossing Dr
Midlothian, VA 23113

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Robious Middle School",'Midlothian=' + Midlothian.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.48344421,37.38470840),"
Salem Church Elementary School
9600 Salem Church Rd.
Richmond, VA 23237

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Salem Church Elementary School",'Richmond=' + Richmond.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.48583984,37.38283920),"
Salem Church Middle School
9700 Salem Church Rd.
Richmond, VA 23237

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Salem Church Middle School",'Richmond=' + Richmond.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.41156006,37.57770157),"
Specialized Programs - Headstart Elementary School
4003 Cogbill Rd.
Richmond, VA 23234

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Specialized Programs - Headstart Elementary School",'Richmond=' + Richmond.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.65274048,37.38423157),"
Spring Run Elementary School
13901 Spring Run Rd
Midlothian, VA 23112

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Spring Run Elementary School",'Midlothian=' + Midlothian.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.64968600,37.42558100),"
Swift Creek Elementary School
13800 Genito Rd.
Midlothian, VA 23112

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Swift Creek Elementary School",'Midlothian=' + Midlothian.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.64452362,37.44180679),"
Swift Creek Middle School
3700 Old Hundred Rd S
Midlothian, VA 23112

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Swift Creek Middle School",'Midlothian=' + Midlothian.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.61016846,37.41847610),"
Thelma Crenshaw Elementary School
11901 Bailey Bridge Rd.
Midlothian, VA 23112

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thelma Crenshaw Elementary School",'Midlothian=' + Midlothian.length); Chester[Chester.length] = createMarker(new GPoint(-77.43490601,37.36003876),"
Thomas Dale High School
3626 W. Hundred Rd.
Chester, VA 23831

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Thomas Dale High School",'Chester=' + Chester.length); Richmond[Richmond.length] = createMarker(new GPoint(-77.61624908,37.47880173),"
W. W. Gordon Elementary School
11701 Gordon School Rd.
Richmond, VA 23236

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("W. W. Gordon Elementary School",'Richmond=' + Richmond.length); Midlothian[Midlothian.length] = createMarker(new GPoint(-77.69290161,37.42688370),"
Woolridge Elementary School
5401 Timber Bluff Pkwy.
Midlothian, VA 23112

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woolridge Elementary School",'Midlothian=' + Midlothian.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(Bon_Air); map.removeOverlays(Chester); map.removeOverlays(Chesterfield); map.removeOverlays(Colonial_Heights); map.removeOverlays(Ettrick); map.removeOverlays(Matoaca); map.removeOverlays(Midlothian); map.removeOverlays(Moseley); map.removeOverlays(Richmond); 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(Richmond);map.removeOverlays(Bon_Air); map.removeOverlays(Chester); map.removeOverlays(Chesterfield); map.removeOverlays(Colonial_Heights); map.removeOverlays(Ettrick); map.removeOverlays(Matoaca); map.removeOverlays(Midlothian); map.removeOverlays(Moseley); map.removeOverlays(Richmond); map.addOverlays(Bon_Air); centerByArray(Bon_Air, false, false); cntMarker += Bon_Air.length; map.addOverlays(Chester); centerByArray(Chester, false, false); cntMarker += Chester.length; map.addOverlays(Chesterfield); centerByArray(Chesterfield, false, false); cntMarker += Chesterfield.length; map.addOverlays(Colonial_Heights); centerByArray(Colonial_Heights, false, false); cntMarker += Colonial_Heights.length; map.addOverlays(Ettrick); centerByArray(Ettrick, false, false); cntMarker += Ettrick.length; map.addOverlays(Matoaca); centerByArray(Matoaca, false, false); cntMarker += Matoaca.length; map.addOverlays(Midlothian); centerByArray(Midlothian, false, false); cntMarker += Midlothian.length; map.addOverlays(Moseley); centerByArray(Moseley, false, false); cntMarker += Moseley.length; map.addOverlays(Richmond); centerByArray(Richmond, false, false); cntMarker += Richmond.length; centerByArray(Richmond,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'); } }