function addMarkers(){ mySelect = document.getElementById('selection'); Cocoa = [];West_Melbourne = [];Merritt_Island = [];Rockledge = [];Mims = [];Cocoa_Beach = [];Melbourne = [];Palm_Bay = [];Sharpes = [];Titusville = [];mySelect.options[mySelect.options.length] = new Option("Cocoa schools",'all=Cocoa'); mySelect.options[mySelect.options.length] = new Option("Cocoa Beach schools",'all=Cocoa_Beach'); mySelect.options[mySelect.options.length] = new Option("Melbourne schools",'all=Melbourne'); mySelect.options[mySelect.options.length] = new Option("Merritt Island schools",'all=Merritt_Island'); mySelect.options[mySelect.options.length] = new Option("Mims schools",'all=Mims'); mySelect.options[mySelect.options.length] = new Option("Palm Bay schools",'all=Palm_Bay'); mySelect.options[mySelect.options.length] = new Option("Rockledge schools",'all=Rockledge'); mySelect.options[mySelect.options.length] = new Option("Sharpes schools",'all=Sharpes'); mySelect.options[mySelect.options.length] = new Option("Titusville schools",'all=Titusville'); mySelect.options[mySelect.options.length] = new Option("West Melbourne schools",'all=West_Melbourne'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Cocoa[Cocoa.length] = createMarker(new GPoint(-80.73303700,28.36524500),"
Atlantic Inclusive Academy
825 Forrest Ave
Cocoa, FL 32922
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Atlantic Inclusive Academy",'Cocoa=' + Cocoa.length); Cocoa[Cocoa.length] = createMarker(new GPoint(-80.70590000,28.26150000),"
Bethel Christian Academy
1950 Michigan Avenue
Cocoa, FL 32922
Co-ed school, 1-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethel Christian Academy",'Cocoa=' + Cocoa.length); West_Melbourne[West_Melbourne.length] = createMarker(new GPoint(-80.63867500,28.07523700),"
Brevard Christian School
1100 Dorchester Avenue
West Melbourne, FL 32904
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brevard Christian School",'West_Melbourne=' + West_Melbourne.length); Merritt_Island[Merritt_Island.length] = createMarker(new GPoint(-80.70104300,28.36085400),"
Brevard Homeschool Academy Inc.
276 Mcleod Street
Merritt Island, FL 32953
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brevard Homeschool Academy Inc.",'Merritt_Island=' + Merritt_Island.length); Rockledge[Rockledge.length] = createMarker(new GPoint(-80.74990000,28.39733700),"
Brevard Independent Private School
Po Box 561211
Rockledge, FL 32956
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brevard Independent Private School",'Rockledge=' + Rockledge.length); Mims[Mims.length] = createMarker(new GPoint(-80.85692900,28.70856000),"
Christ Aid Academy
Po Box 854
Mims, FL 32754
Co-ed school, K-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ Aid Academy",'Mims=' + Mims.length); Merritt_Island[Merritt_Island.length] = createMarker(new GPoint(-80.70142700,28.35765000),"
Christian Home School Coop
55 Mcleod Street
Merritt Island, FL 32953
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Home School Coop",'Merritt_Island=' + Merritt_Island.length); Cocoa[Cocoa.length] = createMarker(new GPoint(-80.77131400,28.36743000),"
Christian Homeschool Co-op#2
690 N Range Road
Cocoa, FL 32926
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Homeschool Co-op#2",'Cocoa=' + Cocoa.length); Cocoa_Beach[Cocoa_Beach.length] = createMarker(new GPoint(-80.60873800,28.30348800),"
Cocoa Beach Christian School Homeschool Umbrella
830 S Atlantic Avenue
Cocoa Beach, FL 32931
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cocoa Beach Christian School Homeschool Umbrella",'Cocoa_Beach=' + Cocoa_Beach.length); Melbourne[Melbourne.length] = createMarker(new GPoint(-80.64245500,28.13351100),"
Community Christian School Inc
1616 Ferndale Avenue
Melbourne, FL 32935
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Community Christian School Inc",'Melbourne=' + Melbourne.length); Palm_Bay[Palm_Bay.length] = createMarker(new GPoint(-80.65977800,28.01910300),"
Covenant Christian School
720 Emerson Dr Ne
Palm Bay, FL 32907
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Covenant Christian School",'Palm_Bay=' + Palm_Bay.length); Cocoa[Cocoa.length] = createMarker(new GPoint(-73.60158000,40.67000000),"
Creative Learning
823 N Cocoa Blvd
Cocoa, FL 32922
Co-ed school, 1-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Creative Learning",'Cocoa=' + Cocoa.length); Palm_Bay[Palm_Bay.length] = createMarker(new GPoint(-80.59702000,28.05293700),"
Diamond Community School, Inc.
2575 Pacific Avenue Ne
Palm Bay, FL 32905
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Diamond Community School, Inc.",'Palm_Bay=' + Palm_Bay.length); Palm_Bay[Palm_Bay.length] = createMarker(new GPoint(-80.68106500,28.03223300),"
Faith Christian School
341 Emerson Drive Nw
Palm Bay, FL 32907
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Christian School",'Palm_Bay=' + Palm_Bay.length); Melbourne[Melbourne.length] = createMarker(new GPoint(-80.62784400,28.07957100),"
Florida Air Academy
1950 Academy Drive
Melbourne, FL 32901
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Florida Air Academy",'Melbourne=' + Melbourne.length); Cocoa[Cocoa.length] = createMarker(new GPoint(-80.79714000,28.47772200),"
Florida Learning Academy
4641 Ashbury Bd
Cocoa, FL 32927
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Florida Learning Academy",'Cocoa=' + Cocoa.length); Melbourne[Melbourne.length] = createMarker(new GPoint(-80.69734900,28.22591400),"
Holy Trinity Episcopal Academy
5625 Holy Trinity Drive
Melbourne, FL 32940
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Trinity Episcopal Academy",'Melbourne=' + Melbourne.length); Palm_Bay[Palm_Bay.length] = createMarker(new GPoint(-80.60543300,28.03986800),"
Liberty High School
4630 Lipscomb Street Ne Suite 1
Palm Bay, FL 32905
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Liberty High School",'Palm_Bay=' + Palm_Bay.length); Melbourne[Melbourne.length] = createMarker(new GPoint(-80.62121800,28.05711100),"
Melbourne Central Catholic High School
100 E Florida Avenue
Melbourne, FL 32901
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Melbourne Central Catholic High School",'Melbourne=' + Melbourne.length); Merritt_Island[Merritt_Island.length] = createMarker(new GPoint(-80.70107200,28.35600000),"
Merritt Island Christian School
140 Magnolia Avenue
Merritt Island, FL 32952
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Merritt Island Christian School",'Merritt_Island=' + Merritt_Island.length); Melbourne[Melbourne.length] = createMarker(new GPoint(-80.62161200,28.07956100),"
New Covenant Christian School
1926 S Babcock Street
Melbourne, FL 32901
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Covenant Christian School",'Melbourne=' + Melbourne.length); Palm_Bay[Palm_Bay.length] = createMarker(new GPoint(-80.60530000,28.04490000),"
Palm Bay Christian Academy
Po Box 60201
Palm Bay, FL 32906
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Palm Bay Christian Academy",'Palm_Bay=' + Palm_Bay.length); Sharpes[Sharpes.length] = createMarker(new GPoint(-80.76020000,28.43190000),"
Pioneer Christian School
P.o. Box 1255
Sharpes, FL 32959
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pioneer Christian School",'Sharpes=' + Sharpes.length); Melbourne[Melbourne.length] = createMarker(new GPoint(-80.61928500,28.09689000),"
Rfm Christian Academy
777 S Apollo Blvd
Melbourne, FL 32901
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rfm Christian Academy",'Melbourne=' + Melbourne.length); Melbourne[Melbourne.length] = createMarker(new GPoint(-80.63038700,28.12647600),"
Sancta Familia Academy
1204 N Harbor City Blvd
Melbourne, FL 32935
Co-ed school, K-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sancta Familia Academy",'Melbourne=' + Melbourne.length); Titusville[Titusville.length] = createMarker(new GPoint(-80.83094000,28.63870000),"
Temple Christian Schools
1400 N Us Highway 1
Titusville, FL 32796
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Temple Christian Schools",'Titusville=' + Titusville.length); Melbourne[Melbourne.length] = createMarker(new GPoint(-80.67225500,28.17903700),"
Wade Christian Academy
4300 N Wickham
Melbourne, FL 32935
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wade Christian Academy",'Melbourne=' + Melbourne.length); Melbourne[Melbourne.length] = createMarker(new GPoint(-80.67373900,28.06856300),"
West Melbourne Christian Academy
3150 Milwaukee Avenue
Melbourne, FL 32904
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Melbourne Christian Academy",'Melbourne=' + Melbourne.length); Merritt_Island[Merritt_Island.length] = createMarker(new GPoint(-80.70636300,28.40264300),"
Wise Christian School
120 Venetian Way, Suite 25
Merritt Island, FL 32953
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wise Christian School",'Merritt_Island=' + Merritt_Island.length); Palm_Bay[Palm_Bay.length] = createMarker(new GPoint(-80.61496100,28.03894500),"
York Christian Academy
5816 Pinewood Drive Ne
Palm Bay, FL 32905
Co-ed school, K-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("York Christian Academy",'Palm_Bay=' + Palm_Bay.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(Cocoa); map.removeOverlays(Cocoa_Beach); map.removeOverlays(Melbourne); map.removeOverlays(Merritt_Island); map.removeOverlays(Mims); map.removeOverlays(Palm_Bay); map.removeOverlays(Rockledge); map.removeOverlays(Sharpes); map.removeOverlays(Titusville); map.removeOverlays(West_Melbourne); 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(Cocoa);map.removeOverlays(Cocoa); map.removeOverlays(Cocoa_Beach); map.removeOverlays(Melbourne); map.removeOverlays(Merritt_Island); map.removeOverlays(Mims); map.removeOverlays(Palm_Bay); map.removeOverlays(Rockledge); map.removeOverlays(Sharpes); map.removeOverlays(Titusville); map.removeOverlays(West_Melbourne); map.addOverlays(Cocoa); centerByArray(Cocoa, false, false); cntMarker += Cocoa.length; map.addOverlays(Cocoa_Beach); centerByArray(Cocoa_Beach, false, false); cntMarker += Cocoa_Beach.length; map.addOverlays(Melbourne); centerByArray(Melbourne, false, false); cntMarker += Melbourne.length; map.addOverlays(Merritt_Island); centerByArray(Merritt_Island, false, false); cntMarker += Merritt_Island.length; map.addOverlays(Mims); centerByArray(Mims, false, false); cntMarker += Mims.length; map.addOverlays(Palm_Bay); centerByArray(Palm_Bay, false, false); cntMarker += Palm_Bay.length; map.addOverlays(Rockledge); centerByArray(Rockledge, false, false); cntMarker += Rockledge.length; map.addOverlays(Sharpes); centerByArray(Sharpes, false, false); cntMarker += Sharpes.length; map.addOverlays(Titusville); centerByArray(Titusville, false, false); cntMarker += Titusville.length; map.addOverlays(West_Melbourne); centerByArray(West_Melbourne, false, false); cntMarker += West_Melbourne.length; centerByArray(Cocoa,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; }