function addMarkers() { mySelect = document.getElementById('selection'); Quincy = [];Chattahoochee = [];Havana = [];Greensboro = [];Gretna = [];Midway = [];mySelect.options[mySelect.options.length] = new Option("Chattahoochee schools",'all=Chattahoochee'); mySelect.options[mySelect.options.length] = new Option("Greensboro schools",'all=Greensboro'); mySelect.options[mySelect.options.length] = new Option("Gretna schools",'all=Gretna'); mySelect.options[mySelect.options.length] = new Option("Havana schools",'all=Havana'); mySelect.options[mySelect.options.length] = new Option("Midway schools",'all=Midway'); mySelect.options[mySelect.options.length] = new Option("Quincy schools",'all=Quincy'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Quincy[Quincy.length] = createMarker(new GPoint(-84.58093900,30.58814100),"
Bold Step Infant Care
631 S Stewart Street
Quincy, FL 32351

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bold Step Infant Care",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.58100891,30.57943344),"
Carter Parramore Academy
631 S Stewart Street
Quincy, FL 32351

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carter Parramore Academy",'Quincy=' + Quincy.length); Chattahoochee[Chattahoochee.length] = createMarker(new GPoint(-84.83522797,30.70009422),"
Chattahoochee Elementary School
335 Maple Street
Chattahoochee, FL 32324

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chattahoochee Elementary School",'Chattahoochee=' + Chattahoochee.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.55680084,30.56599236),"
Crossenioroad Academy
635-1 Strong Road
Quincy, FL 32351

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Crossenioroad Academy",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.57669067,30.57786369),"
Dick Howser Center
35 Martin L King Jr Blvd
Quincy, FL 32353

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dick Howser Center",'Quincy=' + Quincy.length); Havana[Havana.length] = createMarker(new GPoint(-84.41529846,30.61190033),"
East Gadsden High School
27001 Blue Star Highway
Havana, FL 32333

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Gadsden High School",'Havana=' + Havana.length); Chattahoochee[Chattahoochee.length] = createMarker(new GPoint(-84.80940247,30.67460060),"
Florida State Hospital
P.o. Box 1000
Chattahoochee, FL 32324

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Florida State Hospital",'Chattahoochee=' + Chattahoochee.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.58093900,30.58814100),"
Gadsden County Superintendent's Office
135 Martin L King Jr Blvd
Quincy, FL 32351

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gadsden County Superintendent's Office",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.57814789,30.57819939),"
Gadsden Technical Institute High School
201 Martin L King Jr Blvd
Quincy, FL 32351

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gadsden Technical Institute High School",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.58276367,30.59123611),"
Gadsen Elementary Magnet School
500 W King Street
Quincy, FL 32351

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gadsen Elementary Magnet School",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.60131073,30.59113693),"
George W. Munroe Elementary School
1850 W King Street
Quincy, FL 32351

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George W. Munroe Elementary School",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.76555634,30.57424736),"
Greensboro Elementary School
62 Lonnie Clark Road
Quincy, FL 32351

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greensboro Elementary School",'Quincy=' + Quincy.length); Greensboro[Greensboro.length] = createMarker(new GPoint(-84.74330139,30.56909943),"
Greensboro High School
P. O. Box 10
Greensboro, FL 32330

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greensboro High School",'Greensboro=' + Greensboro.length); Gretna[Gretna.length] = createMarker(new GPoint(-84.66053772,30.60630035),"
Gretna Elementary School
706 Martin L King Jr Blvd
Gretna, FL 32332

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gretna Elementary School",'Gretna=' + Gretna.length); Havana[Havana.length] = createMarker(new GPoint(-84.41966248,30.61548233),"
Havana Elementary School
705 U.s. Highway 27 South
Havana, FL 32333

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Havana Elementary School",'Havana=' + Havana.length); Havana[Havana.length] = createMarker(new GPoint(-84.39044189,30.62561417),"
Havana Middle School
1210 Kemp Road
Havana, FL 32333

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Havana Middle School",'Havana=' + Havana.length); Havana[Havana.length] = createMarker(new GPoint(-84.41187286,30.63793564),"
Havana Northside High School
264 Carver Avenue
Havana, FL 32333

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Havana Northside High School",'Havana=' + Havana.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.57669067,30.57786369),"
Head Start Program
35 Martin Luther King Blv
Quincy, FL 32351

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Head Start Program",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.59430695,30.59097862),"
James A. Shanks Middle School
1400 W King Street
Quincy, FL 32351

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("James A. Shanks Middle School",'Quincy=' + Quincy.length); Midway[Midway.length] = createMarker(new GPoint(-84.45438385,30.49400330),"
Midway Magnet Center
50 Mine Road
Midway, FL 32343

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Midway Magnet Center",'Midway=' + Midway.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.57669067,30.57786369),"
New Horizons
35 Martin L King Jr Blvd
Quincy, FL 32351

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Horizons",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.58276367,30.59123611),"
Quincy Educational Academy
500 West King Street
Quincy, FL 32351

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Quincy Educational Academy",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.60578918,30.65855408),"
Saint Johns Elementary School
4463 Bainbridge Highway
Quincy, FL 32352

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Saint Johns Elementary School",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.58103943,30.57676888),"
Stewart Street Elementary School
749 S Stewart Street
Quincy, FL 32351

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stewart Street Elementary School",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.57669067,30.57786369),"
W. S. Stephens Alternative Program
35 Martin Luther King Blv
Quincy, FL 32353

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("W. S. Stephens Alternative Program",'Quincy=' + Quincy.length); Quincy[Quincy.length] = createMarker(new GPoint(-84.58276367,30.59123611),"
Windrush (formerly Bridgewood Academy)
500 West King Street
Quincy, FL 32351

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Windrush (formerly Bridgewood Academy)",'Quincy=' + Quincy.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(Chattahoochee); map.removeOverlays(Greensboro); map.removeOverlays(Gretna); map.removeOverlays(Havana); map.removeOverlays(Midway); map.removeOverlays(Quincy); 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(Quincy);map.removeOverlays(Chattahoochee); map.removeOverlays(Greensboro); map.removeOverlays(Gretna); map.removeOverlays(Havana); map.removeOverlays(Midway); map.removeOverlays(Quincy); map.addOverlays(Chattahoochee); centerByArray(Chattahoochee, false, false); cntMarker += Chattahoochee.length; map.addOverlays(Greensboro); centerByArray(Greensboro, false, false); cntMarker += Greensboro.length; map.addOverlays(Gretna); centerByArray(Gretna, false, false); cntMarker += Gretna.length; map.addOverlays(Havana); centerByArray(Havana, false, false); cntMarker += Havana.length; map.addOverlays(Midway); centerByArray(Midway, false, false); cntMarker += Midway.length; map.addOverlays(Quincy); centerByArray(Quincy, false, false); cntMarker += Quincy.length; centerByArray(Quincy,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'); } }