function addMarkers(){ mySelect = document.getElementById('selection'); Altamonte_Springs = [];Melbourne = [];Miami_Springs = [];Fort_Lauderdale = [];Saint_Augustine = [];Orlando = [];Tampa = [];Indialantic = [];Sarasota = [];Naples = [];New_Smyrna_Beach = [];mySelect.options[mySelect.options.length] = new Option("Altamonte Springs schools",'all=Altamonte_Springs'); mySelect.options[mySelect.options.length] = new Option("Fort Lauderdale schools",'all=Fort_Lauderdale'); mySelect.options[mySelect.options.length] = new Option("Indialantic schools",'all=Indialantic'); mySelect.options[mySelect.options.length] = new Option("Melbourne schools",'all=Melbourne'); mySelect.options[mySelect.options.length] = new Option("Miami Springs schools",'all=Miami_Springs'); mySelect.options[mySelect.options.length] = new Option("Naples schools",'all=Naples'); mySelect.options[mySelect.options.length] = new Option("New Smyrna Beach schools",'all=New_Smyrna_Beach'); mySelect.options[mySelect.options.length] = new Option("Orlando schools",'all=Orlando'); mySelect.options[mySelect.options.length] = new Option("Saint Augustine schools",'all=Saint_Augustine'); mySelect.options[mySelect.options.length] = new Option("Sarasota schools",'all=Sarasota'); mySelect.options[mySelect.options.length] = new Option("Tampa schools",'all=Tampa'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Altamonte_Springs[Altamonte_Springs.length] = createMarker(new GPoint(-81.40642300,28.68135600),"
Annunciation Catholic Academy
593 Jamestown Blvd
Altamonte Springs, FL 32714
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Annunciation Catholic Academy",'Altamonte_Springs=' + Altamonte_Springs.length); Melbourne[Melbourne.length] = createMarker(new GPoint(-80.64118200,28.15543000),"
Ascension Catholic School
2950 N Harbor City Blvd
Melbourne, FL 32935
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ascension Catholic School",'Melbourne=' + Melbourne.length); Miami_Springs[Miami_Springs.length] = createMarker(new GPoint(-80.28945100,25.81106700),"
Blessed Trinity Elementary School
4020 Curtiss Parkway
Miami Springs, FL 33166
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blessed Trinity Elementary School",'Miami_Springs=' + Miami_Springs.length); Fort_Lauderdale[Fort_Lauderdale.length] = createMarker(new GPoint(-80.20059900,26.05712700),"
Brauser Maimonides Academy
5300 Southwest 40th Avenue
Fort Lauderdale, FL 33314
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brauser Maimonides Academy",'Fort_Lauderdale=' + Fort_Lauderdale.length); Saint_Augustine[Saint_Augustine.length] = createMarker(new GPoint(-81.31155400,29.88897900),"
Cathedral Parish School
259 Saint George Street
Saint Augustine, FL 32084
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cathedral Parish School",'Saint_Augustine=' + Saint_Augustine.length); Orlando[Orlando.length] = createMarker(new GPoint(-81.42575700,28.51287900),"
The First Academy
2667 Bruton Blvd
Orlando, FL 32805
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The First Academy",'Orlando=' + Orlando.length); Tampa[Tampa.length] = createMarker(new GPoint(-82.47912400,28.06901100),"
Hillel School Of Tampa
2020 W Fletcher Avenue
Tampa, FL 33612
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hillel School Of Tampa",'Tampa=' + Tampa.length); Indialantic[Indialantic.length] = createMarker(new GPoint(-80.57790000,28.10990000),"
Holy Name Of Jesus School
3060 N Highway A1a
Indialantic, FL 32903
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Name Of Jesus School",'Indialantic=' + Indialantic.length); Sarasota[Sarasota.length] = createMarker(new GPoint(-82.51178300,27.29893700),"
Incarnation Catholic School
2911 Bee Ridge Road
Sarasota, FL 34239
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Incarnation Catholic School",'Sarasota=' + Sarasota.length); Naples[Naples.length] = createMarker(new GPoint(-81.71901000,26.17197100),"
Naples Christian Academy
3161 Santa Barbara Blvd
Naples, FL 34116
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Naples Christian Academy",'Naples=' + Naples.length); New_Smyrna_Beach[New_Smyrna_Beach.length] = createMarker(new GPoint(-80.93554000,29.03922800),"
Sacred Heart Catholic School
1003 Turnbull Street
New Smyrna Beach, FL 32168
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Catholic School",'New_Smyrna_Beach=' + New_Smyrna_Beach.length); Orlando[Orlando.length] = createMarker(new GPoint(-81.39372600,28.58904600),"
St. Charles Borromeo Catholic School
4005 Edgewater Drive
Orlando, FL 32804
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Charles Borromeo Catholic School",'Orlando=' + Orlando.length); Altamonte_Springs[Altamonte_Springs.length] = createMarker(new GPoint(-81.36554300,28.64727600),"
St. Mary Magdalen School
869 Maitland Avenue
Altamonte Springs, FL 32701
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary Magdalen School",'Altamonte_Springs=' + Altamonte_Springs.length); map.removeOverlays(Altamonte_Springs); map.removeOverlays(Fort_Lauderdale); map.removeOverlays(Indialantic); map.removeOverlays(Melbourne); map.removeOverlays(Miami_Springs); map.removeOverlays(Naples); map.removeOverlays(New_Smyrna_Beach); map.removeOverlays(Orlando); map.removeOverlays(Saint_Augustine); map.removeOverlays(Sarasota); map.removeOverlays(Tampa); setTimeout(function(){map.addOverlays(Altamonte_Springs)},1000); setTimeout(function(){map.addOverlays(Fort_Lauderdale)},1000); setTimeout(function(){map.addOverlays(Indialantic)},1000); setTimeout(function(){map.addOverlays(Melbourne)},1000); setTimeout(function(){map.addOverlays(Miami_Springs)},1000); setTimeout(function(){map.addOverlays(Naples)},1000); setTimeout(function(){map.addOverlays(New_Smyrna_Beach)},1000); setTimeout(function(){map.addOverlays(Orlando)},1000); setTimeout(function(){map.addOverlays(Saint_Augustine)},1000); setTimeout(function(){map.addOverlays(Sarasota)},1000); setTimeout(function(){map.addOverlays(Tampa)},1000); maxLng = -80.20059900; maxLat = 29.88897900; minLng = -82.51178300; minLat = 25.81106700; reCenterMap(); } // 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//////' + showArray); map.removeOverlays(Altamonte_Springs); map.removeOverlays(Fort_Lauderdale); map.removeOverlays(Indialantic); map.removeOverlays(Melbourne); map.removeOverlays(Miami_Springs); map.removeOverlays(Naples); map.removeOverlays(New_Smyrna_Beach); map.removeOverlays(Orlando); map.removeOverlays(Saint_Augustine); map.removeOverlays(Sarasota); map.removeOverlays(Tampa); 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(Altamonte_Springs);map.removeOverlays(Altamonte_Springs); map.removeOverlays(Fort_Lauderdale); map.removeOverlays(Indialantic); map.removeOverlays(Melbourne); map.removeOverlays(Miami_Springs); map.removeOverlays(Naples); map.removeOverlays(New_Smyrna_Beach); map.removeOverlays(Orlando); map.removeOverlays(Saint_Augustine); map.removeOverlays(Sarasota); map.removeOverlays(Tampa); map.addOverlays(Altamonte_Springs); centerByArray(Altamonte_Springs, false, false); cntMarker += Altamonte_Springs.length; map.addOverlays(Fort_Lauderdale); centerByArray(Fort_Lauderdale, false, false); cntMarker += Fort_Lauderdale.length; map.addOverlays(Indialantic); centerByArray(Indialantic, false, false); cntMarker += Indialantic.length; map.addOverlays(Melbourne); centerByArray(Melbourne, false, false); cntMarker += Melbourne.length; map.addOverlays(Miami_Springs); centerByArray(Miami_Springs, false, false); cntMarker += Miami_Springs.length; map.addOverlays(Naples); centerByArray(Naples, false, false); cntMarker += Naples.length; map.addOverlays(New_Smyrna_Beach); centerByArray(New_Smyrna_Beach, false, false); cntMarker += New_Smyrna_Beach.length; map.addOverlays(Orlando); centerByArray(Orlando, false, false); cntMarker += Orlando.length; map.addOverlays(Saint_Augustine); centerByArray(Saint_Augustine, false, false); cntMarker += Saint_Augustine.length; map.addOverlays(Sarasota); centerByArray(Sarasota, false, false); cntMarker += Sarasota.length; map.addOverlays(Tampa); centerByArray(Tampa, false, false); cntMarker += Tampa.length; centerByArray(Altamonte_Springs,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///6691,7181,6465,5957,6038,6691,6450,6026,7181,6993,6493,5938,7059,6073,6900,/all'); //window.open('/map.php?type=2&schools=6691,7181,6465,5957,6038,6691,6450,6026,7181,6993,6493,5938,7059,6073,6900,&school_level=&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; }