function addMarkers() { mySelect = document.getElementById('selection'); Sebring = [];Avon_Park = [];Venus = [];Lake_Placid = [];mySelect.options[mySelect.options.length] = new Option("Avon Park schools",'all=Avon_Park'); mySelect.options[mySelect.options.length] = new Option("Lake Placid schools",'all=Lake_Placid'); mySelect.options[mySelect.options.length] = new Option("Sebring schools",'all=Sebring'); mySelect.options[mySelect.options.length] = new Option("Venus schools",'all=Venus'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Sebring[Sebring.length] = createMarker(new GPoint(-81.42267609,27.47846222),"
Academy At Youth Care Lane
4121 Youth Care Lane
Sebring, FL 33870

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Academy At Youth Care Lane",'Sebring=' + Sebring.length); Sebring[Sebring.length] = createMarker(new GPoint(-81.42267609,27.47846222),"
Achievement Center (formerly Sims Teen Learning Ce
4121 Youth Care Lane
Sebring, FL 33870

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Achievement Center (formerly Sims Teen Learning Ce",'Sebring=' + Sebring.length); Avon_Park[Avon_Park.length] = createMarker(new GPoint(-81.50854492,27.60266304),"
Avon Elementary School
705 W Winthrop Street
Avon Park, FL 33825

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Avon Elementary School",'Avon_Park=' + Avon_Park.length); Avon_Park[Avon_Park.length] = createMarker(new GPoint(-81.48874664,27.59546280),"
Avon Park High School
700 E Main Street
Avon Park, FL 33825

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Avon Park High School",'Avon_Park=' + Avon_Park.length); Avon_Park[Avon_Park.length] = createMarker(new GPoint(-81.50194550,27.59185791),"
Avon Park Middle School
401 S Lake Avenue
Avon Park, FL 33825

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Avon Park Middle School",'Avon_Park=' + Avon_Park.length); Avon_Park[Avon_Park.length] = createMarker(new GPoint(-81.44905090,27.58521080),"
Avon Park Youth Developmental Center
242 South Boulevard
Avon Park, FL 33825

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Avon Park Youth Developmental Center",'Avon_Park=' + Avon_Park.length); Sebring[Sebring.length] = createMarker(new GPoint(-81.44604492,27.41686249),"
Cracker Trail Elementary School
8200 Sparta Road
Sebring, FL 33875

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cracker Trail Elementary School",'Sebring=' + Sebring.length); Venus[Venus.length] = createMarker(new GPoint(-81.18569946,26.82439995),"
Florida Environmental Insti. High School
122 Ranch Road
Venus, FL 33960

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Florida Environmental Insti. High School",'Venus=' + Venus.length); Sebring[Sebring.length] = createMarker(new GPoint(-81.43334198,27.48094940),"
Fred Wild Elementary School
1910 S Highlands Avenue
Sebring, FL 33870

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fred Wild Elementary School",'Sebring=' + Sebring.length); Sebring[Sebring.length] = createMarker(new GPoint(-81.27144400,28.77830200),"
Highlands County Superintendent's Office
4426 School Street
Sebring, FL 33870

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Highlands County Superintendent's Office",'Sebring=' + Sebring.length); Sebring[Sebring.length] = createMarker(new GPoint(-81.51075745,27.51473618),"
Hill-gustat Middle School
4700 Schumacher Road
Sebring, FL 33872

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hill-gustat Middle School",'Sebring=' + Sebring.length); Avon_Park[Avon_Park.length] = createMarker(new GPoint(-81.49780273,27.59659958),"
Hopewell Academy For Arts
100 E 4th Street
Avon Park, FL 33825

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hopewell Academy For Arts",'Avon_Park=' + Avon_Park.length); Lake_Placid[Lake_Placid.length] = createMarker(new GPoint(-81.32699585,27.26715088),"
Lake Country Elementary School
516 County Road 29
Lake Placid, FL 33852

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lake Country Elementary School",'Lake_Placid=' + Lake_Placid.length); Lake_Placid[Lake_Placid.length] = createMarker(new GPoint(-81.37054443,27.29693222),"
Lake Placid Elementary School
101 Green Dragon Drive, W
Lake Placid, FL 33852

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lake Placid Elementary School",'Lake_Placid=' + Lake_Placid.length); Lake_Placid[Lake_Placid.length] = createMarker(new GPoint(-81.37494659,27.29683876),"
Lake Placid Middle School
201 S Tangerine Drive
Lake Placid, FL 33852

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lake Placid Middle School",'Lake_Placid=' + Lake_Placid.length); Lake_Placid[Lake_Placid.length] = createMarker(new GPoint(-81.37084961,27.29307175),"
Lake Placid Senior High School
202 Green Dragon Drive
Lake Placid, FL 33852

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lake Placid Senior High School",'Lake_Placid=' + Lake_Placid.length); Sebring[Sebring.length] = createMarker(new GPoint(-81.42078100,27.50973100),"
Non-public Migrant School
426 School Street
Sebring, FL 33870

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Non-public Migrant School",'Sebring=' + Sebring.length); Avon_Park[Avon_Park.length] = createMarker(new GPoint(-81.49555206,27.60663605),"
Park Elementary School
327 E Palmetto Street
Avon Park, FL 33825

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Park Elementary School",'Avon_Park=' + Avon_Park.length); Sebring[Sebring.length] = createMarker(new GPoint(-81.43164825,27.48573685),"
Sebring High School
3514 Kenilworth Boulevard
Sebring, FL 33870

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sebring High School",'Sebring=' + Sebring.length); Sebring[Sebring.length] = createMarker(new GPoint(-81.43640137,27.49727440),"
Sebring Middle School
500 E Center Avenue
Sebring, FL 33870

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sebring Middle School",'Sebring=' + Sebring.length); Sebring[Sebring.length] = createMarker(new GPoint(-81.27308600,28.79672500),"
Sun 'n Lake Elementary School
44515 Ponce De Leon Boulev
Sebring, FL 33872

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sun 'n Lake Elementary School",'Sebring=' + Sebring.length); Sebring[Sebring.length] = createMarker(new GPoint(-81.44364929,27.50577164),"
Woodlawn Elementary School
817 Woodlawn Dr
Sebring, FL 33870

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodlawn Elementary School",'Sebring=' + Sebring.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(Avon_Park); map.removeOverlays(Lake_Placid); map.removeOverlays(Sebring); map.removeOverlays(Venus); 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(Sebring);map.removeOverlays(Avon_Park); map.removeOverlays(Lake_Placid); map.removeOverlays(Sebring); map.removeOverlays(Venus); map.addOverlays(Avon_Park); centerByArray(Avon_Park, false, false); cntMarker += Avon_Park.length; map.addOverlays(Lake_Placid); centerByArray(Lake_Placid, false, false); cntMarker += Lake_Placid.length; map.addOverlays(Sebring); centerByArray(Sebring, false, false); cntMarker += Sebring.length; map.addOverlays(Venus); centerByArray(Venus, false, false); cntMarker += Venus.length; centerByArray(Sebring,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'); } }