function addMarkers(){ mySelect = document.getElementById('selection'); Winter_Haven = [];Auburndale = [];Mulberry = [];Lake_Wales = [];Eagle_Lake = [];Lakeland = [];Fort_Meade = [];Haines_City = [];Bartow = [];mySelect.options[mySelect.options.length] = new Option("Auburndale schools",'all=Auburndale'); mySelect.options[mySelect.options.length] = new Option("Bartow schools",'all=Bartow'); mySelect.options[mySelect.options.length] = new Option("Eagle Lake schools",'all=Eagle_Lake'); mySelect.options[mySelect.options.length] = new Option("Fort Meade schools",'all=Fort_Meade'); mySelect.options[mySelect.options.length] = new Option("Haines City schools",'all=Haines_City'); mySelect.options[mySelect.options.length] = new Option("Lake Wales schools",'all=Lake_Wales'); mySelect.options[mySelect.options.length] = new Option("Lakeland schools",'all=Lakeland'); mySelect.options[mySelect.options.length] = new Option("Mulberry schools",'all=Mulberry'); mySelect.options[mySelect.options.length] = new Option("Winter Haven schools",'all=Winter_Haven'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Winter_Haven[Winter_Haven.length] = createMarker(new GPoint(-81.80674600,28.01118200),"
All Saints Academy
5001 Sr 540 W
Winter Haven, FL 33880
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("All Saints Academy",'Winter_Haven=' + Winter_Haven.length); Auburndale[Auburndale.length] = createMarker(new GPoint(-81.78820700,28.08471300),"
Anchor Academy
Po Box 625
Auburndale, FL 33823
Co-ed school, 5-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Anchor Academy",'Auburndale=' + Auburndale.length); Mulberry[Mulberry.length] = createMarker(new GPoint(-82.03121100,27.72666700),"
Calvary Academy
5400 Bethlehem Road
Mulberry, FL 33860
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Academy",'Mulberry=' + Mulberry.length); Lake_Wales[Lake_Wales.length] = createMarker(new GPoint(-81.58714600,27.90541200),"
Candlelight Christian Academy
209 East Sessoms Avenue
Lake Wales, FL 33853
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Candlelight Christian Academy",'Lake_Wales=' + Lake_Wales.length); Eagle_Lake[Eagle_Lake.length] = createMarker(new GPoint(-81.75536100,27.98570600),"
Eagle Lake Christian School & Preschool
670 N Eagle Drive
Eagle Lake, FL 33839
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eagle Lake Christian School & Preschool",'Eagle_Lake=' + Eagle_Lake.length); Lakeland[Lakeland.length] = createMarker(new GPoint(-81.96536000,28.09914000),"
Evangel Christian School
777 Carpenters Way
Lakeland, FL 33809
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Evangel Christian School",'Lakeland=' + Lakeland.length); Lakeland[Lakeland.length] = createMarker(new GPoint(-81.95660400,27.98532100),"
Families Of Faith Christian Academy
4404 South Florida Ave. Suite 11
Lakeland, FL 33813
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Families Of Faith Christian Academy",'Lakeland=' + Lakeland.length); Fort_Meade[Fort_Meade.length] = createMarker(new GPoint(-81.77690000,27.74760000),"
Ft. Meade Academy
Po Box 360
Fort Meade, FL 33841
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ft. Meade Academy",'Fort_Meade=' + Fort_Meade.length); Lakeland[Lakeland.length] = createMarker(new GPoint(-81.87608000,27.95312000),"
Geneva Classical Academy
4410 East CR 540A
Lakeland, FL 33813
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Geneva Classical Academy",'Lakeland=' + Lakeland.length); Lakeland[Lakeland.length] = createMarker(new GPoint(-81.98814400,28.05141700),"
Greater Faith Academy
2035 W Parker Street
Lakeland, FL 33815
Co-ed school, K-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greater Faith Academy",'Lakeland=' + Lakeland.length); Winter_Haven[Winter_Haven.length] = createMarker(new GPoint(-81.75966400,28.01401000),"
Haven Christian Academy
2105 King Road
Winter Haven, FL 33880
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Haven Christian Academy",'Winter_Haven=' + Winter_Haven.length); Lakeland[Lakeland.length] = createMarker(new GPoint(-81.93261100,28.02827500),"
Heritage Christian Academy
1211 New Jersey Road
Lakeland, FL 33801
Co-ed school, 4-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian Academy",'Lakeland=' + Lakeland.length); Lakeland[Lakeland.length] = createMarker(new GPoint(-81.92384400,27.98957500),"
Highlands Christian Academy
4210 Lakeland Highlands Road
Lakeland, FL 33813
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Highlands Christian Academy",'Lakeland=' + Lakeland.length); Lakeland[Lakeland.length] = createMarker(new GPoint(-81.97161200,28.02418800),"
Lakeland Christian School
1111 Forest Park Street
Lakeland, FL 33803
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lakeland Christian School",'Lakeland=' + Lakeland.length); Haines_City[Haines_City.length] = createMarker(new GPoint(-81.61477500,28.10684700),"
Landmark Christian School
2020 E Hinson Avenue
Haines City, FL 33844
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Landmark Christian School",'Haines_City=' + Haines_City.length); Haines_City[Haines_City.length] = createMarker(new GPoint(-81.62564600,28.11030000),"
Lighthouse Christian Learning Center
706 Melbourne Avenue
Haines City, FL 33844
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lighthouse Christian Learning Center",'Haines_City=' + Haines_City.length); Mulberry[Mulberry.length] = createMarker(new GPoint(-81.99210000,27.89080000),"
Mulberry Christian Academy
Po Box 1109
Mulberry, FL 33860
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mulberry Christian Academy",'Mulberry=' + Mulberry.length); Lakeland[Lakeland.length] = createMarker(new GPoint(-81.95801300,28.05809100),"
New Jerusalem Christian Academy
1129 N Missouri Avenue
Lakeland, FL 33805
Co-ed school, K-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Jerusalem Christian Academy",'Lakeland=' + Lakeland.length); Haines_City[Haines_City.length] = createMarker(new GPoint(-81.61320000,28.09380000),"
Palmer Academy
3200 St. Rd 546 E. Haines City, Fl 33844
Haines City, FL 33844
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Palmer Academy",'Haines_City=' + Haines_City.length); Lakeland[Lakeland.length] = createMarker(new GPoint(-81.88246400,27.94178000),"
Renaissance Progressive School
6825 Crews Lake Road
Lakeland, FL 33813
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Renaissance Progressive School",'Lakeland=' + Lakeland.length); Lakeland[Lakeland.length] = createMarker(new GPoint(-81.90064600,28.04803700),"
Santa Fe Catholic High School
3110 Highway 92 E
Lakeland, FL 33801
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Santa Fe Catholic High School",'Lakeland=' + Lakeland.length); Lakeland[Lakeland.length] = createMarker(new GPoint(-81.89842400,28.05506300),"
Sonrise Christian School
3151 Hardin Combee Road
Lakeland, FL 33801
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sonrise Christian School",'Lakeland=' + Lakeland.length); Lakeland[Lakeland.length] = createMarker(new GPoint(-81.94824400,27.94246900),"
Teen Challenge New Life Christian Academy
6754 S Carter Road
Lakeland, FL 33813
All-girls school, 6-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Teen Challenge New Life Christian Academy",'Lakeland=' + Lakeland.length); Lakeland[Lakeland.length] = createMarker(new GPoint(-81.95850000,28.04540000),"
Turning Point Academy
P.o. Box 459
Lakeland, FL 33846
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Turning Point Academy",'Lakeland=' + Lakeland.length); Lake_Wales[Lake_Wales.length] = createMarker(new GPoint(-81.61055800,27.93507100),"
The Vanguard School
22000 Highway 27
Lake Wales, FL 33859
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Vanguard School",'Lake_Wales=' + Lake_Wales.length); Bartow[Bartow.length] = createMarker(new GPoint(-81.85975200,27.89646700),"
Word Of Life Christian School
1555 W Main Street
Bartow, FL 33830
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Word Of Life Christian School",'Bartow=' + Bartow.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(Auburndale); map.removeOverlays(Bartow); map.removeOverlays(Eagle_Lake); map.removeOverlays(Fort_Meade); map.removeOverlays(Haines_City); map.removeOverlays(Lake_Wales); map.removeOverlays(Lakeland); map.removeOverlays(Mulberry); map.removeOverlays(Winter_Haven); 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(Winter_Haven);map.removeOverlays(Auburndale); map.removeOverlays(Bartow); map.removeOverlays(Eagle_Lake); map.removeOverlays(Fort_Meade); map.removeOverlays(Haines_City); map.removeOverlays(Lake_Wales); map.removeOverlays(Lakeland); map.removeOverlays(Mulberry); map.removeOverlays(Winter_Haven); map.addOverlays(Auburndale); centerByArray(Auburndale, false, false); cntMarker += Auburndale.length; map.addOverlays(Bartow); centerByArray(Bartow, false, false); cntMarker += Bartow.length; map.addOverlays(Eagle_Lake); centerByArray(Eagle_Lake, false, false); cntMarker += Eagle_Lake.length; map.addOverlays(Fort_Meade); centerByArray(Fort_Meade, false, false); cntMarker += Fort_Meade.length; map.addOverlays(Haines_City); centerByArray(Haines_City, false, false); cntMarker += Haines_City.length; map.addOverlays(Lake_Wales); centerByArray(Lake_Wales, false, false); cntMarker += Lake_Wales.length; map.addOverlays(Lakeland); centerByArray(Lakeland, false, false); cntMarker += Lakeland.length; map.addOverlays(Mulberry); centerByArray(Mulberry, false, false); cntMarker += Mulberry.length; map.addOverlays(Winter_Haven); centerByArray(Winter_Haven, false, false); cntMarker += Winter_Haven.length; centerByArray(Winter_Haven,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; }