function addMarkers() { mySelect = document.getElementById('selection'); Vero_Beach = [];Fellsmere = [];Sebastian = [];mySelect.options[mySelect.options.length] = new Option("Fellsmere schools",'all=Fellsmere'); mySelect.options[mySelect.options.length] = new Option("Sebastian schools",'all=Sebastian'); mySelect.options[mySelect.options.length] = new Option("Vero Beach schools",'all=Vero_Beach'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.39968500,27.63617900),"
Adult And Community Edu School
1426 19th Street
Vero Beach, FL 32960

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Adult And Community Edu School",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.41424561,27.67814445),"
Alternative Center For Education
4680 28th Court
Vero Beach, FL 32967

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alternative Center For Education",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.36753845,27.65363884),"
Beachland Elementary School
3350 Indian River Drive E
Vero Beach, FL 32963

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Beachland Elementary School",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.41455078,27.61046219),"
Citrus Elementary School
2771 Citrus Road
Vero Beach, FL 32962

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Citrus Elementary School",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.42952728,27.67411995),"
Dodgertown Elementary School
4350 43rd Avenue
Vero Beach, FL 32967

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dodgertown Elementary School",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.40517426,27.64463615),"
Exceptional Student Education
1990 25th Street
Vero Beach, FL 32960

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Exceptional Student Education",'Vero_Beach=' + Vero_Beach.length); Fellsmere[Fellsmere.length] = createMarker(new GPoint(-80.60375214,27.76924706),"
Fellsmere Elementary School
50 N Cypress Street
Fellsmere, FL 32948

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fellsmere Elementary School",'Fellsmere=' + Fellsmere.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.41424561,27.67564011),"
Gifford Middle School
4530 28th Court
Vero Beach, FL 32967

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Gifford Middle School",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.43798828,27.61673737),"
Glendale Elementary School
4940 8th Street
Vero Beach, FL 32968

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glendale Elementary School",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.38307953,27.56791687),"
Highlands Elementary School
500 20th Street Sw
Vero Beach, FL 32962

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Highlands Elementary School",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.43148300,27.65446200),"
Indian River Academy
3300 43rd Avenue Suite 2
Vero Beach, FL 32960

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Indian River Academy",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.45506287,27.63493729),"
Indian River Charter High School
6055 College Lane
Vero Beach, FL 32966

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Indian River Charter High School",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.39422400,27.63885000),"
Indian River County Superintendent's Office
01990 25th Street
Vero Beach, FL 32960

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Indian River County Superintendent's Office",'Vero_Beach=' + Vero_Beach.length); Sebastian[Sebastian.length] = createMarker(new GPoint(-80.44529724,27.74990082),"
Liberty Magnet School
8955 85th Street
Sebastian, FL 32958

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liberty Magnet School",'Sebastian=' + Sebastian.length); Fellsmere[Fellsmere.length] = createMarker(new GPoint(-80.59294128,27.76804733),"
North County Charter School
11 N Willow Street
Fellsmere, FL 32948

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North County Charter School",'Fellsmere=' + Fellsmere.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.38654327,27.63780975),"
Osceola Magnet School
665 20th Street
Vero Beach, FL 32960

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Osceola Magnet School",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.40574646,27.59538651),"
Oslo Middle School
480 20th Avenue Sw
Vero Beach, FL 32962

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Oslo Middle School",'Vero_Beach=' + Vero_Beach.length); Sebastian[Sebastian.length] = createMarker(new GPoint(-80.46394348,27.76271248),"
Pelican Island Elementary School
1355 Schumann Drive
Sebastian, FL 32958

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pelican Island Elementary School",'Sebastian=' + Sebastian.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.42510223,27.63123703),"
Rosewood Magnet School
3850 16th Street
Vero Beach, FL 32960

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rosewood Magnet School",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-81.32143900,29.91300400),"
Saint Peter's Academy
34250 - 38th Avenue
Vero Beach, FL 32967

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Saint Peter's Academy",'Vero_Beach=' + Vero_Beach.length); Sebastian[Sebastian.length] = createMarker(new GPoint(-80.47091675,27.81609917),"
Sebastian Elementary School
400 Sebastian Blvd
Sebastian, FL 32958

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sebastian Elementary School",'Sebastian=' + Sebastian.length); Sebastian[Sebastian.length] = createMarker(new GPoint(-80.45595551,27.76282120),"
Sebastian Junior High Charter
782 Wave Street
Sebastian, FL 32958

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sebastian Junior High Charter",'Sebastian=' + Sebastian.length); Sebastian[Sebastian.length] = createMarker(new GPoint(-80.47091675,27.81609917),"
Sebastian River Middle School
9400 County Road 512
Sebastian, FL 32958

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sebastian River Middle School",'Sebastian=' + Sebastian.length); Sebastian[Sebastian.length] = createMarker(new GPoint(-80.47091675,27.81609917),"
Sebastian River Senior High School
9001 Nintieth Avenue
Sebastian, FL 32958

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sebastian River Senior High School",'Sebastian=' + Sebastian.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.40435791,27.58300209),"
Thompson Elementary School
1110 18th Avenue Sw
Vero Beach, FL 32962

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thompson Elementary School",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.40351868,27.62368393),"
Vero Beach Elementary School
1770 12th Street
Vero Beach, FL 32960

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Vero Beach Elementary School",'Vero_Beach=' + Vero_Beach.length); Vero_Beach[Vero_Beach.length] = createMarker(new GPoint(-80.40281677,27.63066292),"
Vero Beach High School
1707 16th Street
Vero Beach, FL 32960

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Vero Beach High School",'Vero_Beach=' + Vero_Beach.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,10); /* 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(Fellsmere); map.removeOverlays(Sebastian); map.removeOverlays(Vero_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(Vero_Beach);map.removeOverlays(Fellsmere); map.removeOverlays(Sebastian); map.removeOverlays(Vero_Beach); map.addOverlays(Fellsmere); centerByArray(Fellsmere, false, false); cntMarker += Fellsmere.length; map.addOverlays(Sebastian); centerByArray(Sebastian, false, false); cntMarker += Sebastian.length; map.addOverlays(Vero_Beach); centerByArray(Vero_Beach, false, false); cntMarker += Vero_Beach.length; centerByArray(Vero_Beach,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'); } }