function addMarkers() { mySelect = document.getElementById('selection'); Marianna = [];Cottondale = [];Graceville = [];Grand_Ridge = [];Malone = [];Sneads = [];mySelect.options[mySelect.options.length] = new Option("Cottondale schools",'all=Cottondale'); mySelect.options[mySelect.options.length] = new Option("Graceville schools",'all=Graceville'); mySelect.options[mySelect.options.length] = new Option("Grand Ridge schools",'all=Grand_Ridge'); mySelect.options[mySelect.options.length] = new Option("Malone schools",'all=Malone'); mySelect.options[mySelect.options.length] = new Option("Marianna schools",'all=Marianna'); mySelect.options[mySelect.options.length] = new Option("Sneads schools",'all=Sneads'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Marianna[Marianna.length] = createMarker(new GPoint(-85.25273132,30.77798080),"
Challenge For Success Elementary School
4685 Meadowview Road
Marianna, FL 32448

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Challenge For Success Elementary School",'Marianna=' + Marianna.length); Cottondale[Cottondale.length] = createMarker(new GPoint(-85.36790466,30.79243660),"
Cottondale Elementary School
2766 Levy Street
Cottondale, FL 32431

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cottondale Elementary School",'Cottondale=' + Cottondale.length); Cottondale[Cottondale.length] = createMarker(new GPoint(-85.37374115,30.79243660),"
Cottondale High School
2680 Levy Street
Cottondale, FL 32431

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cottondale High School",'Cottondale=' + Cottondale.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.23010254,30.85350037),"
County Superintendent's Office
P.o. Box 5958
Marianna, FL 32447

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("County Superintendent's Office",'Marianna=' + Marianna.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.18875885,30.71164703),"
Dist Wide Homebound Program
2903 Jefferson Street
Marianna, FL 32446

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dist Wide Homebound Program",'Marianna=' + Marianna.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.22682400,30.77538000),"
Dist Wide Visually Handicapped
2903 Jefferson Street
Marianna, FL 32446

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dist Wide Visually Handicapped",'Marianna=' + Marianna.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.25317383,30.76485634),"
Dozier Ii
P O Box 490
Marianna, FL 32447

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dozier Ii",'Marianna=' + Marianna.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.25317383,30.76485634),"
Dozier Training School For Boys
P O Box 490
Marianna, FL 32447

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dozier Training School For Boys",'Marianna=' + Marianna.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.23957825,30.78346252),"
Family Services Center
4283 Kelson Avenue
Marianna, FL 32446

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Family Services Center",'Marianna=' + Marianna.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.24208832,30.78473663),"
Frank M. Golson Elementary School
4258 2nd Avenue
Marianna, FL 32446

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Frank M. Golson Elementary School",'Marianna=' + Marianna.length); Graceville[Graceville.length] = createMarker(new GPoint(-85.51734161,30.95683861),"
Graceville Elementary School
5331 Alabama Street
Graceville, FL 32440

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Graceville Elementary School",'Graceville=' + Graceville.length); Graceville[Graceville.length] = createMarker(new GPoint(-85.50650024,30.97075462),"
Graceville High School
5539 Brown Street
Graceville, FL 32440

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Graceville High School",'Graceville=' + Graceville.length); Graceville[Graceville.length] = createMarker(new GPoint(-85.51419830,30.93619919),"
Graceville Vocational Youth Center
P O Box 35
Graceville, FL 32440

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Graceville Vocational Youth Center",'Graceville=' + Graceville.length); Grand_Ridge[Grand_Ridge.length] = createMarker(new GPoint(-85.00915527,30.70844650),"
Grand Ridge High School
6925 Florida Street
Grand Ridge, FL 32442

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grand Ridge High School",'Grand_Ridge=' + Grand_Ridge.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.18875885,30.71164703),"
Hope School
2031 Hope School Drive
Marianna, FL 32448

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hope School",'Marianna=' + Marianna.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.26261139,30.76226616),"
Jackson Academy
2701 Technology Circle
Marianna, FL 32448

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jackson Academy",'Marianna=' + Marianna.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.17189500,30.82892500),"
Jackson County School-sunland
3700 Connally Drive
Marianna, FL 32446

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jackson County School-sunland",'Marianna=' + Marianna.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.22682400,30.77538000),"
Jackson County Superintendent's Office
0p O Box 5958
Marianna, FL 32447

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jackson County Superintendent's Office",'Marianna=' + Marianna.length); Malone[Malone.length] = createMarker(new GPoint(-85.16919708,30.96599960),"
Malone High School
P O Box 68
Malone, FL 32445

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Malone High School",'Malone=' + Malone.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.23622131,30.78242111),"
Marianna High School
2979 Daniel Street
Marianna, FL 32446

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marianna High School",'Marianna=' + Marianna.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.25083923,30.76658630),"
Marianna Middle School
4144 South Street
Marianna, FL 32448

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Marianna Middle School",'Marianna=' + Marianna.length); Marianna[Marianna.length] = createMarker(new GPoint(-85.21623993,30.77953720),"
Riverside Elementary School
2958 Cherokee Street
Marianna, FL 32446

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverside Elementary School",'Marianna=' + Marianna.length); Sneads[Sneads.length] = createMarker(new GPoint(-84.94155884,30.70655251),"
Sneads Elementary School
1961 Lockey Drive
Sneads, FL 32460

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sneads Elementary School",'Sneads=' + Sneads.length); Sneads[Sneads.length] = createMarker(new GPoint(-84.92160034,30.70863724),"
Sneads High School
8066 Old Spanish Trail
Sneads, FL 32460

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sneads High School",'Sneads=' + Sneads.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,10); /* 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(Cottondale); map.removeOverlays(Graceville); map.removeOverlays(Grand_Ridge); map.removeOverlays(Malone); map.removeOverlays(Marianna); map.removeOverlays(Sneads); 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(Marianna);map.removeOverlays(Cottondale); map.removeOverlays(Graceville); map.removeOverlays(Grand_Ridge); map.removeOverlays(Malone); map.removeOverlays(Marianna); map.removeOverlays(Sneads); map.addOverlays(Cottondale); centerByArray(Cottondale, false, false); cntMarker += Cottondale.length; map.addOverlays(Graceville); centerByArray(Graceville, false, false); cntMarker += Graceville.length; map.addOverlays(Grand_Ridge); centerByArray(Grand_Ridge, false, false); cntMarker += Grand_Ridge.length; map.addOverlays(Malone); centerByArray(Malone, false, false); cntMarker += Malone.length; map.addOverlays(Marianna); centerByArray(Marianna, false, false); cntMarker += Marianna.length; map.addOverlays(Sneads); centerByArray(Sneads, false, false); cntMarker += Sneads.length; centerByArray(Marianna,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'); } }