function addMarkers(){ mySelect = document.getElementById('selection'); Alachua = [];Gainesville = [];Archer = [];High_Springs = [];Sanford = [];mySelect.options[mySelect.options.length] = new Option("Alachua schools",'all=Alachua'); mySelect.options[mySelect.options.length] = new Option("Archer schools",'all=Archer'); mySelect.options[mySelect.options.length] = new Option("Gainesville schools",'all=Gainesville'); mySelect.options[mySelect.options.length] = new Option("High Springs schools",'all=High_Springs'); mySelect.options[mySelect.options.length] = new Option("Sanford schools",'all=Sanford'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Alachua[Alachua.length] = createMarker(new GPoint(-82.49427900,29.79309000),"
Bhaktivedanta Academy
PO Box 937
Alachua, FL 32616
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bhaktivedanta Academy",'Alachua=' + Alachua.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.38123700,29.67080700),"
Bnai Israel Day School
3830 Nw 16th Blvd
Gainesville, FL 32605
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bnai Israel Day School",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.38118300,29.67081400),"
Bnai Israel School
3830 Nw 16 Blvd
Gainesville, FL 32605
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bnai Israel School",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.40134100,29.66243700),"
Brentwood School
1111 Nw 55th Street
Gainesville, FL 32605
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brentwood School",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.36808700,29.60018200),"
The Children's Center
5600 Sw 34th Street
Gainesville, FL 32608
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Children's Center",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.47061800,29.56976100),"
Christian Life Academy
12000 Sw Archer Road
Gainesville, FL 32608
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Life Academy",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.37170000,29.67710000),"
Compassionate Outreach Ministries Christian Acdmy
Po Box 143116
Gainesville, FL 32614
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Compassionate Outreach Ministries Christian Acdmy",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.37665500,29.65964100),"
Cornerstone Academy
3536 NW 8th Ave
Gainesville, FL 32635
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone Academy",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.45816000,29.68920000),"
Countryside Christian School
10926 Nw 39th Avenue
Gainesville, FL 32606
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Countryside Christian School",'Gainesville=' + Gainesville.length); Alachua[Alachua.length] = createMarker(new GPoint(-82.49427900,29.79309000),"
Destiny Christian Academy
Po Box 1708
Alachua, FL 32616
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Destiny Christian Academy",'Alachua=' + Alachua.length); Archer[Archer.length] = createMarker(new GPoint(-82.53570000,29.52573100),"
Family Life Academy
Po Box 799
Archer, FL 32618
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Family Life Academy",'Archer=' + Archer.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.36230100,29.69632500),"
Family Worship Center
2724 Nw 45th Place
Gainesville, FL 32605
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Family Worship Center",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.36836500,29.68136300),"
Flowers Montessori School
3111 Nw 31st Avenue
Gainesville, FL 32605
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Flowers Montessori School",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.39790000,29.70770000),"
Gainesville Christian Academy
Po Box 358568
Gainesville, FL 32635
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gainesville Christian Academy",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.41455000,29.63402500),"
Gainesville Country Day School
6801 Sw 24th Avenue
Gainesville, FL 32607
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gainesville Country Day School",'Gainesville=' + Gainesville.length); Alachua[Alachua.length] = createMarker(new GPoint(-82.49010000,29.80670000),"
Incaf Montessori School
P.o. Box 279
Alachua, FL 32616
Co-ed school, KG-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Incaf Montessori School",'Alachua=' + Alachua.length); Archer[Archer.length] = createMarker(new GPoint(-82.50642800,29.54036000),"
Jordan Glen School
12425 SW 154th St
Archer, FL 32618
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jordan Glen School",'Archer=' + Archer.length); High_Springs[High_Springs.length] = createMarker(new GPoint(-82.59109500,29.84942900),"
Living Spring Academy
23901 NW 212 Ave
High Springs, FL 32655
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Living Spring Academy",'High_Springs=' + High_Springs.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.42419600,29.63956400),"
Martha Manson Lower School
7715 Sw 14th Avenue
Gainesville, FL 32607
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Martha Manson Lower School",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.43274400,29.68864800),"
Millhopper Montessori School
8505 NW 39th Ave
Gainesville, FL 32606
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Millhopper Montessori School",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.42593600,29.63944000),"
Oak Hall School
8009 SW 14th Avenue
Gainesville, FL 32607
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oak Hall School",'Gainesville=' + Gainesville.length); Sanford[Sanford.length] = createMarker(new GPoint(-81.31054800,28.81092400),"
Page Private School
100 AERO LANE
Sanford, FL 32771
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Page Private School",'Sanford=' + Sanford.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.45725000,29.63080500),"
Queen Of Peace Cath Academy
10900 Sw 24th Avenue
Gainesville, FL 32607
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Queen Of Peace Cath Academy",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.44871300,29.63073300),"
The Rock School
9818 SW 24th Ave
Gainesville, FL 32607
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Rock School",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.31903600,29.66669300),"
St. Patrick Interparish School
550 Ne 16th Ave
Gainesville, FL 32601
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Patrick Interparish School",'Gainesville=' + Gainesville.length); Alachua[Alachua.length] = createMarker(new GPoint(-82.49361200,29.78879400),"
The Spencer House Montessori
13921 Nw 146th Ave
Alachua, FL 32615
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Spencer House Montessori",'Alachua=' + Alachua.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.29995900,29.66951700),"
Star Christian Center And Academy
1930 Ne Waldo Road
Gainesville, FL 32609
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Star Christian Center And Academy",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.43469100,29.67446600),"
Trilogy School
8700 Nw 23rd Avenue
Gainesville, FL 32606
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trilogy School",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.37255700,29.66577300),"
Westwood Hills Christian
1520 Nw 34th Street
Gainesville, FL 32605
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westwood Hills Christian",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.19131600,29.63320400),"
Windsor Christian Academy
1918 Se County Road 234
Gainesville, FL 32641
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Windsor Christian Academy",'Gainesville=' + Gainesville.length); Gainesville[Gainesville.length] = createMarker(new GPoint(-82.35186900,29.68836300),"
Z L Sung Sda School
2115 Nw 39th Avenue
Gainesville, FL 32605
Co-ed school, 2-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Z L Sung Sda School",'Gainesville=' + Gainesville.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(Alachua); map.removeOverlays(Archer); map.removeOverlays(Gainesville); map.removeOverlays(High_Springs); map.removeOverlays(Sanford); 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(Alachua);map.removeOverlays(Alachua); map.removeOverlays(Archer); map.removeOverlays(Gainesville); map.removeOverlays(High_Springs); map.removeOverlays(Sanford); map.addOverlays(Alachua); centerByArray(Alachua, false, false); cntMarker += Alachua.length; map.addOverlays(Archer); centerByArray(Archer, false, false); cntMarker += Archer.length; map.addOverlays(Gainesville); centerByArray(Gainesville, false, false); cntMarker += Gainesville.length; map.addOverlays(High_Springs); centerByArray(High_Springs, false, false); cntMarker += High_Springs.length; map.addOverlays(Sanford); centerByArray(Sanford, false, false); cntMarker += Sanford.length; centerByArray(Alachua,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; }