function addMarkers() { mySelect = document.getElementById('selection'); Arcadia = [];Nocatee = [];mySelect.options[mySelect.options.length] = new Option("Arcadia schools",'all=Arcadia'); mySelect.options[mySelect.options.length] = new Option("Nocatee schools",'all=Nocatee'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Arcadia[Arcadia.length] = createMarker(new GPoint(-81.80354800,27.13879600),"
Desoto Alternative Center
5891 Se Highway 31
Arcadia, FL 34266

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Desoto Alternative Center",'Arcadia=' + Arcadia.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-81.86263000,27.21743900),"
Desoto County Superintendent's Office
2p. O. Drawer 2000
Arcadia, FL 34265

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Desoto County Superintendent's Office",'Arcadia=' + Arcadia.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-81.84918976,27.22169685),"
Desoto Dual Diagnosed Correctional Facility
530 Lasolona Avenue
Arcadia, FL 34266

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Desoto Dual Diagnosed Correctional Facility",'Arcadia=' + Arcadia.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-81.84183502,27.22383690),"
Desoto High School
1710 E Gibson Street
Arcadia, FL 34266

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Desoto High School",'Arcadia=' + Arcadia.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-81.85149384,27.22383690),"
Desoto Middle School
420 E Gibson Street
Arcadia, FL 34266

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Desoto Middle School",'Arcadia=' + Arcadia.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-81.84918976,27.22169685),"
Desoto Outward Bound Center
530 Lasalona Avenue
Arcadia, FL 34266

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Desoto Outward Bound Center",'Arcadia=' + Arcadia.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-81.84918976,27.22169685),"
Early Education Center
530 Lasolana Avenue
Arcadia, FL 34266

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Early Education Center",'Arcadia=' + Arcadia.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-81.84918976,27.22169685),"
Hospital And Homebound
530 Lasalona Avenue
Arcadia, FL 34266

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hospital And Homebound",'Arcadia=' + Arcadia.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-81.86244965,27.22011375),"
Joshua Creek Center (formerly Desoto
310 W Whidden Street
Arcadia, FL 34266

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Joshua Creek Center (formerly Desoto",'Arcadia=' + Arcadia.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-81.84918976,27.22169685),"
Kingsley Center
530 Lasolona Ave
Arcadia, FL 34266

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kingsley Center",'Arcadia=' + Arcadia.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-81.85123444,27.21413612),"
Memorial Elementary School
851 E Hickory Street
Arcadia, FL 34266

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Memorial Elementary School",'Arcadia=' + Arcadia.length); Nocatee[Nocatee.length] = createMarker(new GPoint(-81.87460327,27.15940094),"
Nocatee Elementary School
P. O. Box 188
Nocatee, FL 34268

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Nocatee Elementary School",'Nocatee=' + Nocatee.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-81.84918976,27.22169685),"
Reduced Services
530 Lasolona Avenue
Arcadia, FL 34266

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Reduced Services",'Arcadia=' + Arcadia.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-81.86248016,27.22183609),"
West Elementary School
304 W Imogene Street
Arcadia, FL 34266

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Elementary School",'Arcadia=' + Arcadia.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(Arcadia); map.removeOverlays(Nocatee); 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(Arcadia);map.removeOverlays(Arcadia); map.removeOverlays(Nocatee); map.addOverlays(Arcadia); centerByArray(Arcadia, false, false); cntMarker += Arcadia.length; map.addOverlays(Nocatee); centerByArray(Nocatee, false, false); cntMarker += Nocatee.length; centerByArray(Arcadia,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'); } }