function addMarkers(){ mySelect = document.getElementById('selection'); Miami = [];Fort_Myers = [];Melbourne = [];Miami_Beach = [];Miami_Shores = [];Coconut_Creek = [];West_Palm_Beach = [];Coconut_Grove = [];Clearwater = [];Vero_Beach = [];Coral_Gables = [];Tampa = [];Fort_Lauderdale = [];mySelect.options[mySelect.options.length] = new Option("Clearwater schools",'all=Clearwater'); mySelect.options[mySelect.options.length] = new Option("Coconut Creek schools",'all=Coconut_Creek'); mySelect.options[mySelect.options.length] = new Option("Coconut Grove schools",'all=Coconut_Grove'); mySelect.options[mySelect.options.length] = new Option("Coral Gables schools",'all=Coral_Gables'); mySelect.options[mySelect.options.length] = new Option("Fort Lauderdale schools",'all=Fort_Lauderdale'); mySelect.options[mySelect.options.length] = new Option("Fort Myers schools",'all=Fort_Myers'); mySelect.options[mySelect.options.length] = new Option("Melbourne schools",'all=Melbourne'); mySelect.options[mySelect.options.length] = new Option("Miami schools",'all=Miami'); mySelect.options[mySelect.options.length] = new Option("Miami Beach schools",'all=Miami_Beach'); mySelect.options[mySelect.options.length] = new Option("Miami Shores schools",'all=Miami_Shores'); mySelect.options[mySelect.options.length] = new Option("Tampa schools",'all=Tampa'); mySelect.options[mySelect.options.length] = new Option("Vero Beach schools",'all=Vero_Beach'); mySelect.options[mySelect.options.length] = new Option("West Palm Beach schools",'all=West_Palm_Beach'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Miami[Miami.length] = createMarker(new GPoint(-80.43227400,25.70321700),"
Alexander School - 3rd Campus
14850 Sw 67 Avenue
Miami, FL 33143
Co-ed school, 1-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alexander School - 3rd Campus",'Miami=' + Miami.length); Miami[Miami.length] = createMarker(new GPoint(-80.30850500,25.63713900),"
Alexander School Inc
14400 Old Cutler Road
Miami, FL 33158
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alexander School Inc",'Miami=' + Miami.length); Fort_Myers[Fort_Myers.length] = createMarker(new GPoint(-81.88279700,26.59655600),"
Fort Myers Christian School
1550 Colonial Blvd
Fort Myers, FL 33907
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fort Myers Christian School",'Fort_Myers=' + Fort_Myers.length); Miami[Miami.length] = createMarker(new GPoint(-80.36070000,25.65880000),"
Gettysburg Academy Of Miami
10870 Sw 113 Pl. 2nd Floor
Miami, FL 33176
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gettysburg Academy Of Miami",'Miami=' + Miami.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); Miami_Beach[Miami_Beach.length] = createMarker(new GPoint(-80.14109500,25.78218200),"
Landow Yeshiva/lubavitch Educational Center
1140 Alton Road
Miami Beach, FL 33139
Co-ed school, 1-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Landow Yeshiva/lubavitch Educational Center",'Miami_Beach=' + Miami_Beach.length); Miami[Miami.length] = createMarker(new GPoint(-80.32349500,25.71679800),"
Learning Experience School
5651 S.w. 82nd Ave. Road
Miami, FL 33143
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Learning Experience School",'Miami=' + Miami.length); Miami_Shores[Miami_Shores.length] = createMarker(new GPoint(-80.18462300,25.86185100),"
Miami Shores Presbyterian Chur
9405 Park Drive
Miami Shores, FL 33138
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Miami Shores Presbyterian Chur",'Miami_Shores=' + Miami_Shores.length); Coconut_Creek[Coconut_Creek.length] = createMarker(new GPoint(-80.18643600,26.32605500),"
The North Broward Preparatory
7600 Lyons Road
Coconut Creek, FL 33073
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The North Broward Preparatory",'Coconut_Creek=' + Coconut_Creek.length); West_Palm_Beach[West_Palm_Beach.length] = createMarker(new GPoint(-80.05029500,26.69744200),"
Palm Beach Day Academy
1901 South Flagler Dr.
West Palm Beach, FL 33401
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Palm Beach Day Academy",'West_Palm_Beach=' + West_Palm_Beach.length); Coconut_Grove[Coconut_Grove.length] = createMarker(new GPoint(-80.24552700,25.72422600),"
Ransom Everglades School
3575 Main Highway
Coconut Grove, FL 33133
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ransom Everglades School",'Coconut_Grove=' + Coconut_Grove.length); Clearwater[Clearwater.length] = createMarker(new GPoint(-82.70880500,28.01843400),"
Safety Harbor Montessori Academy
2669 McMullen Booth Rd
Clearwater, FL 33761
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Safety Harbor Montessori Academy",'Clearwater=' + Clearwater.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.33936200,27.60064100),"
Saint Edward's School
1895 Saint Edwards Drive
Vero Beach, FL 32963
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Saint Edward's School",'Vero_Beach=' + Vero_Beach.length); Coral_Gables[Coral_Gables.length] = createMarker(new GPoint(-80.27790100,25.74856300),"
St. Philip's Episcopal School
1142 Coral Way
Coral Gables, FL 33134
Co-ed school, 5-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Philip's Episcopal School",'Coral_Gables=' + Coral_Gables.length); Tampa[Tampa.length] = createMarker(new GPoint(-82.46670300,27.95047200),"
Tampa Preparatory School
727 W Cass St
Tampa, FL 33606
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tampa Preparatory School",'Tampa=' + Tampa.length); Fort_Lauderdale[Fort_Lauderdale.length] = createMarker(new GPoint(-80.23916000,26.07780200),"
University School Of NSU
3301 College Avenue
Fort Lauderdale, FL 33314
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("University School Of NSU",'Fort_Lauderdale=' + Fort_Lauderdale.length); map.removeOverlays(Clearwater); map.removeOverlays(Coconut_Creek); map.removeOverlays(Coconut_Grove); map.removeOverlays(Coral_Gables); map.removeOverlays(Fort_Lauderdale); map.removeOverlays(Fort_Myers); map.removeOverlays(Melbourne); map.removeOverlays(Miami); map.removeOverlays(Miami_Beach); map.removeOverlays(Miami_Shores); map.removeOverlays(Tampa); map.removeOverlays(Vero_Beach); map.removeOverlays(West_Palm_Beach); setTimeout(function(){map.addOverlays(Clearwater)},1000); setTimeout(function(){map.addOverlays(Coconut_Creek)},1000); setTimeout(function(){map.addOverlays(Coconut_Grove)},1000); setTimeout(function(){map.addOverlays(Coral_Gables)},1000); setTimeout(function(){map.addOverlays(Fort_Lauderdale)},1000); setTimeout(function(){map.addOverlays(Fort_Myers)},1000); setTimeout(function(){map.addOverlays(Melbourne)},1000); setTimeout(function(){map.addOverlays(Miami)},1000); setTimeout(function(){map.addOverlays(Miami_Beach)},1000); setTimeout(function(){map.addOverlays(Miami_Shores)},1000); setTimeout(function(){map.addOverlays(Tampa)},1000); setTimeout(function(){map.addOverlays(Vero_Beach)},1000); setTimeout(function(){map.addOverlays(West_Palm_Beach)},1000); maxLng = -80.05029500; maxLat = 28.22591400; minLng = -82.70880500; minLat = 25.63713900; 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(Clearwater); map.removeOverlays(Coconut_Creek); map.removeOverlays(Coconut_Grove); map.removeOverlays(Coral_Gables); map.removeOverlays(Fort_Lauderdale); map.removeOverlays(Fort_Myers); map.removeOverlays(Melbourne); map.removeOverlays(Miami); map.removeOverlays(Miami_Beach); map.removeOverlays(Miami_Shores); map.removeOverlays(Tampa); map.removeOverlays(Vero_Beach); map.removeOverlays(West_Palm_Beach); 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(Miami);map.removeOverlays(Clearwater); map.removeOverlays(Coconut_Creek); map.removeOverlays(Coconut_Grove); map.removeOverlays(Coral_Gables); map.removeOverlays(Fort_Lauderdale); map.removeOverlays(Fort_Myers); map.removeOverlays(Melbourne); map.removeOverlays(Miami); map.removeOverlays(Miami_Beach); map.removeOverlays(Miami_Shores); map.removeOverlays(Tampa); map.removeOverlays(Vero_Beach); map.removeOverlays(West_Palm_Beach); map.addOverlays(Clearwater); centerByArray(Clearwater, false, false); cntMarker += Clearwater.length; map.addOverlays(Coconut_Creek); centerByArray(Coconut_Creek, false, false); cntMarker += Coconut_Creek.length; map.addOverlays(Coconut_Grove); centerByArray(Coconut_Grove, false, false); cntMarker += Coconut_Grove.length; map.addOverlays(Coral_Gables); centerByArray(Coral_Gables, false, false); cntMarker += Coral_Gables.length; map.addOverlays(Fort_Lauderdale); centerByArray(Fort_Lauderdale, false, false); cntMarker += Fort_Lauderdale.length; map.addOverlays(Fort_Myers); centerByArray(Fort_Myers, false, false); cntMarker += Fort_Myers.length; map.addOverlays(Melbourne); centerByArray(Melbourne, false, false); cntMarker += Melbourne.length; map.addOverlays(Miami); centerByArray(Miami, false, false); cntMarker += Miami.length; map.addOverlays(Miami_Beach); centerByArray(Miami_Beach, false, false); cntMarker += Miami_Beach.length; map.addOverlays(Miami_Shores); centerByArray(Miami_Shores, false, false); cntMarker += Miami_Shores.length; map.addOverlays(Tampa); centerByArray(Tampa, false, false); cntMarker += Tampa.length; map.addOverlays(Vero_Beach); centerByArray(Vero_Beach, false, false); cntMarker += Vero_Beach.length; map.addOverlays(West_Palm_Beach); centerByArray(West_Palm_Beach, false, false); cntMarker += West_Palm_Beach.length; centerByArray(Miami,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///7198,6862,7258,6335,6475,6359,35555,7148,6998,7166,6907,7198,6862,7107,7258,6335,6475,5916,5917,6359,6568,35555,6640,7148,6998,7166,/all'); //window.open('/map.php?type=2&schools=7198,6862,7258,6335,6475,6359,35555,7148,6998,7166,6907,7198,6862,7107,7258,6335,6475,5916,5917,6359,6568,35555,6640,7148,6998,7166,&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; }