function addMarkers() { mySelect = document.getElementById('selection'); Bahama = [];Durham = [];mySelect.options[mySelect.options.length] = new Option("Bahama schools",'all=Bahama'); mySelect.options[mySelect.options.length] = new Option("Durham schools",'all=Durham'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Bahama[Bahama.length] = createMarker(new GPoint(-78.89182200,36.18710800),"
Ann Atwater Community
8305 Roxboro Road
Bahama, NC 27503

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ann Atwater Community",'Bahama=' + Bahama.length); Durham[Durham.length] = createMarker(new GPoint(-78.83850098,35.94208145),"
Bethesda Elementary School
2009 S Miami Boulevard
Durham, NC 27703

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bethesda Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.90798950,36.02546310),"
Brogden Middle School
1001 Leon Street
Durham, NC 27704

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Brogden Middle School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.88787842,35.97967529),"
Burton Elementary School
1500 Mathison Avenue
Durham, NC 27701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Burton Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.90586853,35.97913742),"
C C Spaulding Elementary School
1531 S Roxboro Road
Durham, NC 27707

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("C C Spaulding Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.96106720,35.92369461),"
C E Jordan High School
6806 Garrett Road
Durham, NC 27707

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("C E Jordan High School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.91287994,36.01694489),"
Carter Community Charter
1305 West Club Blvd
Durham, NC 27705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carter Community Charter",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.89759827,35.99840164),"
Central Park School For Child
724 Foster Street
Durham, NC 27701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Park School For Child",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.82752228,36.09524536),"
Chewning Middle School
5001 Red Mill Road
Durham, NC 27704

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Chewning Middle School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.89612579,36.01905060),"
Club Boulevard Elementary School
400 W Club Boulevard
Durham, NC 27704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Club Boulevard Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.87857819,35.98904037),"
Communities In Sch Academy
401 N Driver St
Durham, NC 27703

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Communities In Sch Academy",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.99312400,35.92955500),"
Creekside Elementary School
5321 Ephesus Church Road
Durham, NC 27707

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Creekside Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.89880371,35.99380112),"
Dps Hospital School
Po Box 3039
Durham, NC 27710

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dps Hospital School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.90616608,36.00245667),"
Durham Sch Of Arts
400 North Duke Street
Durham, NC 27701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Durham Sch Of Arts",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.92248900,36.01294700),"
E K Powe Elementary School
913 9th Street
Durham, NC 27705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("E K Powe Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.89556900,35.97040800),"
Early College High School
712 Cecil Street
Durham, NC 27707

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Early College High School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.92792511,36.07632065),"
Easley Elementary School
302 Lebanon Circle
Durham, NC 27712

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Easley Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.88594818,35.99062347),"
Eastway Elementary School
610 North Alston Avenue
Durham, NC 27701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eastway Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.91130829,36.08592606),"
Eno Valley Elementary School
117 Milton Road
Durham, NC 27712

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eno Valley Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.90592957,35.96493912),"
Fayetteville Street Elementary School
2905 Fayetteville Street
Durham, NC 27707

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fayetteville Street Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.98878479,35.98933792),"
Forest View Elementary School
3007 Mount Sinai Road
Durham, NC 27705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Forest View Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.91254425,36.08662796),"
George L Carrington Middle School
227 Milton Road
Durham, NC 27712

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("George L Carrington Middle School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.91092682,36.00783539),"
George Watts Elementary School
700 Watts Street
Durham, NC 27701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George Watts Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.83988953,36.02703476),"
Glenn Elementary School
2415 E Geer Street
Durham, NC 27704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glenn Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.91300201,35.99664307),"
Healthy Start Academy
807 West Chapel Hill Street
Durham, NC 27701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Healthy Start Academy",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.93560028,36.04547119),"
Hillandale Elementary School
2730 Hillandale Road
Durham, NC 27705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hillandale Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.90484619,35.95217896),"
Hillside High School
3727 Fayetteville St
Durham, NC 27707

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hillside High School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.90537262,36.05467606),"
Holt Elementary School
4019 Holt School Road
Durham, NC 27704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holt Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.93972778,35.96781921),"
Hope Valley Elementary School
3005 Dixon Road
Durham, NC 27707

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hope Valley Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.90016174,35.96630859),"
James E Shepard Middle School
2401 Dakota Street
Durham, NC 27707

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("James E Shepard Middle School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.92542267,35.98764801),"
Kestrel Heights School
4700 South Alston Ave.
Durham, NC 27713

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kestrel Heights School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.87788391,36.03823471),"
Lakeview School
3507 Dearborn Drive
Durham, NC 27704

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lakeview School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.93390656,35.98292160),"
Lakewood Elementary School
2520 Vesson Avenue
Durham, NC 27707

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lakewood Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.86575317,36.09876251),"
Little River Elementary School
2315 Snow Hill Road
Durham, NC 27712

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Little River Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-83.97538400,40.60419900),"
Lowe's Grove Middle School
64418 S Alston Avenue
Durham, NC 27713

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lowe's Grove Middle School",'Durham=' + Durham.length); Bahama[Bahama.length] = createMarker(new GPoint(-78.87757874,36.16993713),"
Mangum Elementary School
9008 Quail Roost Road
Bahama, NC 27503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mangum Elementary School",'Bahama=' + Bahama.length); Durham[Durham.length] = createMarker(new GPoint(-78.89002991,36.03533936),"
Maureen Joy Charter
1955 W Cornwallis Road
Durham, NC 27705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Maureen Joy Charter",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.85434723,36.00471497),"
Merrick-moore Elementary School
2325 Cheek Road
Durham, NC 27704

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Merrick-moore Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.88068800,35.97538100),"
Middle College High School @ Dtcc
1637 Lawson Street
Durham, NC 27703

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Middle College High School @ Dtcc",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.91334534,35.98906326),"
Morehead Montessori
909 Cobb Street
Durham, NC 27707

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Morehead Montessori",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.89880371,35.99380112),"
Nc School Of Science And Math
P O Box 2418
Durham, NC 27715

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nc School Of Science And Math",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.78089142,35.97776413),"
Neal Middle School
201 Baptist Road
Durham, NC 27704

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Neal Middle School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.91183472,36.09486389),"
Northern High School
117 Tom Wilkinson Road
Durham, NC 27712

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northern High School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.82067871,35.98117828),"
Oak Grove Elementary School
3810 Wake Forest Road
Durham, NC 27703

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak Grove Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.89880371,35.99380112),"
Omuteko Gwamaziima Elementary School
Po Box 52072
Durham, NC 27717

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Omuteko Gwamaziima Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.90796661,35.89152908),"
Parkwood Elementary School
5207 Revere Road
Durham, NC 27713

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Parkwood Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.90875244,35.93308258),"
Pearsontown Elementary School
4915 Barbee Road
Durham, NC 27713

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pearsontown Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.88262939,35.97225189),"
R N Harris Elementary School
1520 Cooper Street
Durham, NC 27703

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("R N Harris Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.85128784,35.93829727),"
Research Triangle Charter
2418 Ellis Road
Durham, NC 27703

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Research Triangle Charter",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.94445801,36.06231689),"
Riverside High School
3218 Rose Of Sharon Road
Durham, NC 27712

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Riverside High School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.93354034,35.97329712),"
Rogers-herr Middle School
911 Cornwallis Road
Durham, NC 27707

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rogers-herr Middle School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.92182159,35.99283981),"
Sherwood Githens Middle School
4800 Chapel Hill Road
Durham, NC 27707

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sherwood Githens Middle School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.83232880,36.00178909),"
Southern High School
800 Clayton Road
Durham, NC 27703

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southern High School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.92173767,35.92935944),"
Southwest Elementary School
2320 Cook Road
Durham, NC 27713

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southwest Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.85216522,35.98873138),"
Success Academy
2703 Holloway Street
Durham, NC 27703

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Success Academy",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.85216522,35.98873138),"
Turning Point Academy
2703 Holloway Street
Durham, NC 27703

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Turning Point Academy",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.89733124,35.98266220),"
W G Pearson Elementary School
600 E Umstead Street
Durham, NC 27701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("W G Pearson Elementary School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.87351990,35.98596191),"
Y E Smith Elementary School
2410 E Main Street
Durham, NC 27703

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