function addMarkers(){ mySelect = document.getElementById('selection'); New_Orleans = [];Grand_Coteau = [];Gretna = [];Metairie = [];Shreveport = [];Marrero = [];Baton_Rouge = [];Covington = [];Jena = [];mySelect.options[mySelect.options.length] = new Option("Baton Rouge schools",'all=Baton_Rouge'); mySelect.options[mySelect.options.length] = new Option("Covington schools",'all=Covington'); mySelect.options[mySelect.options.length] = new Option("Grand Coteau schools",'all=Grand_Coteau'); mySelect.options[mySelect.options.length] = new Option("Gretna schools",'all=Gretna'); mySelect.options[mySelect.options.length] = new Option("Jena schools",'all=Jena'); mySelect.options[mySelect.options.length] = new Option("Marrero schools",'all=Marrero'); mySelect.options[mySelect.options.length] = new Option("Metairie schools",'all=Metairie'); mySelect.options[mySelect.options.length] = new Option("New Orleans schools",'all=New_Orleans'); mySelect.options[mySelect.options.length] = new Option("Shreveport schools",'all=Shreveport'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); New_Orleans[New_Orleans.length] = createMarker(new GPoint(-90.10365200,29.92660800),"
Academy Of The Sacred Heart
4521 Saint Charles Avenue
New Orleans, LA 70115
All-girls school, PK-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Academy Of The Sacred Heart",'New_Orleans=' + New_Orleans.length); Grand_Coteau[Grand_Coteau.length] = createMarker(new GPoint(-92.04747300,30.41726800),"
Academy Of The Sacred Heart
Po Box 310
Grand Coteau, LA 70541
All-girls school, PK-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Academy Of The Sacred Heart",'Grand_Coteau=' + Grand_Coteau.length); Gretna[Gretna.length] = createMarker(new GPoint(-90.04535700,29.91016300),"
Archbishop Blenk High School
17 Gretna Boulevard
Gretna, LA 70053
All-girls school, 8-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Archbishop Blenk High School",'Gretna=' + Gretna.length); Metairie[Metairie.length] = createMarker(new GPoint(-90.22330100,30.00538400),"
Archbishop Chapelle High School
8800 Veterans Memorial Blvd
Metairie, LA 70003
All-girls school, 8-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Archbishop Chapelle High School",'Metairie=' + Metairie.length); New_Orleans[New_Orleans.length] = createMarker(new GPoint(-90.08851100,29.98139400),"
Cabrini High School
1400 Moss Street
New Orleans, LA 70119
All-girls school, 8-8
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cabrini High School",'New_Orleans=' + New_Orleans.length); Shreveport[Shreveport.length] = createMarker(new GPoint(-93.74727400,32.51461500),"
Grace Christian Academy
Po Box 44171
Shreveport, LA 71134
All-girls school, 7-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Grace Christian Academy",'Shreveport=' + Shreveport.length); Marrero[Marrero.length] = createMarker(new GPoint(-90.09676400,29.90191600),"
Immaculata High School
537 Avenue D
Marrero, LA 70072
All-girls school, 5-8
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Immaculata High School",'Marrero=' + Marrero.length); New_Orleans[New_Orleans.length] = createMarker(new GPoint(-90.08122900,29.93207800),"
Louise S. McGehee School
2343 Prytania Street
New Orleans, LA 70130
All-girls school, PK-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Louise S. McGehee School",'New_Orleans=' + New_Orleans.length); New_Orleans[New_Orleans.length] = createMarker(new GPoint(-90.11063900,30.01823200),"
Mount Carmel Academy
7027 Milne Blvd
New Orleans, LA 70124
All-girls school, 8-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mount Carmel Academy",'New_Orleans=' + New_Orleans.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); New_Orleans[New_Orleans.length] = createMarker(new GPoint(-90.00752500,30.01161100),"
St. Mary S Academy
6905 Chef Menteur Hwy
New Orleans, LA 70126
All-girls school, 6-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("St. Mary S Academy",'New_Orleans=' + New_Orleans.length); New_Orleans[New_Orleans.length] = createMarker(new GPoint(-90.11420500,29.95650000),"
St. Marys Dominican High School
7701 Walmsley Avenue
New Orleans, LA 70125
All-girls school, 8-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("St. Marys Dominican High School",'New_Orleans=' + New_Orleans.length); Covington[Covington.length] = createMarker(new GPoint(-90.10080000,30.47520000),"
St. Scholastica Academy
Po Box 1210
Covington, LA 70434
All-girls school, 8-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("St. Scholastica Academy",'Covington=' + Covington.length); Jena[Jena.length] = createMarker(new GPoint(-92.11231900,31.69129000),"
Temple Christian Academy
5933 Aimwell Road
Jena, LA 71342
All-girls school, PK-7
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Temple Christian Academy",'Jena=' + Jena.length); New_Orleans[New_Orleans.length] = createMarker(new GPoint(-90.11391400,29.94130700),"
Ursuline Academy Elementary School
2635 State Street
New Orleans, LA 70118
All-girls school, PK-7
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ursuline Academy Elementary School",'New_Orleans=' + New_Orleans.length); New_Orleans[New_Orleans.length] = createMarker(new GPoint(-90.11391400,29.94130700),"
Ursuline Academy High School
2635 State Street
New Orleans, LA 70118
All-girls school, 8-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ursuline Academy High School",'New_Orleans=' + New_Orleans.length); map.removeOverlays(Baton_Rouge); map.removeOverlays(Covington); map.removeOverlays(Grand_Coteau); map.removeOverlays(Gretna); map.removeOverlays(Jena); map.removeOverlays(Marrero); map.removeOverlays(Metairie); map.removeOverlays(New_Orleans); map.removeOverlays(Shreveport); setTimeout(function(){map.addOverlays(Baton_Rouge)},1000); setTimeout(function(){map.addOverlays(Covington)},1000); setTimeout(function(){map.addOverlays(Grand_Coteau)},1000); setTimeout(function(){map.addOverlays(Gretna)},1000); setTimeout(function(){map.addOverlays(Jena)},1000); setTimeout(function(){map.addOverlays(Marrero)},1000); setTimeout(function(){map.addOverlays(Metairie)},1000); setTimeout(function(){map.addOverlays(New_Orleans)},1000); setTimeout(function(){map.addOverlays(Shreveport)},1000); maxLng = -90.00752500; maxLat = 32.51461500; minLng = -93.74727400; minLat = 29.90191600; reCenterMap(); } // 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//////' + showArray); map.removeOverlays(Baton_Rouge); map.removeOverlays(Covington); map.removeOverlays(Grand_Coteau); map.removeOverlays(Gretna); map.removeOverlays(Jena); map.removeOverlays(Marrero); map.removeOverlays(Metairie); map.removeOverlays(New_Orleans); map.removeOverlays(Shreveport); 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(New_Orleans);map.removeOverlays(Baton_Rouge); map.removeOverlays(Covington); map.removeOverlays(Grand_Coteau); map.removeOverlays(Gretna); map.removeOverlays(Jena); map.removeOverlays(Marrero); map.removeOverlays(Metairie); map.removeOverlays(New_Orleans); map.removeOverlays(Shreveport); map.addOverlays(Baton_Rouge); centerByArray(Baton_Rouge, false, false); cntMarker += Baton_Rouge.length; map.addOverlays(Covington); centerByArray(Covington, false, false); cntMarker += Covington.length; map.addOverlays(Grand_Coteau); centerByArray(Grand_Coteau, false, false); cntMarker += Grand_Coteau.length; map.addOverlays(Gretna); centerByArray(Gretna, false, false); cntMarker += Gretna.length; map.addOverlays(Jena); centerByArray(Jena, false, false); cntMarker += Jena.length; map.addOverlays(Marrero); centerByArray(Marrero, false, false); cntMarker += Marrero.length; map.addOverlays(Metairie); centerByArray(Metairie, false, false); cntMarker += Metairie.length; map.addOverlays(New_Orleans); centerByArray(New_Orleans, false, false); cntMarker += New_Orleans.length; map.addOverlays(Shreveport); centerByArray(Shreveport, false, false); cntMarker += Shreveport.length; centerByArray(New_Orleans,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///11791,11828,11482,11492,11493,11481,11667,11805,11807,11865,32441,11482,33558,11620,11481,11525,35970,11805,11864,/all'); //window.open('/map.php?type=2&schools=11791,11828,11482,11492,11493,11481,11667,11805,11807,11865,32441,11482,33558,11620,11481,11525,35970,11805,11864,&school_level=&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; }