function addMarkers(){ mySelect = document.getElementById('selection'); Ponte_Vedra = [];Saint_Augustine = [];Ponte_Vedra_Beach = [];Ponte_Vedra_Bc = [];Ponte_Vedra_Be = [];Jacksonville = [];mySelect.options[mySelect.options.length] = new Option("Jacksonville schools",'all=Jacksonville'); mySelect.options[mySelect.options.length] = new Option("Ponte Vedra schools",'all=Ponte_Vedra'); mySelect.options[mySelect.options.length] = new Option("Ponte Vedra Bc schools",'all=Ponte_Vedra_Bc'); mySelect.options[mySelect.options.length] = new Option("Ponte Vedra Be schools",'all=Ponte_Vedra_Be'); mySelect.options[mySelect.options.length] = new Option("Ponte Vedra Beach schools",'all=Ponte_Vedra_Beach'); mySelect.options[mySelect.options.length] = new Option("Saint Augustine schools",'all=Saint_Augustine'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Ponte_Vedra[Ponte_Vedra.length] = createMarker(new GPoint(-81.39695000,30.17693000),"
Accotink Academy
171 Canal Blvd
Ponte Vedra, FL 32082
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Accotink Academy",'Ponte_Vedra=' + Ponte_Vedra.length); Saint_Augustine[Saint_Augustine.length] = createMarker(new GPoint(-81.34994600,29.84569500),"
Beacon Of Hope Christian School
1230 Kings Estate Rd
Saint Augustine, FL 32086
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beacon Of Hope Christian School",'Saint_Augustine=' + Saint_Augustine.length); Saint_Augustine[Saint_Augustine.length] = createMarker(new GPoint(-81.32706800,29.85159600),"
Bible Baptist School
2485 Old Moultrie Rd
Saint Augustine, FL 32086
Co-ed school, -
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bible Baptist School",'Saint_Augustine=' + Saint_Augustine.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); Ponte_Vedra_Beach[Ponte_Vedra_Beach.length] = createMarker(new GPoint(-81.38000500,30.22767100),"
Christ Episcopal Preschool
400 San Juan Drive
Ponte Vedra Beach, FL 32082
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ Episcopal Preschool",'Ponte_Vedra_Beach=' + Ponte_Vedra_Beach.length); Ponte_Vedra_Bc[Ponte_Vedra_Bc.length] = createMarker(new GPoint(-81.38580000,30.23940000),"
Cornerstone Christian Academy
Po Box 1279
Ponte Vedra Bc, FL 32004
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone Christian Academy",'Ponte_Vedra_Bc=' + Ponte_Vedra_Bc.length); Ponte_Vedra_Be[Ponte_Vedra_Be.length] = createMarker(new GPoint(-81.38580000,30.23940000),"
Cornerstone Christian Academy
P O Box 1279
Ponte Vedra Be, FL 32004
Co-ed school, KG-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone Christian Academy",'Ponte_Vedra_Be=' + Ponte_Vedra_Be.length); Saint_Augustine[Saint_Augustine.length] = createMarker(new GPoint(-81.32710400,29.88479500),"
Creative Kids
37 South Dixie Hwy
Saint Augustine, FL 32084
Co-ed school, K-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Creative Kids",'Saint_Augustine=' + Saint_Augustine.length); Saint_Augustine[Saint_Augustine.length] = createMarker(new GPoint(-81.35346800,29.92116300),"
Harbor Light Christian Academy
705a Delespine Avenue
Saint Augustine, FL 32084
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harbor Light Christian Academy",'Saint_Augustine=' + Saint_Augustine.length); Ponte_Vedra_Beach[Ponte_Vedra_Beach.length] = createMarker(new GPoint(-81.38580000,30.23940000),"
Palmer Catholic Academy
Po Box 2705
Ponte Vedra Beach, FL 32004
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Palmer Catholic Academy",'Ponte_Vedra_Beach=' + Ponte_Vedra_Beach.length); Jacksonville[Jacksonville.length] = createMarker(new GPoint(-81.65872300,30.06675100),"
St. Johns Grammar School
2353 State Road 13
Jacksonville, FL 32259
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Johns Grammar School",'Jacksonville=' + Jacksonville.length); Jacksonville[Jacksonville.length] = createMarker(new GPoint(-81.63621600,30.08479400),"
San Juan Del Rio Catholic School
1714 State Road 13
Jacksonville, FL 32259
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("San Juan Del Rio Catholic School",'Jacksonville=' + Jacksonville.length); Saint_Augustine[Saint_Augustine.length] = createMarker(new GPoint(-81.35671400,29.83109400),"
St John's Academy
1533 Wildwood Drive
Saint Augustine, FL 32086
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John's Academy",'Saint_Augustine=' + Saint_Augustine.length); Saint_Augustine[Saint_Augustine.length] = createMarker(new GPoint(-81.31253500,29.89170500),"
Trinity Early Learning Center
215 Saint George Street
Saint Augustine, FL 32084
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Early Learning Center",'Saint_Augustine=' + Saint_Augustine.length); Saint_Augustine[Saint_Augustine.length] = createMarker(new GPoint(-81.32472200,29.85093500),"
The Village Academy
145 Lewis Point Road
Saint Augustine, FL 32086
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Village Academy",'Saint_Augustine=' + Saint_Augustine.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/////1/' + showArray); map.removeOverlays(Jacksonville); map.removeOverlays(Ponte_Vedra); map.removeOverlays(Ponte_Vedra_Bc); map.removeOverlays(Ponte_Vedra_Be); map.removeOverlays(Ponte_Vedra_Beach); map.removeOverlays(Saint_Augustine); 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(Ponte_Vedra);map.removeOverlays(Jacksonville); map.removeOverlays(Ponte_Vedra); map.removeOverlays(Ponte_Vedra_Bc); map.removeOverlays(Ponte_Vedra_Be); map.removeOverlays(Ponte_Vedra_Beach); map.removeOverlays(Saint_Augustine); map.addOverlays(Jacksonville); centerByArray(Jacksonville, false, false); cntMarker += Jacksonville.length; map.addOverlays(Ponte_Vedra); centerByArray(Ponte_Vedra, false, false); cntMarker += Ponte_Vedra.length; map.addOverlays(Ponte_Vedra_Bc); centerByArray(Ponte_Vedra_Bc, false, false); cntMarker += Ponte_Vedra_Bc.length; map.addOverlays(Ponte_Vedra_Be); centerByArray(Ponte_Vedra_Be, false, false); cntMarker += Ponte_Vedra_Be.length; map.addOverlays(Ponte_Vedra_Beach); centerByArray(Ponte_Vedra_Beach, false, false); cntMarker += Ponte_Vedra_Beach.length; map.addOverlays(Saint_Augustine); centerByArray(Saint_Augustine, false, false); cntMarker += Saint_Augustine.length; centerByArray(Ponte_Vedra,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=1&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; }