function addMarkers() { mySelect = document.getElementById('selection'); Titusville = [];Titusville[Titusville.length] = createMarker(new GPoint(-80.81990814,28.57138252),"
Andrew Jackson Middle School
1515 Knox Mcrae Drive
Titusville, FL 32780

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Andrew Jackson Middle School",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.84240723,28.57987022),"
Apollo Elementary School
3085 Knox Mcrae Drive
Titusville, FL 32780

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Apollo Elementary School",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.85007477,28.62558556),"
Astronaut High School
800 War Eagle Boulevard
Titusville, FL 32796

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Astronaut High School",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.81104279,28.56472969),"
Coquina Elementary School
850 Knox Mcrae Drive
Titusville, FL 32780

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Coquina Elementary School",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.82365417,28.60766411),"
Devereux Center At Whispering Hills (formerly Deve
800 Lane Avenue
Titusville, FL 32780

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Devereux Center At Whispering Hills (formerly Deve",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.67187500,28.14160538),"
Ese Infants And Toddlers
5650 S. Washington Avenue
Titusville, FL 32780

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ese Infants And Toddlers",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.81900024,28.56049919),"
Fieldston Preparatory School
2940 Columbia Boulevard
Titusville, FL 32780

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fieldston Preparatory School",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.79021454,28.54497337),"
Halfway House
5332 Riveredge Drive
Titusville, FL 32780

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Halfway House",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.81145477,28.54286385),"
Imperial Estates Elementary School
900 Imperial Estates Lane
Titusville, FL 32780

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Imperial Estates Elementary School",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.85102844,28.63696098),"
James Madison Middle School
3375 Dairy Road
Titusville, FL 32796

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("James Madison Middle School",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.85235596,28.63695335),"
Oakpark Elementary School
3395 Dairy Road
Titusville, FL 32796

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakpark Elementary School",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.81261444,28.58140182),"
Riverview Elementary Magnet School
3000 Jolly Street
Titusville, FL 32780

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverview Elementary Magnet School",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.81403351,28.53275871),"
Sculptor Elementary Charter
1301 Armstrong Drive
Titusville, FL 32780

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sculptor Elementary Charter",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.85159302,28.61617279),"
South Lake Elementary School
3755 Garden Street
Titusville, FL 32796

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Lake Elementary School",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.80346680,28.59117889),"
Titusville High School
150 Terrier Trail S.
Titusville, FL 32780

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Titusville High School",'Titusville=' + Titusville.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.82352448,28.60662842),"
Whispering Hills Offsite Alternate Abeyance Progra
800 Lane Avenue
Titusville, FL 32780

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Whispering Hills Offsite Alternate Abeyance Progra",'Titusville=' + Titusville.length); map.removeOverlays(Titusville); setTimeout(function(){map.addOverlays(Titusville)},1000); maxLng = -80.67187500; maxLat = 28.63696098; minLng = -80.85235596; minLat = 28.14160538; 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,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(Titusville); 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(Titusville);map.removeOverlays(Titusville); map.addOverlays(Titusville); centerByArray(Titusville, false, false); cntMarker += Titusville.length; centerByArray(Titusville,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'); } }