function addMarkers(){ mySelect = document.getElementById('selection'); Lafayette = [];Carencro = [];Duson = [];Broussard = [];mySelect.options[mySelect.options.length] = new Option("Broussard schools",'all=Broussard'); mySelect.options[mySelect.options.length] = new Option("Carencro schools",'all=Carencro'); mySelect.options[mySelect.options.length] = new Option("Duson schools",'all=Duson'); mySelect.options[mySelect.options.length] = new Option("Lafayette schools",'all=Lafayette'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.09935500,30.17342000),"
Acadiana Christian School
105 Hummingbird Lane
Lafayette, LA 70506
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Acadiana Christian School",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.01766300,30.21972500),"
Ascension Day School
1030 Johnston Street
Lafayette, LA 70501
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ascension Day School",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.01705500,30.22032300),"
Ashton Grace Montessori School
Po Box 52895
Lafayette, LA 70505
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ashton Grace Montessori School",'Lafayette=' + Lafayette.length); Carencro[Carencro.length] = createMarker(new GPoint(-92.05115700,30.31783700),"
Carencro Catholic School
200 W Saint Peter Street
Carencro, LA 70520
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carencro Catholic School",'Carencro=' + Carencro.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.02305800,30.22442700),"
Cathedral Carmel School
848 Saint John Street
Lafayette, LA 70501
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cathedral Carmel School",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.03427800,30.14526900),"
Cornerstone Christian Academy
800 E Farrel Road
Lafayette, LA 70508
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone Christian Academy",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.09652600,30.21046300),"
Family Life Christian Academy
2223 Dulles Drive
Lafayette, LA 70506
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Family Life Christian Academy",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.01996400,30.22156300),"
First Baptist Christian School
201 West Convent Street
Lafayette, LA 70501
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Baptist Christian School",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.07582700,30.18150300),"
Fisher Early Childhood Development Center
230 Ridge Road
Lafayette, LA 70506
school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fisher Early Childhood Development Center",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.00715100,30.22303300),"
Gethsemane Christian Academy
701 E Pinhook Road
Lafayette, LA 70501
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gethsemane Christian Academy",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.02305800,30.23299500),"
Holy Family Catholic School
200 Saint John Street
Lafayette, LA 70501
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Family Catholic School",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.00347500,30.22571400),"
Immaculate Heart Mary School
800 12th Street
Lafayette, LA 70501
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Immaculate Heart Mary School",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.03500100,30.25585000),"
Lafayette Christian Academy
220 Portland Avenue
Lafayette, LA 70507
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lafayette Christian Academy",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.05470500,30.15805400),"
Lafayette Lutheran School
301 W Farrel Road
Lafayette, LA 70508
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lafayette Lutheran School",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.03287700,30.20936200),"
Our Lady Of Fatima School
2315 Johnston Street
Lafayette, LA 70503
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Fatima School",'Lafayette=' + Lafayette.length); Duson[Duson.length] = createMarker(new GPoint(-92.12352600,30.18143300),"
Southside Christian Academy
1136 Ridge Road
Duson, LA 70529
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southside Christian Academy",'Duson=' + Duson.length); Broussard[Broussard.length] = createMarker(new GPoint(-91.96597300,30.14854100),"
St Cecilia School
302 W Main Street
Broussard, LA 70518
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Cecilia School",'Broussard=' + Broussard.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.01184300,30.23195600),"
St Genevieve Elementary School
201 Elizabeth Avenue
Lafayette, LA 70501
Co-ed school, 5-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Genevieve Elementary School",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.01865700,30.18378900),"
St Pius Elementary School
205 East Bayou Parkway
Lafayette, LA 70508
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Pius Elementary School",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.01136000,30.25693700),"
Sts Leo-seton Catholic School
502 Saint Leo Street
Lafayette, LA 70501
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sts Leo-seton Catholic School",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-91.99864000,30.23427600),"
Volunteers Of America Juvenile Day Program
421 Carmel Avenue
Lafayette, LA 70501
Co-ed school, 5-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Volunteers Of America Juvenile Day Program",'Lafayette=' + Lafayette.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-92.06518900,30.13594300),"
Westminster Christian Academy
111 Goshen Lane
Lafayette, LA 70508
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westminster Christian Academy",'Lafayette=' + Lafayette.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/////1/' + showArray); map.removeOverlays(Broussard); map.removeOverlays(Carencro); map.removeOverlays(Duson); map.removeOverlays(Lafayette); 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(Lafayette);map.removeOverlays(Broussard); map.removeOverlays(Carencro); map.removeOverlays(Duson); map.removeOverlays(Lafayette); map.addOverlays(Broussard); centerByArray(Broussard, false, false); cntMarker += Broussard.length; map.addOverlays(Carencro); centerByArray(Carencro, false, false); cntMarker += Carencro.length; map.addOverlays(Duson); centerByArray(Duson, false, false); cntMarker += Duson.length; map.addOverlays(Lafayette); centerByArray(Lafayette, false, false); cntMarker += Lafayette.length; centerByArray(Lafayette,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=1&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; }