function addMarkers() { mySelect = document.getElementById('selection'); Winston_Salem = [];Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.26432037,36.03951645),"
12th Street Academy
1401 W Clemmonsville Rd
Winston Salem, NC 27127

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("12th Street Academy",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.29011536,36.07463455),"
Bolton Elementary School
1250 Bolton Street
Winston Salem, NC 27103

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bolton Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.26552582,36.09478760),"
Brunson Elementary School
155 N Hawthorne Road
Winston Salem, NC 27104

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brunson Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.30999756,36.06549835),"
Career Center
1615 Miller Street
Winston Salem, NC 27103

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Career Center",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.20881653,36.13463211),"
Carver High School
3545 Carver School Road
Winston Salem, NC 27105

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carver High School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.27966309,36.11649323),"
Children's Center
02315 Coliseum Drive
Winston Salem, NC 27106

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Children's Center",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.23202515,36.07880783),"
Diggs Elementary School
950 Mock Street
Winston Salem, NC 27107

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Diggs Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.24745941,36.10127258),"
Downtown School
601 N Cherry Street
Winston Salem, NC 27101

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Downtown School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.22335052,36.05631638),"
Easton Elementary School
734 E Clemmonsville Road
Winston Salem, NC 27107

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Easton Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.21717072,36.07296371),"
Forest Park Elementary School
1900 Milford Street
Winston Salem, NC 27107

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Forest Park Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.23867035,36.06286240),"
Forsyth Vocational High School
2700 S Main Street
Winston Salem, NC 27127

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Forsyth Vocational High School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.26366425,36.03968811),"
Griffith Elementary School
1385 W Clemmonsville Road
Winston Salem, NC 27127

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Griffith Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.17613220,36.07914352),"
Hall-woodward Elementary School
125 Nicholson Road
Winston Salem, NC 27107

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hall-woodward Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.23683167,36.12676239),"
Hanes Middle School
2900 Indiana Avenue
Winston Salem, NC 27105

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hanes Middle School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.20565796,36.06866074),"
Hill Middle School
2200 Tryon Street
Winston Salem, NC 27107

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hill Middle School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.20282745,36.15800095),"
Ibraham Elementary School
5036 Old Walkertown
Winston Salem, NC 27105

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ibraham Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.24334717,36.09997940),"
Kimberley Park Elementary School
1700 Old Cherry Street
Winston Salem, NC 27105

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kimberley Park Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.24593353,36.05144882),"
Konnoak Elementary School
3200 Renon Road
Winston Salem, NC 27127

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Konnoak Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.25534058,36.07809830),"
Latham Elementary School
986 Hutton Street
Winston Salem, NC 27101

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Latham Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.23332214,36.10676193),"
Leap At Kennedy Middle School
1000 N Highland Avenue
Winston Salem, NC 27101

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Leap At Kennedy Middle School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.23683167,36.12676239),"
Lowrance Middle School
2900 Indiana Avenue
Winston Salem, NC 27105

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lowrance Middle School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.23612976,36.15644073),"
Mineral Springs Elementary School
4527 Ogburn Avenue
Winston Salem, NC 27105

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mineral Springs Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.23612976,36.15742493),"
Mineral Springs Middle School
4559 Ogburn Avenue
Winston Salem, NC 27105

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mineral Springs Middle School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.28607941,36.08742905),"
Moore Elementary School
451 Knollwood Street
Winston Salem, NC 27103

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Moore Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.31346893,36.12781525),"
Mount Tabor High School
342 Petree Road
Winston Salem, NC 27106

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount Tabor High School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.28405762,36.16902924),"
North Forsyth High School
5705 Shattalon Drive
Winston Salem, NC 27105

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Forsyth High School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.30927277,36.19181824),"
Northwest Middle School
5501 Murray Road
Winston Salem, NC 27106

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Northwest Middle School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.33181763,36.16542816),"
Old Town Elementary School
3930 Reynolda Road
Winston Salem, NC 27106

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Old Town Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.25827026,36.11346436),"
Paisley Middle School
1400 Grant Avenue
Winston Salem, NC 27105

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Paisley Middle School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.25767517,36.05537033),"
Parkland High School
1600 Brewer Road
Winston Salem, NC 27127

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parkland High School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.24623871,36.05347443),"
Philo Middle School
410 Haverhill Street
Winston Salem, NC 27127

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Philo Middle School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.26654053,36.10085678),"
Reynolds High School
301 N Hawthorne Road
Winston Salem, NC 27104

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Reynolds High School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.31029510,36.10551071),"
Sherwood Forest Elementary School
1055 Yorkshire Road
Winston Salem, NC 27106

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sherwood Forest Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.32467651,36.08504868),"
South Fork Elementary School
4332 Country Club Road
Winston Salem, NC 27104

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Fork Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.29653931,36.13100433),"
Speas Elementary School
2000 W Polo Road
Winston Salem, NC 27106

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Speas Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.28433228,36.10675049),"
Whitaker Elementary School
2600 Buena Vista Road
Winston Salem, NC 27104

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Whitaker Elementary School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.26243591,36.10200882),"
Wiley Middle School
1400 Northwest Boulevard
Winston Salem, NC 27104

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Wiley Middle School",'Winston_Salem=' + Winston_Salem.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(Winston_Salem); 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(Winston_Salem);map.removeOverlays(Winston_Salem); map.addOverlays(Winston_Salem); centerByArray(Winston_Salem, false, false); cntMarker += Winston_Salem.length; centerByArray(Winston_Salem,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'); } }