function addMarkers(){ mySelect = document.getElementById('selection'); Raleigh = [];Cary = [];Zebulon = [];Fuquay_Varina = [];Fuquay_varina = [];Holly_Springs = [];mySelect.options[mySelect.options.length] = new Option("Cary schools",'all=Cary'); mySelect.options[mySelect.options.length] = new Option("Fuquay Varina schools",'all=Fuquay_Varina'); mySelect.options[mySelect.options.length] = new Option("Fuquay varina schools",'all=Fuquay_varina'); mySelect.options[mySelect.options.length] = new Option("Holly Springs schools",'all=Holly_Springs'); mySelect.options[mySelect.options.length] = new Option("Raleigh schools",'all=Raleigh'); mySelect.options[mySelect.options.length] = new Option("Zebulon schools",'all=Zebulon'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.72636800,35.80458300),"
Cardinal Gibbons High School
1401 Edwards Mill Road
Raleigh, NC 27607
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cardinal Gibbons High School",'Raleigh=' + Raleigh.length); Cary[Cary.length] = createMarker(new GPoint(-78.77128600,35.81938800),"
Cary Academy
1500 N Harrison Avenue
Cary, NC 27513
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cary Academy",'Cary=' + Cary.length); Cary[Cary.length] = createMarker(new GPoint(-78.80643700,35.77476300),"
Cary Christian School
1330 Old Apex Road
Cary, NC 27513
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cary Christian School",'Cary=' + Cary.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.61833500,35.80533000),"
Faith Lutheran School
1809 Capital Blvd
Raleigh, NC 27604
Co-ed school, K-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Lutheran School",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.63134200,35.85647100),"
The Fletcher Academy
400 Cedarview Court
Raleigh, NC 27609
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Fletcher Academy",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.61576900,35.85699500),"
Friendship Christian School
5510 Falls Of Neuse Road
Raleigh, NC 27609
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Friendship Christian School",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.73773400,35.77213200),"
Grace Christian School
801 Buck Jones Road
Raleigh, NC 27606
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Christian School",'Raleigh=' + Raleigh.length); Zebulon[Zebulon.length] = createMarker(new GPoint(-78.32714700,35.81733300),"
Heritage Christian Academy
615 Mack Todd Road
Zebulon, NC 27597
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian Academy",'Zebulon=' + Zebulon.length); Fuquay_Varina[Fuquay_Varina.length] = createMarker(new GPoint(-78.72071700,35.62704500),"
Hilltop Christian School
10212 Fayetteville Rd
Fuquay Varina, NC 27526
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hilltop Christian School",'Fuquay_Varina=' + Fuquay_Varina.length); Cary[Cary.length] = createMarker(new GPoint(-78.80977400,35.81294200),"
Hopewell Academy
1001 Sheldon Drive
Cary, NC 27513
Co-ed school, 4-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hopewell Academy",'Cary=' + Cary.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.60949500,35.78353700),"
Love Christian Ctr. Academy
410 Lord Berkley Rd.
Raleigh, NC 27610
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Love Christian Ctr. Academy",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.63217500,35.79090700),"
Montessori Comm Children's Hou
824 N. Bloodworth Street
Raleigh, NC 27604
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Comm Children's Hou",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.66180400,35.87633800),"
Montessori School Of Raleigh
7005 Lead Mine Road
Raleigh, NC 27615
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori School Of Raleigh",'Raleigh=' + Raleigh.length); Fuquay_varina[Fuquay_varina.length] = createMarker(new GPoint(-78.80808700,35.52689500),"
Montessori World
25 Buttonwood Court
Fuquay-varina, NC 27526
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori World",'Fuquay_varina=' + Fuquay_varina.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.55823300,35.89757500),"
Neuse Baptist Christian School
8700 Capital Blvd
Raleigh, NC 27616
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Neuse Baptist Christian School",'Raleigh=' + Raleigh.length); Holly_Springs[Holly_Springs.length] = createMarker(new GPoint(-78.78932700,35.65499300),"
The New School, A Montessori Center For Children
5617 Sunset Lake Road
Holly Springs, NC 27540
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The New School, A Montessori Center For Children",'Holly_Springs=' + Holly_Springs.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.54539000,35.87903600),"
North Raleigh Christian Academy
7300 Perry Creek Road
Raleigh, NC 27616
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Raleigh Christian Academy",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.57713000,35.80919100),"
Raleigh Christian Academy
2110 Trawick Road
Raleigh, NC 27604
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Raleigh Christian Academy",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.62713900,35.88467500),"
Ravenscroft School
7409 Falls Of Neuse Rd
Raleigh, NC 27615
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ravenscroft School",'Raleigh=' + Raleigh.length); Cary[Cary.length] = createMarker(new GPoint(-78.77746800,35.72943600),"
Resurrection Lutheran School
100 Lochmere Drive West
Cary, NC 27518
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Resurrection Lutheran School",'Cary=' + Cary.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.64922700,35.82250200),"
St. Davids School
3400 White Oak Rd
Raleigh, NC 27609
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Davids School",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.65225000,35.78128500),"
Saint Marys School
900 Hillsborough Street
Raleigh, NC 27603
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Saint Marys School",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.63281600,35.84609200),"
St. Timothys School
4523 Six Forks Road
Raleigh, NC 27609
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Timothys School",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.58903100,35.85527000),"
St Thomas More Academy
3109 Spring Forest Road
Raleigh, NC 27616
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Thomas More Academy",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.62201800,35.90176700),"
Stevens Prep Academy
901 Oak Creek Road
Raleigh, NC 27615
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Stevens Prep Academy",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.63323000,35.82943100),"
The Trilogy School
3810 Merton Drive
Raleigh, NC 27609
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Trilogy School",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.69597200,35.91105100),"
Trinity Academy Of Raleigh
10224 Baileywick Road
Raleigh, NC 27613
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Academy Of Raleigh",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.68863900,35.79125700),"
Vital Link Is Cross Link
608 Royal Street
Raleigh, NC 27607
school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Vital Link Is Cross Link",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.66888900,35.70443900),"
Wake Christian Academy
5500 Wake Academy Drive
Raleigh, NC 27603
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wake Christian Academy",'Raleigh=' + Raleigh.length); Raleigh[Raleigh.length] = createMarker(new GPoint(-78.63880000,35.77190000),"
Word Of God Christian Academy
Po Box 14408
Raleigh, NC 27620
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Word Of God Christian Academy",'Raleigh=' + Raleigh.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/////2/' + showArray); map.removeOverlays(Cary); map.removeOverlays(Fuquay_Varina); map.removeOverlays(Fuquay_varina); map.removeOverlays(Holly_Springs); map.removeOverlays(Raleigh); map.removeOverlays(Zebulon); 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(Raleigh);map.removeOverlays(Cary); map.removeOverlays(Fuquay_Varina); map.removeOverlays(Fuquay_varina); map.removeOverlays(Holly_Springs); map.removeOverlays(Raleigh); map.removeOverlays(Zebulon); map.addOverlays(Cary); centerByArray(Cary, false, false); cntMarker += Cary.length; map.addOverlays(Fuquay_Varina); centerByArray(Fuquay_Varina, false, false); cntMarker += Fuquay_Varina.length; map.addOverlays(Fuquay_varina); centerByArray(Fuquay_varina, false, false); cntMarker += Fuquay_varina.length; map.addOverlays(Holly_Springs); centerByArray(Holly_Springs, false, false); cntMarker += Holly_Springs.length; map.addOverlays(Raleigh); centerByArray(Raleigh, false, false); cntMarker += Raleigh.length; map.addOverlays(Zebulon); centerByArray(Zebulon, false, false); cntMarker += Zebulon.length; centerByArray(Raleigh,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=2&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; }