function addMarkers(){ mySelect = document.getElementById('selection'); Eustis = [];Mount_Dora = [];Clermont = [];Leesburg = [];Fruitland_Park = [];Tavares = [];Montverde = [];Groveland = [];Sorrento = [];mySelect.options[mySelect.options.length] = new Option("Clermont schools",'all=Clermont'); mySelect.options[mySelect.options.length] = new Option("Eustis schools",'all=Eustis'); mySelect.options[mySelect.options.length] = new Option("Fruitland Park schools",'all=Fruitland_Park'); mySelect.options[mySelect.options.length] = new Option("Groveland schools",'all=Groveland'); mySelect.options[mySelect.options.length] = new Option("Leesburg schools",'all=Leesburg'); mySelect.options[mySelect.options.length] = new Option("Montverde schools",'all=Montverde'); mySelect.options[mySelect.options.length] = new Option("Mount Dora schools",'all=Mount_Dora'); mySelect.options[mySelect.options.length] = new Option("Sorrento schools",'all=Sorrento'); mySelect.options[mySelect.options.length] = new Option("Tavares schools",'all=Tavares'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Eustis[Eustis.length] = createMarker(new GPoint(-81.64617100,28.85313700),"
Blue Lake Academy
Po Box 1947
Eustis, FL 32727
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blue Lake Academy",'Eustis=' + Eustis.length); Mount_Dora[Mount_Dora.length] = createMarker(new GPoint(-81.66784200,28.75855100),"
Carlton Palms Educational Center
28308 Churchill Smith Lane
Mount Dora, FL 32757
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carlton Palms Educational Center",'Mount_Dora=' + Mount_Dora.length); Mount_Dora[Mount_Dora.length] = createMarker(new GPoint(-81.64712800,28.80791200),"
Christian Home & Bible School
301 West 13th Avenue
Mount Dora, FL 32757
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Home & Bible School",'Mount_Dora=' + Mount_Dora.length); Clermont[Clermont.length] = createMarker(new GPoint(-81.75594700,28.56254000),"
Citrus Heights Academy
101 N Grand Highway
Clermont, FL 34711
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Citrus Heights Academy",'Clermont=' + Clermont.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-81.88535600,28.81279400),"
First Academy
219 N 13th Street
Leesburg, FL 34748
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Academy",'Leesburg=' + Leesburg.length); Clermont[Clermont.length] = createMarker(new GPoint(-81.76633900,28.55129500),"
Green Isle Children's Ranch Academy
Po Box 121400
Clermont, FL 34712
All-boys school, 6-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Green Isle Children's Ranch Academy",'Clermont=' + Clermont.length); Fruitland_Park[Fruitland_Park.length] = createMarker(new GPoint(-81.90010000,28.86440000),"
H.i.s. Royal Christian Academy
Po Box 332
Fruitland Park, FL 34731
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("H.i.s. Royal Christian Academy",'Fruitland_Park=' + Fruitland_Park.length); Fruitland_Park[Fruitland_Park.length] = createMarker(new GPoint(-81.91738700,28.87630600),"
Holy Trinity Episcopal School
2201 Spring Lake Road
Fruitland Park, FL 34731
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Trinity Episcopal School",'Fruitland_Park=' + Fruitland_Park.length); Leesburg[Leesburg.length] = createMarker(new GPoint(-81.88013000,28.81496100),"
Lake Montessori School
415 Lee Street
Leesburg, FL 34748
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lake Montessori School",'Leesburg=' + Leesburg.length); Eustis[Eustis.length] = createMarker(new GPoint(-81.68574400,28.84983200),"
Lakeside Academy
326 S Bay Street
Eustis, FL 32726
Co-ed school, 6-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lakeside Academy",'Eustis=' + Eustis.length); Tavares[Tavares.length] = createMarker(new GPoint(-81.70272000,28.81830700),"
Liberty Christian Academy
2451 Dora Avenue
Tavares, FL 32778
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Liberty Christian Academy",'Tavares=' + Tavares.length); Mount_Dora[Mount_Dora.length] = createMarker(new GPoint(-81.61781900,28.78973900),"
Life Changing Christian Academy
2705 Robie Avenue
Mount Dora, FL 32757
Co-ed school, K-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Life Changing Christian Academy",'Mount_Dora=' + Mount_Dora.length); Montverde[Montverde.length] = createMarker(new GPoint(-81.67485500,28.59669700),"
Montverde Academy
17235 7th Street
Montverde, FL 34756
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montverde Academy",'Montverde=' + Montverde.length); Mount_Dora[Mount_Dora.length] = createMarker(new GPoint(-81.63601900,28.82240700),"
National Deaf Academy School
19650 Us Highway 441
Mount Dora, FL 32757
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("National Deaf Academy School",'Mount_Dora=' + Mount_Dora.length); Montverde[Montverde.length] = createMarker(new GPoint(-81.66203800,28.59099800),"
New Hope Christian Academy
16748 Elderberry Drive
Montverde, FL 34756
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Hope Christian Academy",'Montverde=' + Montverde.length); Groveland[Groveland.length] = createMarker(new GPoint(-81.85731300,28.57466100),"
Praise Temple Christian Academy
5910 Bible Camp Road
Groveland, FL 34736
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Praise Temple Christian Academy",'Groveland=' + Groveland.length); Clermont[Clermont.length] = createMarker(new GPoint(-81.74098900,28.53253000),"
Real Life Christian Academy
1501 Steve''s Road
Clermont, FL 34711
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Real Life Christian Academy",'Clermont=' + Clermont.length); Sorrento[Sorrento.length] = createMarker(new GPoint(-81.53112500,28.83553700),"
Redeemer Christian Academy
25815 Arundel Way
Sorrento, FL 32776
Co-ed school, 1-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Redeemer Christian Academy",'Sorrento=' + Sorrento.length); Clermont[Clermont.length] = createMarker(new GPoint(-81.79485000,28.47626300),"
Repairer Of Breach Ranch Academy
8812 Lake Glona Court
Clermont, FL 34711
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Repairer Of Breach Ranch Academy",'Clermont=' + Clermont.length); Mount_Dora[Mount_Dora.length] = createMarker(new GPoint(-81.60795000,28.73287200),"
Solid Rock Christian School
21951 U S Hwy 441
Mount Dora, FL 32756
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Solid Rock Christian School",'Mount_Dora=' + Mount_Dora.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(Clermont); map.removeOverlays(Eustis); map.removeOverlays(Fruitland_Park); map.removeOverlays(Groveland); map.removeOverlays(Leesburg); map.removeOverlays(Montverde); map.removeOverlays(Mount_Dora); map.removeOverlays(Sorrento); map.removeOverlays(Tavares); 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(Eustis);map.removeOverlays(Clermont); map.removeOverlays(Eustis); map.removeOverlays(Fruitland_Park); map.removeOverlays(Groveland); map.removeOverlays(Leesburg); map.removeOverlays(Montverde); map.removeOverlays(Mount_Dora); map.removeOverlays(Sorrento); map.removeOverlays(Tavares); map.addOverlays(Clermont); centerByArray(Clermont, false, false); cntMarker += Clermont.length; map.addOverlays(Eustis); centerByArray(Eustis, false, false); cntMarker += Eustis.length; map.addOverlays(Fruitland_Park); centerByArray(Fruitland_Park, false, false); cntMarker += Fruitland_Park.length; map.addOverlays(Groveland); centerByArray(Groveland, false, false); cntMarker += Groveland.length; map.addOverlays(Leesburg); centerByArray(Leesburg, false, false); cntMarker += Leesburg.length; map.addOverlays(Montverde); centerByArray(Montverde, false, false); cntMarker += Montverde.length; map.addOverlays(Mount_Dora); centerByArray(Mount_Dora, false, false); cntMarker += Mount_Dora.length; map.addOverlays(Sorrento); centerByArray(Sorrento, false, false); cntMarker += Sorrento.length; map.addOverlays(Tavares); centerByArray(Tavares, false, false); cntMarker += Tavares.length; centerByArray(Eustis,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; }