function addMarkers(){ mySelect = document.getElementById('selection'); Davie = [];Davie[Davie.length] = createMarker(new GPoint(-80.25988400,26.06014600),"
American Preparatory Academy
4850 S Pine Island Road
Davie, FL 33328
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("American Preparatory Academy",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.36160100,26.04082800),"
Apple Tree Montessori School
6301 Southwest 160th Avenue
Davie, FL 33331
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Apple Tree Montessori School",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.25949400,26.04651100),"
Conservatory Prep Senior High School
5850 Pine Island Road
Davie, FL 33328
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Conservatory Prep Senior High School",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.25950200,26.04680700),"
David Posnack Hebrew Day School
5810 South Pine Island Rd.
Davie, FL 33328
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("David Posnack Hebrew Day School",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.24976500,26.07303700),"
Gloria Dei Lutheran Academy
7601 Sw 39th Street
Davie, FL 33328
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gloria Dei Lutheran Academy",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.22791800,26.06399600),"
Kentwood Preparatory School
4650 Sw 61st Avenue
Davie, FL 33314
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kentwood Preparatory School",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.25192300,26.04655800),"
Montessori International
5955 S University Drive
Davie, FL 33328
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori International",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.31324300,26.10418700),"
Parkway Christian Elementary School
1200 S Flamingo Road
Davie, FL 33325
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parkway Christian Elementary School",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.25595900,26.05260900),"
Pine Island Montessori
5499 Sw 82nd Avenue
Davie, FL 33328
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pine Island Montessori",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.33025200,26.10394700),"
St. Bonaventure Catholic School
1301 Sw 136th Ave
Davie, FL 33325
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Bonaventure Catholic School",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.25224600,26.07104100),"
St. David Catholic School
3900 S University Drive
Davie, FL 33328
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. David Catholic School",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.23188700,26.05356200),"
Summit Questa Montessori School
5451 Southwest 64th Avenue
Davie, FL 33314
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Summit Questa Montessori School",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.18766200,26.06217900),"
True-bread Christian Academy
3367 N University Drive
Davie, FL 33024
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("True-bread Christian Academy",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.22824600,26.07586300),"
Wesley's Academy
4650 Sw 61st Ave
Davie, FL 33317
Co-ed school, -
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wesley's Academy",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.25210900,26.06770400),"
Westlake Preparatory School
4188 S University Dr
Davie, FL 33328
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westlake Preparatory School",'Davie=' + Davie.length); Davie[Davie.length] = createMarker(new GPoint(-80.25181400,26.07663800),"
Westlake School
4188 S University Drive
Davie, FL 33328
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westlake School",'Davie=' + Davie.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//////' + showArray); map.removeOverlays(Davie); 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(Davie);map.removeOverlays(Davie); map.addOverlays(Davie); centerByArray(Davie, false, false); cntMarker += Davie.length; centerByArray(Davie,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=&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; }