function addMarkers(){ mySelect = document.getElementById('selection'); Louisville = [];mySelect.options[mySelect.options.length] = new Option("Louisville schools",'all=Louisville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Louisville[Louisville.length] = createMarker(new GPoint(-85.56262400,38.19881700),"
Academy For Individual Excellence
3101 Bluebird Lane
Louisville, KY 40299
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Academy For Individual Excellence",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.67825200,38.21715000),"
Assumption High School
2170 Tyler Lane
Louisville, KY 40205
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Assumption High School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.87116700,38.12174100),"
Beth Haven Christian School
5515 Johnsontown Road
Louisville, KY 40272
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beth Haven Christian School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.50071100,38.23381200),"
Chr istian Academy Of Louisville High School
700 S. English Station Rd.
Louisville, KY 40245
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chr istian Academy Of Louisville High School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.50071100,38.23381200),"
Christian Academy Of Louisville School System
700 S English Station Road
Louisville, KY 40245
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Academy Of Louisville School System",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.49273900,38.28565400),"
Covenant Classical Academy
13902 Factory Lane
Louisville, KY 40245
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Covenant Classical Academy",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.77348100,38.16163700),"
De Sales High School
425 Kenwood Drive
Louisville, KY 40214
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("De Sales High School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.70077300,38.14496300),"
Evangel Christian School
5400 Minors Lane
Louisville, KY 40219
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Evangel Christian School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.75117400,38.21366300),"
Families For Christ Chr Academy
2300 Crittenden Dr.
Louisville, KY 40217
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Families For Christ Chr Academy",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.83012100,38.16573000),"
Holy Cross High School
5144 Dixie Highway
Louisville, KY 40216
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Cross High School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.76465900,38.17910000),"
Holy Rosary Academy
4801 Southside Drive
Louisville, KY 40214
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holy Rosary Academy",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.57898900,38.30621100),"
Kentucky Country Day School
4100 Springdale Rd
Louisville, KY 40241
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kentucky Country Day School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.88561200,38.11588600),"
Landmark Christian Academy
6502 Johnsontown Road
Louisville, KY 40272
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Landmark Christian Academy",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.71098100,38.24101500),"
Louisville Collegiate School
2427 Glenmary Ave
Louisville, KY 40204
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Louisville Collegiate School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.69281300,38.20502400),"
Louisville Junior Academy
2988 Newburg Road
Louisville, KY 40205
Co-ed school, K-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Louisville Junior Academy",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.63988700,38.17011100),"
Mercy Academy
5801 Fegenbush Lane
Louisville, KY 40228
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mercy Academy",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.69759600,38.25266600),"
Mother Teresa Academy
201 S Peterson Ave
Louisville, KY 40206
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mother Teresa Academy",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-86.81217700,33.56436300),"
Northside Christian School
2214 Bank Street
Louisville, KY 40212
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northside Christian School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.64871200,38.17958900),"
Nur Islamic School of Louisville
1915 Buechel Bank Road
Louisville, KY 40218
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nur Islamic School of Louisville",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.77395900,38.14056500),"
On Fire Christian Academy
5627 New Cut Road
Louisville, KY 40214
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("On Fire Christian Academy",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.70154000,38.16379600),"
Pitt Academy
6010 Preston Hwy
Louisville, KY 40219
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pitt Academy",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.78900600,38.27062800),"
Portland Christian School
2500 Portland Avenue
Louisville, KY 40212
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Portland Christian School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.75886800,38.24237200),"
Presentation Academy
861 South Fourth Street
Louisville, KY 40203
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Presentation Academy",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.67506800,38.24873700),"
Sacred Heart Academy
3175 Lexington Road
Louisville, KY 40206
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Academy",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.68850300,38.26354800),"
St. Leonard School
440 Zorn Avenue
Louisville, KY 40206
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Leonard School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.72670800,38.21774100),"
Saint Xavier High School
1609 Poplar Level Road
Louisville, KY 40217
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Saint Xavier High School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.75560900,38.24604400),"
St Francis High School
233 W Broadway
Louisville, KY 40202
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Francis High School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.65086100,38.25267400),"
Trinity High School
4011 Shelbyville Road
Louisville, KY 40207
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Trinity High School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.65193900,38.25278500),"
Trinity High School
4011 Shelbyville Road
Louisville, KY 40207
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Trinity High School",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.56630800,38.10672100),"
Valor Traditional Academy
11501 Schlatter Road
Louisville, KY 40291
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valor Traditional Academy",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.61377600,38.13525500),"
Victory Christian Academy
7808 Beulah Church Rd
Louisville, KY 40228
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Victory Christian Academy",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.63829700,38.26163900),"
Walden School Corporation
4238 Westport Road
Louisville, KY 40207
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Walden School Corporation",'Louisville=' + Louisville.length); Louisville[Louisville.length] = createMarker(new GPoint(-85.61799200,38.14021500),"
Whitefield Academy
7711 Fegenbush Lane
Louisville, KY 40228
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Whitefield Academy",'Louisville=' + Louisville.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(Louisville); 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(Louisville);map.removeOverlays(Louisville); map.addOverlays(Louisville); centerByArray(Louisville, false, false); cntMarker += Louisville.length; centerByArray(Louisville,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; }