function addMarkers(){ mySelect = document.getElementById('selection'); Nashville = [];Old_Hickory = [];Antioch = [];Madison = [];Mount_Juliet = [];Brentwood = [];Whites_Creek = [];mySelect.options[mySelect.options.length] = new Option("Antioch schools",'all=Antioch'); mySelect.options[mySelect.options.length] = new Option("Brentwood schools",'all=Brentwood'); mySelect.options[mySelect.options.length] = new Option("Madison schools",'all=Madison'); mySelect.options[mySelect.options.length] = new Option("Mount Juliet schools",'all=Mount_Juliet'); mySelect.options[mySelect.options.length] = new Option("Nashville schools",'all=Nashville'); mySelect.options[mySelect.options.length] = new Option("Old Hickory schools",'all=Old_Hickory'); mySelect.options[mySelect.options.length] = new Option("Whites Creek schools",'all=Whites_Creek'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Nashville[Nashville.length] = createMarker(new GPoint(-86.70398400,36.03633300),"
Cedarcreek Schoolhouse Academy
621 Berry Road
Nashville, TN 37204
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cedarcreek Schoolhouse Academy",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.87810600,36.05048000),"
Christ Presbyterian Academy
2323a Old Hickory Blvd
Nashville, TN 37215
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ Presbyterian Academy",'Nashville=' + Nashville.length); Old_Hickory[Old_Hickory.length] = createMarker(new GPoint(-86.62699600,36.22528100),"
Christian Life Academy
119 Center St.
Old Hickory, TN 37138
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Life Academy",'Old_Hickory=' + Old_Hickory.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.73629600,36.10991600),"
Community High School
145 Thompson Ln.
Nashville, TN 37211
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Community High School",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.79504400,36.10646200),"
David Lipscomb Campus School
3901 Granny White Pike
Nashville, TN 37204
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("David Lipscomb Campus School",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.77533400,36.27941200),"
Davidson Academy
1414 Old Hickory Blvd
Nashville, TN 37207
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Davidson Academy",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.64965500,36.18188200),"
Donelson Christian Academy
300 Danyacrest Drive
Nashville, TN 37214
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Donelson Christian Academy",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.83993800,36.12439700),"
The Ensworth School
211 Ensworth Place
Nashville, TN 37205
Co-ed school, K-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Ensworth School",'Nashville=' + Nashville.length); Antioch[Antioch.length] = createMarker(new GPoint(-86.63676500,36.06542300),"
Ezell-Harding Christian School
574 Bell Road
Antioch, TN 37013
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ezell-Harding Christian School",'Antioch=' + Antioch.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.76836900,36.09923600),"
Father Ryan High School
700 Norwood Drive
Nashville, TN 37204
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Father Ryan High School",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.77218900,36.08321100),"
Franklin Road Academy
4700 Franklin Pike
Nashville, TN 37220
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Franklin Road Academy",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.74106600,36.09598100),"
Genesis Lc/genesis Academy
430 Allied Drive
Nashville, TN 37211
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Genesis Lc/genesis Academy",'Nashville=' + Nashville.length); Madison[Madison.length] = createMarker(new GPoint(-86.73740700,36.24936700),"
Goodpasture Christian School
619 W Due West Avenue
Madison, TN 37115
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Goodpasture Christian School",'Madison=' + Madison.length); Madison[Madison.length] = createMarker(new GPoint(-86.74158700,36.24995700),"
Goodpasture High School
619 Due West Avenue
Madison, TN 37115
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Goodpasture High School",'Madison=' + Madison.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.83864700,36.10302700),"
Harpeth Hall School
3801 Hobbs Road
Nashville, TN 37215
All-girls school, 5-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Harpeth Hall School",'Nashville=' + Nashville.length); Mount_Juliet[Mount_Juliet.length] = createMarker(new GPoint(-86.51915200,36.19877000),"
Heritage Christian Academy - Mt. Juliet
Po Box 1135
Mount Juliet, TN 37121
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian Academy - Mt. Juliet",'Mount_Juliet=' + Mount_Juliet.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.77850200,36.14142800),"
Hermitage Hall
1220 8th Avenue South
Nashville, TN 37203
All-boys school, 4-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hermitage Hall",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.83987700,36.20204900),"
Institute Of Learning Resea
3808 Clarksville Pike
Nashville, TN 37218
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Institute Of Learning Resea",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.74855900,36.12578700),"
Jesus Only Academy
324 Glenrose Avenue
Nashville, TN 37210
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jesus Only Academy",'Nashville=' + Nashville.length); Antioch[Antioch.length] = createMarker(new GPoint(-86.67296500,36.05243900),"
Lighthouse Christian School
5100 Blue Hole Road
Antioch, TN 37013
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lighthouse Christian School",'Antioch=' + Antioch.length); Madison[Madison.length] = createMarker(new GPoint(-86.70630000,36.26230000),"
Madison Academy
Po Box 6257
Madison, TN 37116
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Madison Academy",'Madison=' + Madison.length); Madison[Madison.length] = createMarker(new GPoint(-86.69763600,36.25309400),"
Metro Christian Academy
730 Neely''s Bend Road
Madison, TN 37115
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Metro Christian Academy",'Madison=' + Madison.length); Brentwood[Brentwood.length] = createMarker(new GPoint(-86.74678600,36.03057100),"
Montessori Academy
6021 Cloverland Drive
Brentwood, TN 37027
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Academy",'Brentwood=' + Brentwood.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.83785200,36.13020800),"
Montgomery Bell Academy
4001 Harding Road
Nashville, TN 37205
All-boys school, 7-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Montgomery Bell Academy",'Nashville=' + Nashville.length); Antioch[Antioch.length] = createMarker(new GPoint(-86.68466200,36.07404700),"
Nashville Academy
127 Rader Dr
Antioch, TN 37013
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nashville Academy",'Antioch=' + Antioch.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.93009000,36.10821900),"
Nashville Christian School
7555 Sawyer Brown Road
Nashville, TN 37221
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nashville Christian School",'Nashville=' + Nashville.length); Whites_Creek[Whites_Creek.length] = createMarker(new GPoint(-86.77671600,36.29367400),"
Pioneer Christian Academy
4479 Jackson Road
Whites Creek, TN 37189
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pioneer Christian Academy",'Whites_Creek=' + Whites_Creek.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.80318300,36.13876500),"
Psychiatric Hospital At Vander
1601 23rd Ave S
Nashville, TN 37212
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Psychiatric Hospital At Vander",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.74089100,36.10280300),"
Radnor Baptist Academy
3112 Nolensville Road
Nashville, TN 37211
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Radnor Baptist Academy",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.84124800,36.12917900),"
St. Cecilia Academy
4210 Harding Road
Nashville, TN 37205
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("St. Cecilia Academy",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.73990000,36.18100000),"
Teach-timothy Endeavo Academy Chr
Po Box 60603
Nashville, TN 37206
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Teach-timothy Endeavo Academy Chr",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.79859200,36.14409300),"
University School Of Nashville
2000 Edgehill Avenue
Nashville, TN 37212
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("University School Of Nashville",'Nashville=' + Nashville.length); Nashville[Nashville.length] = createMarker(new GPoint(-86.78893700,36.17404800),"
Wallace Academy
1101 6th Avenue North
Nashville, TN 37208
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wallace Academy",'Nashville=' + Nashville.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(Antioch); map.removeOverlays(Brentwood); map.removeOverlays(Madison); map.removeOverlays(Mount_Juliet); map.removeOverlays(Nashville); map.removeOverlays(Old_Hickory); map.removeOverlays(Whites_Creek); 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(Nashville);map.removeOverlays(Antioch); map.removeOverlays(Brentwood); map.removeOverlays(Madison); map.removeOverlays(Mount_Juliet); map.removeOverlays(Nashville); map.removeOverlays(Old_Hickory); map.removeOverlays(Whites_Creek); map.addOverlays(Antioch); centerByArray(Antioch, false, false); cntMarker += Antioch.length; map.addOverlays(Brentwood); centerByArray(Brentwood, false, false); cntMarker += Brentwood.length; map.addOverlays(Madison); centerByArray(Madison, false, false); cntMarker += Madison.length; map.addOverlays(Mount_Juliet); centerByArray(Mount_Juliet, false, false); cntMarker += Mount_Juliet.length; map.addOverlays(Nashville); centerByArray(Nashville, false, false); cntMarker += Nashville.length; map.addOverlays(Old_Hickory); centerByArray(Old_Hickory, false, false); cntMarker += Old_Hickory.length; map.addOverlays(Whites_Creek); centerByArray(Whites_Creek, false, false); cntMarker += Whites_Creek.length; centerByArray(Nashville,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; }