function addMarkers(){ mySelect = document.getElementById('selection'); Sarasota = [];North_Port = [];Venice = [];Englewood = [];mySelect.options[mySelect.options.length] = new Option("Englewood schools",'all=Englewood'); mySelect.options[mySelect.options.length] = new Option("North Port schools",'all=North_Port'); mySelect.options[mySelect.options.length] = new Option("Sarasota schools",'all=Sarasota'); mySelect.options[mySelect.options.length] = new Option("Venice schools",'all=Venice'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.53003800,27.32404000),"
Achievement Center (the)
1999 Lincoln Drive
Sarasota, FL 34236
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Achievement Center (the)",'Sarasota=' + Sarasota.length); North_Port[North_Port.length] = createMarker(new GPoint(-82.23303400,27.04226100),"
Active Learning Academy, Inc.
14503 S Tamiami Trail
North Port, FL 34287
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Active Learning Academy, Inc.",'North_Port=' + North_Port.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.52204500,27.33802100),"
Agape Christian School
150 N Shade Avenue
Sarasota, FL 34237
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Agape Christian School",'Sarasota=' + Sarasota.length); Venice[Venice.length] = createMarker(new GPoint(-82.40077300,27.11321300),"
Auburn Road Presbyterian Academy
642 N Auburn Road
Venice, FL 34292
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Auburn Road Presbyterian Academy",'Venice=' + Venice.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.49791400,27.30812900),"
Brickhouse Academy
3552 Webber Street
Sarasota, FL 34239
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brickhouse Academy",'Sarasota=' + Sarasota.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.48611300,27.33762200),"
Cardinal Mooney High School
4171 Fruitville Road
Sarasota, FL 34232
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cardinal Mooney High School",'Sarasota=' + Sarasota.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.45594900,27.26578400),"
Closing The Gap School
5989 Approach Road
Sarasota, FL 34238
Co-ed school, 2-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Closing The Gap School",'Sarasota=' + Sarasota.length); Englewood[Englewood.length] = createMarker(new GPoint(-82.33704700,26.96133500),"
Heritage Christian Academy
75 Pine Street
Englewood, FL 34223
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian Academy",'Englewood=' + Englewood.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.52930000,27.30270000),"
Morningstar Learning Center
Po Box 5502
Sarasota, FL 34277
Co-ed school, K-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Morningstar Learning Center",'Sarasota=' + Sarasota.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.50917400,27.38707000),"
Narrow Way Academy
3011 61st Street
Sarasota, FL 34243
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Narrow Way Academy",'Sarasota=' + Sarasota.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.46528000,27.27669900),"
New Gate School
5237 Ashton Road
Sarasota, FL 34233
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Gate School",'Sarasota=' + Sarasota.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.56084900,27.28619500),"
Out-of-Door Academy
444 Reid Street
Sarasota, FL 34242
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Out-of-Door Academy",'Sarasota=' + Sarasota.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.49734400,27.32380700),"
Palm Grove Mennonite School
1087 Beneva Rd.
Sarasota, FL 34232
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Palm Grove Mennonite School",'Sarasota=' + Sarasota.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.46055300,27.27941700),"
Prew Academy
5020 Fielding Lane
Sarasota, FL 34233
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Prew Academy",'Sarasota=' + Sarasota.length); North_Port[North_Port.length] = createMarker(new GPoint(-82.23465600,27.04675000),"
Queen Of Angels Academy
5412 Conestoga Street
North Port, FL 34291
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Queen Of Angels Academy",'North_Port=' + North_Port.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.46015900,27.32323700),"
Sarasota Christian School
5415 Bahia Vista Street
Sarasota, FL 34232
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sarasota Christian School",'Sarasota=' + Sarasota.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.50301000,27.34873700),"
Shepherd S Hill Christian School
3333 12th Street
Sarasota, FL 34237
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shepherd S Hill Christian School",'Sarasota=' + Sarasota.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.49862300,27.29865900),"
Sonhaven Preparatory Academy
3560 Bee Ridge Road
Sarasota, FL 34239
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sonhaven Preparatory Academy",'Sarasota=' + Sarasota.length); Venice[Venice.length] = createMarker(new GPoint(-82.42965200,27.07858400),"
The Study Center, Inc.
1501 Tamiami Trail S 501
Venice, FL 34285
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Study Center, Inc.",'Venice=' + Venice.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.46371400,27.32683700),"
Sunnyside Mennonite School
901 Honore Avenue
Sarasota, FL 34232
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sunnyside Mennonite School",'Sarasota=' + Sarasota.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.53962900,27.33888000),"
The West Coast School
Po Box 49168
Sarasota, FL 34230
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The West Coast School",'Sarasota=' + Sarasota.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.48261600,27.29163700),"
West Florida Christian School
4311 Wilkinson Road
Sarasota, FL 34233
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Florida Christian School",'Sarasota=' + Sarasota.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,11); /* 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/////2/' + showArray); map.removeOverlays(Englewood); map.removeOverlays(North_Port); map.removeOverlays(Sarasota); map.removeOverlays(Venice); 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(Sarasota);map.removeOverlays(Englewood); map.removeOverlays(North_Port); map.removeOverlays(Sarasota); map.removeOverlays(Venice); map.addOverlays(Englewood); centerByArray(Englewood, false, false); cntMarker += Englewood.length; map.addOverlays(North_Port); centerByArray(North_Port, false, false); cntMarker += North_Port.length; map.addOverlays(Sarasota); centerByArray(Sarasota, false, false); cntMarker += Sarasota.length; map.addOverlays(Venice); centerByArray(Venice, false, false); cntMarker += Venice.length; centerByArray(Sarasota,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'); //window.open('/map.php?type=1&schools=&school_level=2&radius=&zipcode=&school_type_search=&school_type_code='); } } function createMarker(point, label, icon) { var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }