function addMarkers() { mySelect = document.getElementById('selection'); Okeechobee = [];mySelect.options[mySelect.options.length] = new Option("Okeechobee schools",'all=Okeechobee'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.83408356,27.21823692),"
Ace Pre-k Handicapped
575 Sw 28th Street
Okeechobee, FL 34974

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ace Pre-k Handicapped",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.83465576,27.23768425),"
Central Elementary School
610 Sw 5th Avenue
Okeechobee, FL 34974

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.79068756,27.23658943),"
Everglades Elementary School
3725 Se 8th Street
Okeechobee, FL 34974

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Everglades Elementary School",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.85556600,27.17466900),"
Exceptional Child Center
700 Sw 2nd Avenue
Okeechobee, FL 34974

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Exceptional Child Center",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.84996900,27.19191000),"
Migrant Ne
700 Sw 2nd Ave
Okeechobee, FL 34974

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Migrant Ne",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.83408356,27.21823692),"
New Endeavor High School
575 Sw 28th Street
Okeechobee, FL 34974

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Endeavor High School",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.83954620,27.27071953),"
North Elementary School
3000 Nw 10th Terrace
Okeechobee, FL 34972

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Elementary School",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.84996900,27.19191000),"
Okeechobee County Superintendent's Office
0700 Sw 2nd Avenue
Okeechobee, FL 34974

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Okeechobee County Superintendent's Office",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.83125305,27.23778915),"
Okeechobee Freshman Campus
610 Sw 2nd Avenue
Okeechobee, FL 34974

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Okeechobee Freshman Campus",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.82984161,27.26943779),"
Okeechobee High School
2800 Us Highway 441 N
Okeechobee, FL 34972

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Okeechobee High School",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.79575348,27.39823723),"
Okeechobee Juvenile Justice Level 10
5050 Ne 168th Street
Okeechobee, FL 34972

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Okeechobee Juvenile Justice Level 10",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.83000183,27.24374962),"
Okeechobee Juvenile Justice Vision Quest Level 6
42660 Highway 41 North
Okeechobee, FL 34972

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Okeechobee Juvenile Justice Vision Quest Level 6",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.86664581,27.62958717),"
Okeechobee Juvenile Justice-level 4
42660 Highway 441 N
Okeechobee, FL 34972

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Okeechobee Juvenile Justice-level 4",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.82015991,27.28612328),"
Okeechobee Juvenile Justice-level 6
1117 Ne 39th Blvd
Okeechobee, FL 34972

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Okeechobee Juvenile Justice-level 6",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.83792877,27.21794319),"
Osceola Middle School
825 Sw 28th Street
Okeechobee, FL 34974

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Osceola Middle School",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.87214661,27.26759338),"
Seminole Elementary School
2690 Nw 42nd Avenue
Okeechobee, FL 34972

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Seminole Elementary School",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.83675385,27.22047234),"
South Elementary School
2468 Sw 7th Avenue
Okeechobee, FL 34974

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Elementary School",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.83125305,27.23686218),"
Student Serv./special Programs Elementary School
700 Sw 2nd Avenue
Okeechobee, FL 34974

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Student Serv./special Programs Elementary School",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.83125305,27.23686218),"
Student Services/special Programs Elementary School
700 Sw Second Ave
Okeechobee, FL 34974

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Student Services/special Programs Elementary School",'Okeechobee=' + Okeechobee.length); Okeechobee[Okeechobee.length] = createMarker(new GPoint(-80.83805847,27.26543617),"
Yearling Middle School
925 Nw 23rd Lane
Okeechobee, FL 34972

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Yearling Middle School",'Okeechobee=' + Okeechobee.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(Okeechobee); 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(Okeechobee);map.removeOverlays(Okeechobee); map.addOverlays(Okeechobee); centerByArray(Okeechobee, false, false); cntMarker += Okeechobee.length; centerByArray(Okeechobee,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'); } }