function addMarkers() { mySelect = document.getElementById('selection'); Dothan = [];Dothan[Dothan.length] = createMarker(new GPoint(-85.35388184,31.19379234),"
Beverlye Middle School
1025 S Beverlye Rd
Dothan, AL 36301

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Beverlye Middle School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.37467194,31.23497772),"
Carver Magnet School For Mathematics, Science And
1001 Webb Rd
Dothan, AL 36303

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Carver Magnet School For Mathematics, Science And",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.39253235,31.19665337),"
Cloverdale Elementary School
303 Rollins Ave
Dothan, AL 36301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cloverdale Elementary School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.39321899,31.20850945),"
Dothan High School
1236 S Oates St
Dothan, AL 36301

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dothan High School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.38104248,31.26575089),"
Dothan Technology Center
3165 Reeves St
Dothan, AL 36303

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dothan Technology Center",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.42173004,31.23783875),"
Girard Elementary School
522 Girard Ave
Dothan, AL 36303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Girard Elementary School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.42173004,31.24117470),"
Girard Middle School
600 Girard Ave
Dothan, AL 36303

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Girard Middle School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.37523651,31.21107674),"
Grandview Elementary School
900 6th Ave
Dothan, AL 36301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Grandview Elementary School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.42832947,31.21927452),"
Heard Elementary School
201 Daniel Cir
Dothan, AL 36301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Heard Elementary School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.34790802,31.19298363),"
Hidden Lake Elementary School
1475 Prevatt Rd
Dothan, AL 36301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hidden Lake Elementary School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.48587799,31.22028732),"
Highlands Elementary School
1400 S Brannon Stand Rd
Dothan, AL 36305

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Highlands Elementary School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.43510437,31.20494843),"
Honeysuckle Middle School
1665 Honeysuckle Rd
Dothan, AL 36305

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Honeysuckle Middle School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.39260101,31.22679329),"
Houston County Alternative School
315 N Foster St
Dothan, AL 36303

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Houston County Alternative School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.37263489,31.23387527),"
Jerry Lee Faine Elementary School
1901 Stringer St
Dothan, AL 36303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jerry Lee Faine Elementary School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.46467590,31.27739716),"
Kelly Springs Elementary School
1124 Kelly Springs Rd
Dothan, AL 36303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kelly Springs Elementary School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.39567566,31.27157402),"
Landmark Elementary School
4130 Westgate Parkway
Dothan, AL 36303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Landmark Elementary School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.40216827,31.23564339),"
Montana Academic Magnet School
1001 Montana St
Dothan, AL 36303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Montana Academic Magnet School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.38013458,31.26635551),"
Northview High School
3209 Reeves St
Dothan, AL 36303

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northview High School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.38973999,31.24263763),"
P.a.s.s. Academy
201 E Wilson Street
Dothan, AL 36303

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("P.a.s.s. Academy",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.52324700,31.00462400),"
Rehobeth Elementary School
5631 County Road 203
Dothan, AL 36301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rehobeth Elementary School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.41432190,31.16925049),"
Rehobeth High School
373 Malvern Road
Dothan, AL 36301

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rehobeth High School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.52324700,31.00462400),"
Rehobeth Middle School
5631 County Road 203
Dothan, AL 36301

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rehobeth Middle School",'Dothan=' + Dothan.length); Dothan[Dothan.length] = createMarker(new GPoint(-85.41363525,31.21017456),"
Selma Street Elementary School
1501 W Selma St
Dothan, AL 36301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Selma Street Elementary School",'Dothan=' + Dothan.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(Dothan); 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(Dothan);map.removeOverlays(Dothan); map.addOverlays(Dothan); centerByArray(Dothan, false, false); cntMarker += Dothan.length; centerByArray(Dothan,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'); } }