function addMarkers(){ mySelect = document.getElementById('selection'); Charlotte = [];Matthews = [];Huntersville = [];Davidson = [];Cornelius = [];mySelect.options[mySelect.options.length] = new Option("Charlotte schools",'all=Charlotte'); mySelect.options[mySelect.options.length] = new Option("Cornelius schools",'all=Cornelius'); mySelect.options[mySelect.options.length] = new Option("Davidson schools",'all=Davidson'); mySelect.options[mySelect.options.length] = new Option("Huntersville schools",'all=Huntersville'); mySelect.options[mySelect.options.length] = new Option("Matthews schools",'all=Matthews'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.78731500,35.17880500),"
Adventist Christian Academy
4601 Emory Lane
Charlotte, NC 28211
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Adventist Christian Academy",'Charlotte=' + Charlotte.length); Matthews[Matthews.length] = createMarker(new GPoint(-80.72990400,35.16026600),"
Bible Baptist Christian School
2724 Margaret Wallace Road
Matthews, NC 28105
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bible Baptist Christian School",'Matthews=' + Matthews.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84014100,35.30026400),"
Brisbane Academy
5901 Statesville Rd
Charlotte, NC 28269
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brisbane Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.97725100,35.11639700),"
Cathedral Of The Cross Chr School
13925 Erwin Rd.
Charlotte, NC 28273
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cathedral Of The Cross Chr School",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.88921200,35.23768700),"
Character Builders Christian Academy
1200 Alleghany Street
Charlotte, NC 28208
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Character Builders Christian Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84838800,35.08783700),"
Charlotte Catholic High School
7702 Pineville Matthews Road
Charlotte, NC 28226
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charlotte Catholic High School",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.77080800,35.14148900),"
Charlotte Christian School
7301 Sardis Road
Charlotte, NC 28270
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charlotte Christian School",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.80198800,35.14776500),"
Charlotte Country Day School
1440 Carmel Road
Charlotte, NC 28226
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charlotte Country Day School",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.82496700,35.21478500),"
Charlotte Islamic School
1615 E 5th Street
Charlotte, NC 28204
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charlotte Islamic School",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84584100,35.23140200),"
Charlotte Jewish Day School
Po Box 79180
Charlotte, NC 28271
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charlotte Jewish Day School",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.77244600,35.08042800),"
Charlotte Latin School
9502 Providence Road
Charlotte, NC 28277
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charlotte Latin School",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.77069500,35.14773100),"
Charlotte Preparatory School
212 Boyce Road
Charlotte, NC 28211
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charlotte Preparatory School",'Charlotte=' + Charlotte.length); Huntersville[Huntersville.length] = createMarker(new GPoint(-80.85527800,35.42349300),"
Christian Montessori School At Lake Norman
14101 Stumptown Road
Huntersville, NC 28078
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Montessori School At Lake Norman",'Huntersville=' + Huntersville.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.77308700,35.32654900),"
Countryside Montessori School
9026 Mallard Creek Road
Charlotte, NC 28262
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Countryside Montessori School",'Charlotte=' + Charlotte.length); Matthews[Matthews.length] = createMarker(new GPoint(-80.73113100,35.11037300),"
Covenant Day School
800 Fullwood Lane
Matthews, NC 28105
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Covenant Day School",'Matthews=' + Matthews.length); Davidson[Davidson.length] = createMarker(new GPoint(-80.86117700,35.50338100),"
Davidson Day School
750 Jetton Street
Davidson, NC 28036
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Davidson Day School",'Davidson=' + Davidson.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.79218100,35.29613800),"
Derita Christian Academy
6401 Rumple Road
Charlotte, NC 28262
Co-ed school, 2-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Derita Christian Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.82022200,35.18366200),"
Dore Academy
1727 Providence Rd
Charlotte, NC 28207
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dore Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.83753200,35.22249400),"
Elite Academy
Po Box 26041
Charlotte, NC 28221
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elite Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.75701800,35.17404700),"
Evelyn Mack Academy
6850 Monroe Road
Charlotte, NC 28212
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Evelyn Mack Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.75724600,35.12936700),"
The Fletcher School
8500 Sardis Road
Charlotte, NC 28270
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Fletcher School",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.74555100,35.17016800),"
Garr Christian Academy
7700 Wallace Road
Charlotte, NC 28212
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Garr Christian Academy",'Charlotte=' + Charlotte.length); Cornelius[Cornelius.length] = createMarker(new GPoint(-80.86709000,35.45003700),"
Grace Covenant Academy
17301 Statesville Road
Cornelius, NC 28031
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Covenant Academy",'Cornelius=' + Cornelius.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.77043000,35.21518300),"
Heritage Christian School
3001 Kilborne Drive
Charlotte, NC 28205
Co-ed school, KG-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian School",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.72602700,35.22254300),"
Hickory Grove Baptist Christian
6050 Hickory Grove Road
Charlotte, NC 28215
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hickory Grove Baptist Christian",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.87395500,35.11784200),"
The Keys Of Carolina
1715 Sharon Road W
Charlotte, NC 28210
Co-ed school, 6-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Keys Of Carolina",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.98351700,35.25242500),"
Liberty Baptist Academy
3000 Sam Wilson Road
Charlotte, NC 28214
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Liberty Baptist Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.84282300,35.09307100),"
The Manus Academy
6203 Carmel Road
Charlotte, NC 28226
Co-ed school, 4-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Manus Academy",'Charlotte=' + Charlotte.length); Cornelius[Cornelius.length] = createMarker(new GPoint(-80.89020800,35.46855600),"
New Beginnings Christian Academy
18731 W Catawba Avenue
Cornelius, NC 28031
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Beginnings Christian Academy",'Cornelius=' + Cornelius.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.83881600,35.25768000),"
New Life Christian Academy
1337 Samuel Street
Charlotte, NC 28206
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Life Christian Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.78377600,35.28316900),"
Northside Christian Academy
333 Jeremiah Blvd
Charlotte, NC 28262
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northside Christian Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.91113300,35.24837400),"
Paw Creek Christian Academy
5110 Tuckaseegee Road
Charlotte, NC 28208
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Paw Creek Christian Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.73820500,35.25723200),"
Plaza Road Academy
7041 The Plaza
Charlotte, NC 28215
Co-ed school, 4-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Plaza Road Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.83080000,35.22300000),"
Presbyterian Academy
Po Box 33549
Charlotte, NC 28233
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Presbyterian Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.79665000,35.21053800),"
Resurrection Christian School
2940 Commonwealth Avenue
Charlotte, NC 28205
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Resurrection Christian School",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.92298000,35.15569800),"
Rod Of God Christian Academy
7300 S Tryon St
Charlotte, NC 28217
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rod Of God Christian Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.68166000,35.06282000),"
Sonrise Christian Academy
4300 Mckee Road
Charlotte, NC 28270
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sonrise Christian Academy",'Charlotte=' + Charlotte.length); Huntersville[Huntersville.length] = createMarker(new GPoint(-80.93501700,35.42942000),"
South Lake Christian Academy
13901 Haggers Fairy Rd
Huntersville, NC 28078
Co-ed school, KG-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Lake Christian Academy",'Huntersville=' + Huntersville.length); Huntersville[Huntersville.length] = createMarker(new GPoint(-80.93501700,35.42942000),"
Southlake Christian Academy
13901 Haggers Fairy Rd
Huntersville, NC 28078
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southlake Christian Academy",'Huntersville=' + Huntersville.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.73471000,35.15789300),"
Trinity Christian Preparatory School
7516 East Independence Blvd Suite 100
Charlotte, NC 28227
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Christian Preparatory School",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.77544000,35.09075900),"
United Faith Christian Academy
8617 Providence Road
Charlotte, NC 28277
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("United Faith Christian Academy",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.87801300,35.14205900),"
Victory Christian Center
7224 Old Pineville Road
Charlotte, NC 28217
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Victory Christian Center",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.87630000,35.15030000),"
Victory Christian Center School.
1501 Carrier Drive
Charlotte, NC 28216
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Victory Christian Center School.",'Charlotte=' + Charlotte.length); Charlotte[Charlotte.length] = createMarker(new GPoint(-80.97735800,35.11643600),"
Walnut Grove Christian School
13925 Erwin Road
Charlotte, NC 28273
Co-ed school, K-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Walnut Grove Christian School",'Charlotte=' + Charlotte.length); Davidson[Davidson.length] = createMarker(new GPoint(-80.82309700,35.49058900),"
Woodlawn School
P.O. Box 549
Davidson, NC 28036
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodlawn School",'Davidson=' + Davidson.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(Charlotte); map.removeOverlays(Cornelius); map.removeOverlays(Davidson); map.removeOverlays(Huntersville); map.removeOverlays(Matthews); 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(Charlotte);map.removeOverlays(Charlotte); map.removeOverlays(Cornelius); map.removeOverlays(Davidson); map.removeOverlays(Huntersville); map.removeOverlays(Matthews); map.addOverlays(Charlotte); centerByArray(Charlotte, false, false); cntMarker += Charlotte.length; map.addOverlays(Cornelius); centerByArray(Cornelius, false, false); cntMarker += Cornelius.length; map.addOverlays(Davidson); centerByArray(Davidson, false, false); cntMarker += Davidson.length; map.addOverlays(Huntersville); centerByArray(Huntersville, false, false); cntMarker += Huntersville.length; map.addOverlays(Matthews); centerByArray(Matthews, false, false); cntMarker += Matthews.length; centerByArray(Charlotte,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; }