function addMarkers(){ mySelect = document.getElementById('selection'); Clemmons = [];Winston_Salem = [];Kernersville = [];Lewisville = [];Walkertown = [];mySelect.options[mySelect.options.length] = new Option("Clemmons schools",'all=Clemmons'); mySelect.options[mySelect.options.length] = new Option("Kernersville schools",'all=Kernersville'); mySelect.options[mySelect.options.length] = new Option("Lewisville schools",'all=Lewisville'); mySelect.options[mySelect.options.length] = new Option("Walkertown schools",'all=Walkertown'); mySelect.options[mySelect.options.length] = new Option("Winston Salem schools",'all=Winston_Salem'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Clemmons[Clemmons.length] = createMarker(new GPoint(-80.37930000,36.01840000),"
Agape Faith Christian Academy
Po Box 630
Clemmons, NC 27012
Co-ed school, K-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Agape Faith Christian Academy",'Clemmons=' + Clemmons.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.18197900,36.04028900),"
Berean Baptist Christian School
4135 Thomasville Rd.
Winston Salem, NC 27107
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Berean Baptist Christian School",'Winston_Salem=' + Winston_Salem.length); Kernersville[Kernersville.length] = createMarker(new GPoint(-80.06258700,36.07803000),"
Bishop Mc Guinness High School
1725 Nc Highway 66 S
Kernersville, NC 27284
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bishop Mc Guinness High School",'Kernersville=' + Kernersville.length); Kernersville[Kernersville.length] = createMarker(new GPoint(-80.07055800,36.13601400),"
Brookside Montessori School
736 Piney Grove Rd
Kernersville, NC 27284
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brookside Montessori School",'Kernersville=' + Kernersville.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.34825700,36.08446100),"
Calvary Baptist Day School
5000 Country Club Road
Winston Salem, NC 27104
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Baptist Day School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.33436900,36.16135400),"
Cedar Forest Christian School
4634 Shattalon Drive
Winston Salem, NC 27106
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cedar Forest Christian School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.23048700,36.10995000),"
Ephesus Jr Academy
1225 N Cleveland Avenue
Winston Salem, NC 27101
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ephesus Jr Academy",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.27678100,36.14177800),"
First Assembly Christian School
3730 University Parkway
Winston Salem, NC 27106
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Assembly Christian School",'Winston_Salem=' + Winston_Salem.length); Kernersville[Kernersville.length] = createMarker(new GPoint(-80.05058200,36.13902600),"
First Christian Academy & Preschool
1130 North Main Street
Kernersville, NC 27284
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Christian Academy & Preschool",'Kernersville=' + Kernersville.length); Lewisville[Lewisville.length] = createMarker(new GPoint(-80.42401100,36.09513300),"
Forsyth Country Day School
Po Box 549
Lewisville, NC 27023
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Forsyth Country Day School",'Lewisville=' + Lewisville.length); Kernersville[Kernersville.length] = createMarker(new GPoint(-80.09967600,36.11779700),"
Fountain Of Life Lutheran Ps
323 Hopkins Road
Kernersville, NC 27284
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fountain Of Life Lutheran Ps",'Kernersville=' + Kernersville.length); Walkertown[Walkertown.length] = createMarker(new GPoint(-80.15870000,36.17900000),"
Gospel Light Christian School
Po Box 70
Walkertown, NC 27051
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gospel Light Christian School",'Walkertown=' + Walkertown.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.37393400,36.11789300),"
Greenhills School
1360 Lyndale Drive
Winston Salem, NC 27106
Co-ed school, 1-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greenhills School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.31030000,36.07580000),"
Jefferson Day School
Po Box 25286
Winston Salem, NC 27114
Co-ed school, K-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jefferson Day School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.26468900,36.10461000),"
Kingswood School
1001 Reynolda Road
Winston Salem, NC 27104
Co-ed school, 5-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kingswood School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.32262900,36.07712900),"
The Montessori School Of Winston-salem
3904 Old Vineyard Road
Winston Salem, NC 27104
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Montessori School Of Winston-salem",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.26148800,36.07067000),"
Our Lady Of Mercy School
1730 Link Road
Winston Salem, NC 27103
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Mercy School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.21103700,36.15086300),"
Quality Education Institute
5012 Lansing Dr
Winston Salem, NC 27105
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Quality Education Institute",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.27356900,36.07975900),"
Redeemer School
1046 Miller Street
Winston Salem, NC 27103
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Redeemer School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.28574000,36.12559500),"
Reynolda Presbyterian Preschool and Kindergarten
2200 Reynolda Rd
Winston Salem, NC 27106
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Reynolda Presbyterian Preschool and Kindergarten",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.28200300,36.07009800),"
St. Johns Lutheran Day School
2415 Silas Creek Pkwy
Winston Salem, NC 27103
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Johns Lutheran Day School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.27360500,36.10115100),"
St. Leo Parish School
333 Springdale Avenue
Winston Salem, NC 27104
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Leo Parish School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.25742700,36.09929200),"
St. Pauls Episcopal Preschool
520 Summit St
Winston Salem, NC 27101
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Pauls Episcopal Preschool",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.23736300,36.08929100),"
Salem Academy
500 E Salem Avenue
Winston Salem, NC 27101
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Salem Academy",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.24973200,36.08888000),"
Salem Baptist Christian School
429 S Broad St
Winston Salem, NC 27101
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Salem Baptist Christian School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.28451400,36.12423800),"
Summit School
2100 Reynolda Rd
Winston Salem, NC 27106
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Summit School",'Winston_Salem=' + Winston_Salem.length); Kernersville[Kernersville.length] = createMarker(new GPoint(-80.10152200,36.10641500),"
Triad Baptist Christian Academy
1175 South Main Street
Kernersville, NC 27284
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Triad Baptist Christian Academy",'Kernersville=' + Kernersville.length); Clemmons[Clemmons.length] = createMarker(new GPoint(-80.37072100,35.99335600),"
Victory Christian School
4765 Hampton Road
Clemmons, NC 27012
Co-ed school, K-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Victory Christian School",'Clemmons=' + Clemmons.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.31789100,36.07791500),"
Vineyard School
3637 Old Vineyard Road
Winston Salem, NC 27104
All-boys school, 6-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Vineyard School",'Winston_Salem=' + Winston_Salem.length); Winston_Salem[Winston_Salem.length] = createMarker(new GPoint(-80.24362400,36.14085900),"
Woodland Baptist Christian School
3665 Patterson Ave
Winston Salem, NC 27105
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodland Baptist Christian 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,11); /* 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/////3/' + showArray); map.removeOverlays(Clemmons); map.removeOverlays(Kernersville); map.removeOverlays(Lewisville); map.removeOverlays(Walkertown); 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(Clemmons);map.removeOverlays(Clemmons); map.removeOverlays(Kernersville); map.removeOverlays(Lewisville); map.removeOverlays(Walkertown); map.removeOverlays(Winston_Salem); map.addOverlays(Clemmons); centerByArray(Clemmons, false, false); cntMarker += Clemmons.length; map.addOverlays(Kernersville); centerByArray(Kernersville, false, false); cntMarker += Kernersville.length; map.addOverlays(Lewisville); centerByArray(Lewisville, false, false); cntMarker += Lewisville.length; map.addOverlays(Walkertown); centerByArray(Walkertown, false, false); cntMarker += Walkertown.length; map.addOverlays(Winston_Salem); centerByArray(Winston_Salem, false, false); cntMarker += Winston_Salem.length; centerByArray(Clemmons,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'); //window.open('/map.php?type=1&schools=&school_level=3&radius=&zipcode=&school_type_search=&school_type_code='); } } function createMarker(point, label, icon) { var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }