function addMarkers() { mySelect = document.getElementById('selection'); El_Dorado = [];Strong = [];Huttig = [];Junction_City = [];Mt_Holly = [];Norphlet = [];Smackover = [];mySelect.options[mySelect.options.length] = new Option("El Dorado schools",'all=El_Dorado'); mySelect.options[mySelect.options.length] = new Option("Huttig schools",'all=Huttig'); mySelect.options[mySelect.options.length] = new Option("Junction City schools",'all=Junction_City'); mySelect.options[mySelect.options.length] = new Option("Mt Holly schools",'all=Mt_Holly'); mySelect.options[mySelect.options.length] = new Option("Norphlet schools",'all=Norphlet'); mySelect.options[mySelect.options.length] = new Option("Smackover schools",'all=Smackover'); mySelect.options[mySelect.options.length] = new Option("Strong schools",'all=Strong'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.66737366,33.21456909),"
Barton Junior High School
400 W Faulkner St
El Dorado, AR 71730

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Barton Junior High School",'El_Dorado=' + El_Dorado.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.68657684,33.21647644),"
El Dorado High School
501 Timberlane Drive
El Dorado, AR 71730

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("El Dorado High School",'El_Dorado=' + El_Dorado.length); Strong[Strong.length] = createMarker(new GPoint(-92.35150146,33.11920166),"
Gardner-strong Elementary School
Po Box 736
Strong, AR 71765

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gardner-strong Elementary School",'Strong=' + Strong.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.66289520,33.22213745),"
Hugh Goodwin Elementary School
201 E Fifth Street
El Dorado, AR 71730

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hugh Goodwin Elementary School",'El_Dorado=' + El_Dorado.length); Huttig[Huttig.length] = createMarker(new GPoint(-92.19409943,33.05139923),"
Huttig Elementary School
P.o. Box 408
Huttig, AR 71747

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Huttig Elementary School",'Huttig=' + Huttig.length); Huttig[Huttig.length] = createMarker(new GPoint(-92.18199921,33.05039978),"
Huttig High School
P.o. Box 408
Huttig, AR 71747

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Huttig High School",'Huttig=' + Huttig.length); Junction_City[Junction_City.length] = createMarker(new GPoint(-92.77390289,33.05519867),"
Junction City Elementary School
Po Box 790
Junction City, AR 71749

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Junction City Elementary School",'Junction_City=' + Junction_City.length); Junction_City[Junction_City.length] = createMarker(new GPoint(-92.77390289,33.05519867),"
Junction City High School
Po Box 790
Junction City, AR 71749

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Junction City High School",'Junction_City=' + Junction_City.length); Mt_Holly[Mt_Holly.length] = createMarker(new GPoint(-92.94774628,33.30096817),"
Mount Holly Elementary School
8430 Mt. Holly Hwy.
Mt Holly, AR 71758

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mount Holly Elementary School",'Mt_Holly=' + Mt_Holly.length); Mt_Holly[Mt_Holly.length] = createMarker(new GPoint(-92.94774628,33.30096817),"
Mount Holly High School
8430 Mt. Holly Hwy.
Mt Holly, AR 71758

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount Holly High School",'Mt_Holly=' + Mt_Holly.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.64052582,33.19363022),"
Murmil Heights Elementary School
2000 Ripley Street
El Dorado, AR 71730

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Murmil Heights Elementary School",'El_Dorado=' + El_Dorado.length); Norphlet[Norphlet.length] = createMarker(new GPoint(-92.66300201,33.31499863),"
Norphlet Elementary School
Po Box 50
Norphlet, AR 71759

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Norphlet Elementary School",'Norphlet=' + Norphlet.length); Norphlet[Norphlet.length] = createMarker(new GPoint(-92.66300201,33.31499863),"
Norphlet High School
Po Box 50
Norphlet, AR 71759

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Norphlet High School",'Norphlet=' + Norphlet.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.67446136,33.22793579),"
Northwest Elementary School
1600 N College
El Dorado, AR 71730

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northwest Elementary School",'El_Dorado=' + El_Dorado.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.72213745,33.16887283),"
Parkers Chapel Elementary School
401 Parkers Chapel
El Dorado, AR 71730

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Parkers Chapel Elementary School",'El_Dorado=' + El_Dorado.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.72213745,33.16887283),"
Parkers Chapel High School
401 Parkers Chapel
El Dorado, AR 71730

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parkers Chapel High School",'El_Dorado=' + El_Dorado.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.64313507,33.21592331),"
Retta Brown Elementary School
505 Dixie Drive
El Dorado, AR 71730

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Retta Brown Elementary School",'El_Dorado=' + El_Dorado.length); Smackover[Smackover.length] = createMarker(new GPoint(-92.72904968,33.36649704),"
Smackover Elementary School
701 Magnolia St.
Smackover, AR 71762

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Smackover Elementary School",'Smackover=' + Smackover.length); Smackover[Smackover.length] = createMarker(new GPoint(-92.72982025,33.36606216),"
Smackover High School
1 Buckaroo Lane
Smackover, AR 71762

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Smackover High School",'Smackover=' + Smackover.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.66554900,33.21826900),"
Southark Career Center
P.o. Box 7010
El Dorado, AR 71730

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southark Career Center",'El_Dorado=' + El_Dorado.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.66113281,33.19886780),"
Southside Elementary School
1221 S Jackson St
El Dorado, AR 71730

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southside Elementary School",'El_Dorado=' + El_Dorado.length); Strong[Strong.length] = createMarker(new GPoint(-92.35150146,33.11920166),"
Strong High School
Po Box 735
Strong, AR 71765

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Strong High School",'Strong=' + Strong.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.54164886,33.23326874),"
Union Elementary School
6049 Moro Bay Hwy
El Dorado, AR 71730

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Union Elementary School",'El_Dorado=' + El_Dorado.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.54164886,33.23326874),"
Union High School
6049 Moro Bay Hwy
El Dorado, AR 71730

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Union High School",'El_Dorado=' + El_Dorado.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.64804840,33.21690369),"
Washington Middle School
601 S Quaker St
El Dorado, AR 71730

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Washington Middle School",'El_Dorado=' + El_Dorado.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.68316650,33.22639465),"
West Woods Elementary Charter
1600 N Bradford
El Dorado, AR 71730

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Woods Elementary Charter",'El_Dorado=' + El_Dorado.length); El_Dorado[El_Dorado.length] = createMarker(new GPoint(-92.67443848,33.20978546),"
Yocum Elementary School
308 S College Street
El Dorado, AR 71730

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Yocum Elementary School",'El_Dorado=' + El_Dorado.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(El_Dorado); map.removeOverlays(Huttig); map.removeOverlays(Junction_City); map.removeOverlays(Mt_Holly); map.removeOverlays(Norphlet); map.removeOverlays(Smackover); map.removeOverlays(Strong); 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(El_Dorado);map.removeOverlays(El_Dorado); map.removeOverlays(Huttig); map.removeOverlays(Junction_City); map.removeOverlays(Mt_Holly); map.removeOverlays(Norphlet); map.removeOverlays(Smackover); map.removeOverlays(Strong); map.addOverlays(El_Dorado); centerByArray(El_Dorado, false, false); cntMarker += El_Dorado.length; map.addOverlays(Huttig); centerByArray(Huttig, false, false); cntMarker += Huttig.length; map.addOverlays(Junction_City); centerByArray(Junction_City, false, false); cntMarker += Junction_City.length; map.addOverlays(Mt_Holly); centerByArray(Mt_Holly, false, false); cntMarker += Mt_Holly.length; map.addOverlays(Norphlet); centerByArray(Norphlet, false, false); cntMarker += Norphlet.length; map.addOverlays(Smackover); centerByArray(Smackover, false, false); cntMarker += Smackover.length; map.addOverlays(Strong); centerByArray(Strong, false, false); cntMarker += Strong.length; centerByArray(El_Dorado,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'); } }