function addMarkers() { mySelect = document.getElementById('selection'); Largo = [];Largo[Largo.length] = createMarker(new GPoint(-82.79228973,27.91588402),"
Academy Prep
403 First Avenue, Sw
Largo, FL 33770

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Academy Prep",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.83224487,27.88491249),"
Anona Elementary School
12301 Indian Rocks Road
Largo, FL 33774

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Anona Elementary School",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79146900,27.91604500),"
Boley Juvenile Justice
301 4th Street, Sw
Largo, FL 33770

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Boley Juvenile Justice",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79225159,27.91375542),"
Britt Halfway House
301 4th Street Sw
Largo, FL 33770

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Britt Halfway House",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79225159,27.91375542),"
Dropout Prevention
301 4th Street, Sw
Largo, FL 33770

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dropout Prevention",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79225159,27.91375542),"
Family Resources Shelter (i
301 4th Street Sw
Largo, FL 33770

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Family Resources Shelter (i",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.72532654,27.87896347),"
Fitzgerald Middle School
6410 118th Avenue, N
Largo, FL 33773

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fitzgerald Middle School",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79225159,27.91375542),"
Florida Youth Academy - Low Risk (formerly S
301 4th Street Sw
Largo, FL 33770

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Florida Youth Academy - Low Risk (formerly S",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.77915192,27.89125061),"
Fuguitt Elementary School
13010 101st Street
Largo, FL 33773

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fuguitt Elementary School",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.78489685,27.91773605),"
Largo Central Elementary School
250 1st Avenue, Ne
Largo, FL 33770

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Largo Central Elementary School",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.78744507,27.92016220),"
Largo High School
410 Missouri Avenue
Largo, FL 33770

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Largo High School",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.78489685,27.90916252),"
Largo Middle School
155 8th Avenue, Se
Largo, FL 33771

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Largo Middle School",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79225159,27.91375542),"
Leaf Pemhs (formerly Leaf Halfway House) (i
301 4th Street, Sw
Largo, FL 33770

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Leaf Pemhs (formerly Leaf Halfway House) (i",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79675293,27.91158104),"
Mildred Helms Elementary School
561 S Clearwaterlargo Ro
Largo, FL 33770

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mildred Helms Elementary School",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.82804108,27.86886215),"
Oakhurst Elementary School
10535 137th Street, N
Largo, FL 33774

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakhurst Elementary School",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79225159,27.91375542),"
Pace Center For Girls (fo
301 4th Street, Sw
Largo, FL 33770

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pace Center For Girls (fo",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79225159,27.91375542),"
Pinellas Boot Camp
301 4th Street, Sw
Largo, FL 33770

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pinellas Boot Camp",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79225159,27.91375542),"
Pinellas Boot Camp Transition
301 4th Street, Sw
Largo, FL 33770

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pinellas Boot Camp Transition",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79146900,27.91604500),"
Pinellas County Superintendent's Office
1po Box 2942
Largo, FL 33779

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pinellas County Superintendent's Office",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79225159,27.91375542),"
Pinellas Juvenile Detention Center (formerly Pinel
301 4th Street, Sw
Largo, FL 33770

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pinellas Juvenile Detention Center (formerly Pinel",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79225159,27.91375542),"
Pinellas Marine Institute
301 4th Street, Sw
Largo, FL 33770

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pinellas Marine Institute",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.72401428,27.87923622),"
Pinellas Park High School
6305 118th Avenue, N
Largo, FL 33773

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pinellas Park High School",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.79225159,27.91375542),"
Pre-k Early Intervention Program-largo Curriculum
301 4th Street, S.w.
Largo, FL 33770

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pre-k Early Intervention Program-largo Curriculum",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.80344391,27.89935684),"
Ridgecrest Elementary School
1901 119th Street N
Largo, FL 33778

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ridgecrest Elementary School",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.76510620,27.87993622),"
Southern Oak Elementary School
9101 Walsingham Road
Largo, FL 33773

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southern Oak Elementary School",'Largo=' + Largo.length); Largo[Largo.length] = createMarker(new GPoint(-82.76507568,27.87993622),"
Walsingham Elementary School
9099 Walsingham Road
Largo, FL 33773

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Walsingham Elementary School",'Largo=' + Largo.length); map.removeOverlays(Largo); setTimeout(function(){map.addOverlays(Largo)},1000); maxLng = -82.72401428; maxLat = 27.92016220; minLng = -82.83224487; minLat = 27.86886215; 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(Largo); 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(Largo);map.removeOverlays(Largo); map.addOverlays(Largo); centerByArray(Largo, false, false); cntMarker += Largo.length; centerByArray(Largo,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'); } }