function addMarkers(){ mySelect = document.getElementById('selection'); Baker = [];Baton_Rouge = [];Zachary = [];mySelect.options[mySelect.options.length] = new Option("Baker schools",'all=Baker'); mySelect.options[mySelect.options.length] = new Option("Baton Rouge schools",'all=Baton_Rouge'); mySelect.options[mySelect.options.length] = new Option("Zachary schools",'all=Zachary'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Baker[Baker.length] = createMarker(new GPoint(-91.12910500,30.57338300),"
Bethany Christian School
13855 Plank Road
Baker, LA 70714
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethany Christian School",'Baker=' + Baker.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.11339300,30.46599500),"
Brighter Horizon School
1896 Wooddale Blvd
Baton Rouge, LA 70806
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brighter Horizon School",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.04553000,30.40597200),"
The Brighton School
12108 Parkmeadow Avenue
Baton Rouge, LA 70816
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Brighton School",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.15694000,30.44062800),"
Catholic High School
855 Hearthstone Drive
Baton Rouge, LA 70806
All-boys school, 8-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Catholic High School",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-90.99969400,30.46769500),"
Central Baptist School
17017 Florida Blvd
Baton Rouge, LA 70819
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Baptist School",'Baton_Rouge=' + Baton_Rouge.length); Baker[Baker.length] = createMarker(new GPoint(-91.06051100,30.56542100),"
Central Private School
12801 Centerra Court
Baker, LA 70714
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Private School",'Baker=' + Baker.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.18385100,30.42383700),"
Charity Christian Academy
650 West Mckinley Street
Baton Rouge, LA 70802
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charity Christian Academy",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.12966900,30.39979400),"
Christian Life Academy
2037 Quail Drive
Baton Rouge, LA 70808
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Life Academy",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.02689300,30.35620000),"
Cypress Heights Academy
10420 Barringer Foreman Road
Baton Rouge, LA 70809
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cypress Heights Academy",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.08661100,30.38273600),"
The Dunham School
11111 Roy Emerson Drive
Baton Rouge, LA 70810
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Dunham School",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.03727200,30.42330600),"
Episcopal High School
3200 Woodland Ridge Blvd
Baton Rouge, LA 70816
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Episcopal High School",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.09468800,30.38383800),"
Family Christian Academy
8919 World Ministry Avenue
Baton Rouge, LA 70810
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Family Christian Academy",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.01774000,30.37636600),"
Gables Academy
15333 Jefferson Highway
Baton Rouge, LA 70817
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gables Academy",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.11415900,30.48898100),"
God's Way Christian Academy
7513 Prescott Road
Baton Rouge, LA 70812
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("God's Way Christian Academy",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.09162100,30.44258100),"
Hosanna Christian Academy
8850 Goodwood Blvd
Baton Rouge, LA 70806
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hosanna Christian Academy",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.14064900,30.50223700),"
Jehova-Jireh Christian Academy
5045 Greenwell St
Baton Rouge, LA 70805
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jehova-Jireh Christian Academy",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.02424000,30.44529800),"
Millerville Academy
871 ONeal Lane
Baton Rouge, LA 70816
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Millerville Academy",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.04941100,30.39882900),"
Parkview Baptist School
5750 Parkview Church Road
Baton Rouge, LA 70816
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parkview Baptist School",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.14932400,30.49727500),"
Redemptorist High School
4000 St. Gerard
Baton Rouge, LA 70805
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Redemptorist High School",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.06831000,30.37893800),"
St. George School
7880 Saint George Drive
Baton Rouge, LA 70809
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. George School",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.15713800,30.43606100),"
St. Josephs Academy
3015 Broussard Street
Baton Rouge, LA 70808
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("St. Josephs Academy",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-90.98150000,30.37330000),"
St Michael The Archangel High School
17521 Monitor Avenue
Baton Rouge, LA 70817
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Michael The Archangel High School",'Baton_Rouge=' + Baton_Rouge.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.05409900,30.54380700),"
Starkey Academy
10510 Joor Road
Baton Rouge, LA 70818
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Starkey Academy",'Baton_Rouge=' + Baton_Rouge.length); Zachary[Zachary.length] = createMarker(new GPoint(-91.15861900,30.65051800),"
Trinity Christian Academy
4315d Church Street
Zachary, LA 70791
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Christian Academy",'Zachary=' + Zachary.length); Baton_Rouge[Baton_Rouge.length] = createMarker(new GPoint(-91.16554000,30.47524100),"
Vision City
3000 Tecumseh St
Baton Rouge, LA 70805
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Vision City",'Baton_Rouge=' + Baton_Rouge.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(Baker); map.removeOverlays(Baton_Rouge); map.removeOverlays(Zachary); 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(Baker);map.removeOverlays(Baker); map.removeOverlays(Baton_Rouge); map.removeOverlays(Zachary); map.addOverlays(Baker); centerByArray(Baker, false, false); cntMarker += Baker.length; map.addOverlays(Baton_Rouge); centerByArray(Baton_Rouge, false, false); cntMarker += Baton_Rouge.length; map.addOverlays(Zachary); centerByArray(Zachary, false, false); cntMarker += Zachary.length; centerByArray(Baker,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; }