function addMarkers() { mySelect = document.getElementById('selection'); Milton = [];Bagdad = [];Jay = [];Gulf_Breeze = [];Navarre = [];Pace = [];Holt = [];mySelect.options[mySelect.options.length] = new Option("Bagdad schools",'all=Bagdad'); mySelect.options[mySelect.options.length] = new Option("Gulf Breeze schools",'all=Gulf_Breeze'); mySelect.options[mySelect.options.length] = new Option("Holt schools",'all=Holt'); mySelect.options[mySelect.options.length] = new Option("Jay schools",'all=Jay'); mySelect.options[mySelect.options.length] = new Option("Milton schools",'all=Milton'); mySelect.options[mySelect.options.length] = new Option("Navarre schools",'all=Navarre'); mySelect.options[mySelect.options.length] = new Option("Pace schools",'all=Pace'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Milton[Milton.length] = createMarker(new GPoint(-87.09761047,30.57156563),"
Avalon Middle School (formerly Pace
5445 King Arthurs Way
Milton, FL 32583

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Avalon Middle School (formerly Pace",'Milton=' + Milton.length); Bagdad[Bagdad.length] = createMarker(new GPoint(-87.03269958,30.60169983),"
Bagdad Elementary School
4512 Forsyth Street
Bagdad, FL 32530

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bagdad Elementary School",'Bagdad=' + Bagdad.length); Milton[Milton.length] = createMarker(new GPoint(-87.04043000,30.62491200),"
Berryhill Complex
6751 Berryhill Street
Milton, FL 32570

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Berryhill Complex",'Milton=' + Milton.length); Milton[Milton.length] = createMarker(new GPoint(-87.11804199,30.64693642),"
Berryhill Elementary School
4900 Berryhill Road
Milton, FL 32570

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Berryhill Elementary School",'Milton=' + Milton.length); Milton[Milton.length] = createMarker(new GPoint(-86.87916565,30.84386635),"
Blackwater Stop Camp School
2451 Stop Camp Road
Milton, FL 32570

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blackwater Stop Camp School",'Milton=' + Milton.length); Milton[Milton.length] = createMarker(new GPoint(-87.07591248,30.76383781),"
Central High School
6180 Central School Road
Milton, FL 32570

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central High School",'Milton=' + Milton.length); Jay[Jay.length] = createMarker(new GPoint(-87.20433044,30.77970886),"
Chumuckla Elementary School
2312 Highway 182
Jay, FL 32565

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chumuckla Elementary School",'Jay=' + Jay.length); Milton[Milton.length] = createMarker(new GPoint(-87.02114105,30.62176323),"
East Milton Elementary School
5156 Waroad Basin Road
Milton, FL 32583

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Milton Elementary School",'Milton=' + Milton.length); Gulf_Breeze[Gulf_Breeze.length] = createMarker(new GPoint(-87.16871643,30.36180305),"
Gulf Breeze Elementary School
549 Gulf Breeze Parkway
Gulf Breeze, FL 32561

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gulf Breeze Elementary School",'Gulf_Breeze=' + Gulf_Breeze.length); Gulf_Breeze[Gulf_Breeze.length] = createMarker(new GPoint(-87.16633600,30.35874100),"
Gulf Breeze High School
675 Gulf Breeze Parkway
Gulf Breeze, FL 32561

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gulf Breeze High School",'Gulf_Breeze=' + Gulf_Breeze.length); Gulf_Breeze[Gulf_Breeze.length] = createMarker(new GPoint(-87.16767120,30.35975266),"
Gulf Breeze Middle School
649 Gulf Breeze Parkway
Gulf Breeze, FL 32561

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gulf Breeze Middle School",'Gulf_Breeze=' + Gulf_Breeze.length); Milton[Milton.length] = createMarker(new GPoint(-87.06442261,30.62793732),"
Hobbs Middle School
5317 Glover Lane
Milton, FL 32570

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hobbs Middle School",'Milton=' + Milton.length); Navarre[Navarre.length] = createMarker(new GPoint(-86.88974762,30.40590668),"
Holley-navarre Middle School
1976 Williams Creek Drive
Navarre, FL 32566

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Holley-navarre Middle School",'Navarre=' + Navarre.length); Navarre[Navarre.length] = createMarker(new GPoint(-86.91851044,30.40440178),"
Holley-navarre Primary School
1955 Lowe Road
Navarre, FL 32566

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holley-navarre Primary School",'Navarre=' + Navarre.length); Navarre[Navarre.length] = createMarker(new GPoint(-86.88823700,30.40377998),"
Holly-navarre Intermediate
1936 Navarre School Road
Navarre, FL 32566

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holly-navarre Intermediate",'Navarre=' + Navarre.length); Jay[Jay.length] = createMarker(new GPoint(-87.15589905,30.94179916),"
Jay Elementary School
13833 Alabama Street
Jay, FL 32565

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jay Elementary School",'Jay=' + Jay.length); Jay[Jay.length] = createMarker(new GPoint(-87.15589905,30.94179916),"
Jay High School
13863 Alabama Street
Jay, FL 32565

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jay High School",'Jay=' + Jay.length); Milton[Milton.length] = createMarker(new GPoint(-87.04478455,30.64832306),"
Learning Academy Of Santa Rosa
5880 N Stewart Street
Milton, FL 32570

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Learning Academy Of Santa Rosa",'Milton=' + Milton.length); Milton[Milton.length] = createMarker(new GPoint(-87.09925842,30.64684105),"
Locklin Technical Center
5330 Berryhill Road
Milton, FL 32570

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Locklin Technical Center",'Milton=' + Milton.length); Milton[Milton.length] = createMarker(new GPoint(-87.04516602,30.64985657),"
Martin Luther King Middle School
5928 Stewart Street
Milton, FL 32570

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Martin Luther King Middle School",'Milton=' + Milton.length); Milton[Milton.length] = createMarker(new GPoint(-86.97323608,30.64197731),"
Milton Girls Juv. Residential
5770 E Milton Road
Milton, FL 32538

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Milton Girls Juv. Residential",'Milton=' + Milton.length); Milton[Milton.length] = createMarker(new GPoint(-87.04340363,30.62252045),"
Milton High School
5445 Stewart Street
Milton, FL 32570

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Milton High School",'Milton=' + Milton.length); Milton[Milton.length] = createMarker(new GPoint(-86.87848663,30.85060692),"
Munson Elementary School
11550 Munson Highway
Milton, FL 32570

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Munson Elementary School",'Milton=' + Milton.length); Navarre[Navarre.length] = createMarker(new GPoint(-86.86280823,30.42263794),"
Navarre High School
8600 High School Boulevar
Navarre, FL 32566

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Navarre High School",'Navarre=' + Navarre.length); Gulf_Breeze[Gulf_Breeze.length] = createMarker(new GPoint(-87.09484100,30.38364792),"
Oriole Beach Elementary School
1260 Oriole Beach Road
Gulf Breeze, FL 32563

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oriole Beach Elementary School",'Gulf_Breeze=' + Gulf_Breeze.length); Pace[Pace.length] = createMarker(new GPoint(-87.15721130,30.61470413),"
Pace High School
4065 Norris Road
Pace, FL 32571

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pace High School",'Pace=' + Pace.length); Pace[Pace.length] = createMarker(new GPoint(-87.11125946,30.60838509),"
Pea Ridge Elementary School
4775 School Lane
Pace, FL 32571

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pea Ridge Elementary School",'Pace=' + Pace.length); Pace[Pace.length] = createMarker(new GPoint(-87.16644287,30.63866615),"
S. S. Dixon Intermediate School
5540 Education Drive
Pace, FL 32571

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("S. S. Dixon Intermediate School",'Pace=' + Pace.length); Pace[Pace.length] = createMarker(new GPoint(-87.15316010,30.60363197),"
S. S. Dixon Primary School
4585 Ss Dixon Road
Pace, FL 32571

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("S. S. Dixon Primary School",'Pace=' + Pace.length); Milton[Milton.length] = createMarker(new GPoint(-87.09925842,30.64684105),"
Santa Rosa County Adult High School
5330 Berryhill Road
Milton, FL 32570

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Santa Rosa County Adult High School",'Milton=' + Milton.length); Milton[Milton.length] = createMarker(new GPoint(-87.03815800,30.63360200),"
Santa Rosa County Superintendent's Office
05086 Canal Street
Milton, FL 32570

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Santa Rosa County Superintendent's Office",'Milton=' + Milton.length); Holt[Holt.length] = createMarker(new GPoint(-86.80351257,30.77343750),"
Santa Rosa Juven. Residnt Facl High School
12364 Environmental Cente
Holt, FL 32564

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Santa Rosa Juven. Residnt Facl High School",'Holt=' + Holt.length); Milton[Milton.length] = createMarker(new GPoint(-87.04344177,30.61523056),"
T. R. Jackson Prek Center
4950 Susan Street
Milton, FL 32570

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("T. R. Jackson Prek Center",'Milton=' + Milton.length); Pace[Pace.length] = createMarker(new GPoint(-87.16786194,30.63710594),"
Thomas Sims Middle School
5500 Education Drive
Pace, FL 32571

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Thomas Sims Middle School",'Pace=' + Pace.length); Milton[Milton.length] = createMarker(new GPoint(-87.04737091,30.63783455),"
W. H. Rhodes Elementary School
5563 Byrom Street
Milton, FL 32570

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("W. H. Rhodes Elementary School",'Milton=' + Milton.length); Navarre[Navarre.length] = createMarker(new GPoint(-86.93314362,30.40521240),"
West Navarre Elementary School
1970 Cotton Bay Lane
Navarre, FL 32566

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Navarre Elementary School",'Navarre=' + Navarre.length); Gulf_Breeze[Gulf_Breeze.length] = createMarker(new GPoint(-87.00808716,30.39241982),"
Woodlawn Beach Middle School
1500 Woodlawn Way
Gulf Breeze, FL 32563

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Woodlawn Beach Middle School",'Gulf_Breeze=' + Gulf_Breeze.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(Bagdad); map.removeOverlays(Gulf_Breeze); map.removeOverlays(Holt); map.removeOverlays(Jay); map.removeOverlays(Milton); map.removeOverlays(Navarre); map.removeOverlays(Pace); 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(Milton);map.removeOverlays(Bagdad); map.removeOverlays(Gulf_Breeze); map.removeOverlays(Holt); map.removeOverlays(Jay); map.removeOverlays(Milton); map.removeOverlays(Navarre); map.removeOverlays(Pace); map.addOverlays(Bagdad); centerByArray(Bagdad, false, false); cntMarker += Bagdad.length; map.addOverlays(Gulf_Breeze); centerByArray(Gulf_Breeze, false, false); cntMarker += Gulf_Breeze.length; map.addOverlays(Holt); centerByArray(Holt, false, false); cntMarker += Holt.length; map.addOverlays(Jay); centerByArray(Jay, false, false); cntMarker += Jay.length; map.addOverlays(Milton); centerByArray(Milton, false, false); cntMarker += Milton.length; map.addOverlays(Navarre); centerByArray(Navarre, false, false); cntMarker += Navarre.length; map.addOverlays(Pace); centerByArray(Pace, false, false); cntMarker += Pace.length; centerByArray(Milton,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'); } }