function addMarkers(){ mySelect = document.getElementById('selection'); Port_St_Lucie = [];Fort_Pierce = [];Ft__Pierce = [];Port_Saint_Lucie = [];mySelect.options[mySelect.options.length] = new Option("Fort Pierce schools",'all=Fort_Pierce'); mySelect.options[mySelect.options.length] = new Option("Ft Pierce schools",'all=Ft__Pierce'); mySelect.options[mySelect.options.length] = new Option("Port Saint Lucie schools",'all=Port_Saint_Lucie'); mySelect.options[mySelect.options.length] = new Option("Port St Lucie schools",'all=Port_St_Lucie'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Port_St_Lucie[Port_St_Lucie.length] = createMarker(new GPoint(-80.38317300,27.22310100),"
Barnabas Christian Academy
1120 SW Paar Drive
Port St. Lucie, FL 34953
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Barnabas Christian Academy",'Port_St_Lucie=' + Port_St_Lucie.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.33295300,27.41229200),"
Bethany School
524 S Market Avenue
Fort Pierce, FL 34982
Co-ed school, K-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethany School",'Fort_Pierce=' + Fort_Pierce.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.35045500,27.38345500),"
Bible Baptist Church And School
4401 S 25th Street
Fort Pierce, FL 34981
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bible Baptist Church And School",'Fort_Pierce=' + Fort_Pierce.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.33398200,27.39489200),"
Faith Baptist School
3607 Oleander Avenue
Fort Pierce, FL 34982
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Baptist School",'Fort_Pierce=' + Fort_Pierce.length); Ft__Pierce[Ft__Pierce.length] = createMarker(new GPoint(-80.35793500,27.44139500),"
Golden Rule Academy
700 South 33rd Street
Ft Pierce, FL 34947
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Golden Rule Academy",'Ft__Pierce=' + Ft__Pierce.length); Port_St_Lucie[Port_St_Lucie.length] = createMarker(new GPoint(-80.27396700,27.27865600),"
Heritage Christian School
2490 Se Melaleuca Blvd
Port St. Lucie, FL 34952
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian School",'Port_St_Lucie=' + Port_St_Lucie.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.37305400,27.40476600),"
Jes Memorial Sda School
3201 Memory Lane
Fort Pierce, FL 34981
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jes Memorial Sda School",'Fort_Pierce=' + Fort_Pierce.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.36057000,27.44403700),"
John Carroll Catholic High School
3402 Delaware Avenue
Fort Pierce, FL 34947
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("John Carroll Catholic High School",'Fort_Pierce=' + Fort_Pierce.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.36588200,27.47320100),"
Kilpatrick Christian Academy
3950 Juanita Avenue
Fort Pierce, FL 34946
Co-ed school, K-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kilpatrick Christian Academy",'Fort_Pierce=' + Fort_Pierce.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.36170000,27.37443000),"
Liberty Baptist Academy
3660 W Midway Road
Fort Pierce, FL 34981
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Liberty Baptist Academy",'Fort_Pierce=' + Fort_Pierce.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.33372000,27.40630000),"
Lighthouse Christian Academy
3212 Oleander Avenue
Fort Pierce, FL 34982
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lighthouse Christian Academy",'Fort_Pierce=' + Fort_Pierce.length); Port_Saint_Lucie[Port_Saint_Lucie.length] = createMarker(new GPoint(-80.29832200,27.27412800),"
Morningside Academy
2180 S.E. Morningside Blvd.
Port Saint Lucie, FL 34952
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Morningside Academy",'Port_Saint_Lucie=' + Port_Saint_Lucie.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.32984400,27.37008900),"
New Life Christian Academy
5300 Melville Road
Fort Pierce, FL 34982
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Life Christian Academy",'Fort_Pierce=' + Fort_Pierce.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.45521200,27.44906300),"
Orange Avenue Baptist School
100 Cyclone Drive
Fort Pierce, FL 34945
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Orange Avenue Baptist School",'Fort_Pierce=' + Fort_Pierce.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.35794400,27.44146100),"
Palm Vista Christian School
700 South 33rd Street
Fort Pierce, FL 34947
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Palm Vista Christian School",'Fort_Pierce=' + Fort_Pierce.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.34444700,27.39892900),"
Park Centre Academy
3453 Sunrise Blvd
Fort Pierce, FL 34982
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Park Centre Academy",'Fort_Pierce=' + Fort_Pierce.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.35825400,27.44465700),"
St Anastasia School
401 S 33rd Street
Fort Pierce, FL 34947
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Anastasia School",'Fort_Pierce=' + Fort_Pierce.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.32240300,27.44640300),"
St Andrew's Episcopal School
210 S Indian River Drive
Fort Pierce, FL 34950
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Andrew's Episcopal School",'Fort_Pierce=' + Fort_Pierce.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.33950700,27.42203200),"
St James Academy
2603 S 15th Street
Fort Pierce, FL 34982
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St James Academy",'Fort_Pierce=' + Fort_Pierce.length); Fort_Pierce[Fort_Pierce.length] = createMarker(new GPoint(-80.33394400,27.36570000),"
Sun Grove Montessori School
5610 Oleander Avenue
Fort Pierce, FL 34982
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sun Grove Montessori School",'Fort_Pierce=' + Fort_Pierce.length); Port_Saint_Lucie[Port_Saint_Lucie.length] = createMarker(new GPoint(-80.40760400,27.32747600),"
Treasure Coast Christian Academy
590 NW Peacock Blvd 4
Port Saint Lucie, FL 34986
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Treasure Coast Christian Academy",'Port_Saint_Lucie=' + Port_Saint_Lucie.length); Port_Saint_Lucie[Port_Saint_Lucie.length] = createMarker(new GPoint(-80.37288500,27.31447900),"
Victory Forge Military Academy
602 Sw Biltmore Street
Port Saint Lucie, FL 34983
All-boys school, 6-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Victory Forge Military Academy",'Port_Saint_Lucie=' + Port_Saint_Lucie.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/////3/' + showArray); map.removeOverlays(Fort_Pierce); map.removeOverlays(Ft__Pierce); map.removeOverlays(Port_Saint_Lucie); map.removeOverlays(Port_St_Lucie); 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(Port_St_Lucie);map.removeOverlays(Fort_Pierce); map.removeOverlays(Ft__Pierce); map.removeOverlays(Port_Saint_Lucie); map.removeOverlays(Port_St_Lucie); map.addOverlays(Fort_Pierce); centerByArray(Fort_Pierce, false, false); cntMarker += Fort_Pierce.length; map.addOverlays(Ft__Pierce); centerByArray(Ft__Pierce, false, false); cntMarker += Ft__Pierce.length; map.addOverlays(Port_Saint_Lucie); centerByArray(Port_Saint_Lucie, false, false); cntMarker += Port_Saint_Lucie.length; map.addOverlays(Port_St_Lucie); centerByArray(Port_St_Lucie, false, false); cntMarker += Port_St_Lucie.length; centerByArray(Port_St_Lucie,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=3&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; }