function addMarkers(){ mySelect = document.getElementById('selection'); Ocala = [];Silver_Springs = [];Dunnellon = [];Fort_Mccoy = [];Fort_Mc_Coy = [];Belleview = [];Candler = [];Summerfield = [];mySelect.options[mySelect.options.length] = new Option("Belleview schools",'all=Belleview'); mySelect.options[mySelect.options.length] = new Option("Candler schools",'all=Candler'); mySelect.options[mySelect.options.length] = new Option("Dunnellon schools",'all=Dunnellon'); mySelect.options[mySelect.options.length] = new Option("Fort Mc Coy schools",'all=Fort_Mc_Coy'); mySelect.options[mySelect.options.length] = new Option("Fort Mccoy schools",'all=Fort_Mccoy'); mySelect.options[mySelect.options.length] = new Option("Ocala schools",'all=Ocala'); mySelect.options[mySelect.options.length] = new Option("Silver Springs schools",'all=Silver_Springs'); mySelect.options[mySelect.options.length] = new Option("Summerfield schools",'all=Summerfield'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Ocala[Ocala.length] = createMarker(new GPoint(-82.13626800,29.17176100),"
Blessed Trinity Elementary School
5 Se 17th Street
Ocala, FL 34471
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blessed Trinity Elementary School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.11575700,29.14935700),"
Cambridge Acad-intercoast Fina
3855 Se Lake Weir Ave
Ocala, FL 34480
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cambridge Acad-intercoast Fina",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.26724300,29.26798000),"
Castle Oak Academy
7925 Nw 90th Avenue
Ocala, FL 34482
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Castle Oak Academy",'Ocala=' + Ocala.length); Silver_Springs[Silver_Springs.length] = createMarker(new GPoint(-81.89972200,29.27393700),"
Cedar Creek Christian Academy
15455 Ne Highway 314
Silver Springs, FL 34488
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cedar Creek Christian Academy",'Silver_Springs=' + Silver_Springs.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.12464400,29.16508800),"
The Cornerstone School
2313 Se Lake Weir Avenue
Ocala, FL 34471
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Cornerstone School",'Ocala=' + Ocala.length); Dunnellon[Dunnellon.length] = createMarker(new GPoint(-82.46592200,29.05433700),"
Dunnellon Christian Academy
20831 Powell Road
Dunnellon, FL 34431
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dunnellon Christian Academy",'Dunnellon=' + Dunnellon.length); Fort_Mccoy[Fort_Mccoy.length] = createMarker(new GPoint(-81.91899600,29.38734400),"
Eureka Christian Academy
16350 Northeast 148 Terrace Rd
Fort Mccoy, FL 32134
Co-ed school, KG-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eureka Christian Academy",'Fort_Mccoy=' + Fort_Mccoy.length); Fort_Mc_Coy[Fort_Mc_Coy.length] = createMarker(new GPoint(-81.91899600,29.38734400),"
Eureka Christian Academy
16350 Ne 148th Terrace Rd
Fort Mc Coy, FL 32134
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eureka Christian Academy",'Fort_Mc_Coy=' + Fort_Mc_Coy.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.11397800,29.20073700),"
First Assembly Christian School
1827 Ne 14th Street
Ocala, FL 34470
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Assembly Christian School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.10691500,29.14993700),"
Grace Building Blocks School
2255 Se 38th Street
Ocala, FL 34480
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Building Blocks School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.13461800,29.14801700),"
Grace School
4410 SE 3rd Avenue
Ocala, FL 34480
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.17942700,29.16824300),"
Hale Academy
3443 Sw 20th Street
Ocala, FL 34474
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hale Academy",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.13205600,29.18452800),"
Happy Hearts Kindergarten
208 Se Tuscawilla Avenue
Ocala, FL 34471
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Happy Hearts Kindergarten",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.07844900,29.19102400),"
Heritage Jr Academy
415 Ne 41st Ave
Ocala, FL 34470
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Jr Academy",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.05343300,29.10160800),"
Kingsbury Academy
8305 Se 58th Avenue
Ocala, FL 34480
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kingsbury Academy",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.09640100,29.22285400),"
Life Christian Academy
2940 Ne 35th Street
Ocala, FL 34479
Co-ed school, K-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Life Christian Academy",'Ocala=' + Ocala.length); Belleview[Belleview.length] = createMarker(new GPoint(-82.04933600,29.06025700),"
Little Friends Christian School
6107 Se Agnew Road
Belleview, FL 34420
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Friends Christian School",'Belleview=' + Belleview.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.14341300,29.22535200),"
Living Waters Christian Academy
3850 West Anthony Road
Ocala, FL 34475
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Living Waters Christian Academy",'Ocala=' + Ocala.length); Candler[Candler.length] = createMarker(new GPoint(-81.97020000,29.07570000),"
Majesty Christian School
Po Box 473
Candler, FL 32111
Co-ed school, 4-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Majesty Christian School",'Candler=' + Candler.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.12900600,29.20537000),"
Marion Christian Academy
1800 Ne 8th Rd
Ocala, FL 34470
Co-ed school, -
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marion Christian Academy",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.09541900,29.19234600),"
Montessori Academy
2967 E Silver Springs Blvd
Ocala, FL 34470
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Academy",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.17222800,29.18653700),"
Montessori Preparatory School
2967 E Silver Springs Blvd
Ocala, FL 34470
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Preparatory School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.14020000,29.18690000),"
New Generation School
Po Box 1377
Ocala, FL 34478
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Generation School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.12494900,29.21859200),"
New Horizon Academy
3035 Ne Jacksonville Road
Ocala, FL 34479
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Horizon Academy",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.08705600,29.17132500),"
Ocala Christian Academy
1714 Se 36th Avenue
Ocala, FL 34471
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ocala Christian Academy",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.19957100,29.16833700),"
Ocala Word Of Faith Academy
4741 Sw 20th Street Bldg 1
Ocala, FL 34474
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ocala Word Of Faith Academy",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.13788000,29.09561300),"
Redeemer Christian School
155 Sw 87th Place
Ocala, FL 34476
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Redeemer Christian School",'Ocala=' + Ocala.length); Dunnellon[Dunnellon.length] = createMarker(new GPoint(-82.44440000,29.12662500),"
Riverland Baptist School
19455 Sw 61st Street
Dunnellon, FL 34432
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Riverland Baptist School",'Dunnellon=' + Dunnellon.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.12671800,29.16863700),"
St. John Lutheran School (PK-12)
1915 SE Lake Weir Avenue
Ocala, FL 34471
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John Lutheran School (PK-12)",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.07865600,29.17876300),"
St. Pauls Christian School
800 Se 41st Ave
Ocala, FL 34471
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Pauls Christian School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.11813400,29.25229600),"
The School Of The Kingdom
1425 Ne 63rd Street
Ocala, FL 34479
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The School Of The Kingdom",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-82.15465600,29.18236200),"
Shiloh Sda Church School
500 Sw 17th Avenue
Ocala, FL 34474
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shiloh Sda Church School",'Ocala=' + Ocala.length); Ocala[Ocala.length] = createMarker(new GPoint(-81.96234200,29.07028100),"
Shores Christian Academy
10515 Se 115th Avenue
Ocala, FL 34472
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shores Christian Academy",'Ocala=' + Ocala.length); Belleview[Belleview.length] = createMarker(new GPoint(-82.06203200,29.03827600),"
Souls Harbor Christian Academy.
12650 Se County Highway 484
Belleview, FL 34420
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Souls Harbor Christian Academy.",'Belleview=' + Belleview.length); Summerfield[Summerfield.length] = createMarker(new GPoint(-82.04139700,29.01095900),"
Victory Christian Academy
Po Box 902
Summerfield, FL 34492
Co-ed school, K-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Victory Christian Academy",'Summerfield=' + Summerfield.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/////1/' + showArray); map.removeOverlays(Belleview); map.removeOverlays(Candler); map.removeOverlays(Dunnellon); map.removeOverlays(Fort_Mc_Coy); map.removeOverlays(Fort_Mccoy); map.removeOverlays(Ocala); map.removeOverlays(Silver_Springs); map.removeOverlays(Summerfield); 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(Ocala);map.removeOverlays(Belleview); map.removeOverlays(Candler); map.removeOverlays(Dunnellon); map.removeOverlays(Fort_Mc_Coy); map.removeOverlays(Fort_Mccoy); map.removeOverlays(Ocala); map.removeOverlays(Silver_Springs); map.removeOverlays(Summerfield); map.addOverlays(Belleview); centerByArray(Belleview, false, false); cntMarker += Belleview.length; map.addOverlays(Candler); centerByArray(Candler, false, false); cntMarker += Candler.length; map.addOverlays(Dunnellon); centerByArray(Dunnellon, false, false); cntMarker += Dunnellon.length; map.addOverlays(Fort_Mc_Coy); centerByArray(Fort_Mc_Coy, false, false); cntMarker += Fort_Mc_Coy.length; map.addOverlays(Fort_Mccoy); centerByArray(Fort_Mccoy, false, false); cntMarker += Fort_Mccoy.length; map.addOverlays(Ocala); centerByArray(Ocala, false, false); cntMarker += Ocala.length; map.addOverlays(Silver_Springs); centerByArray(Silver_Springs, false, false); cntMarker += Silver_Springs.length; map.addOverlays(Summerfield); centerByArray(Summerfield, false, false); cntMarker += Summerfield.length; centerByArray(Ocala,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=1&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; }