function addMarkers() { mySelect = document.getElementById('selection'); Searcy = [];Bald_Knob = [];Beebe = [];Bradford = [];Judsonia = [];Kensett = [];Mcrae = [];Pangburn = [];Rose_Bud = [];mySelect.options[mySelect.options.length] = new Option("Bald Knob schools",'all=Bald_Knob'); mySelect.options[mySelect.options.length] = new Option("Beebe schools",'all=Beebe'); mySelect.options[mySelect.options.length] = new Option("Bradford schools",'all=Bradford'); mySelect.options[mySelect.options.length] = new Option("Judsonia schools",'all=Judsonia'); mySelect.options[mySelect.options.length] = new Option("Kensett schools",'all=Kensett'); mySelect.options[mySelect.options.length] = new Option("Mcrae schools",'all=Mcrae'); mySelect.options[mySelect.options.length] = new Option("Pangburn schools",'all=Pangburn'); mySelect.options[mySelect.options.length] = new Option("Rose Bud schools",'all=Rose_Bud'); mySelect.options[mySelect.options.length] = new Option("Searcy schools",'all=Searcy'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Searcy[Searcy.length] = createMarker(new GPoint(-91.73883057,35.25173569),"
Ahlf Junior High School
308 W. Vine
Searcy, AR 72143

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ahlf Junior High School",'Searcy=' + Searcy.length); Searcy[Searcy.length] = createMarker(new GPoint(-91.73644500,35.24377200),"
Asu Area Career Center
P.o. Box 909
Searcy, AR 72145

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Asu Area Career Center",'Searcy=' + Searcy.length); Bald_Knob[Bald_Knob.length] = createMarker(new GPoint(-91.57617187,35.41393661),"
Bald Knob High School
901 North Hickory St
Bald Knob, AR 72010

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bald Knob High School",'Bald_Knob=' + Bald_Knob.length); Bald_Knob[Bald_Knob.length] = createMarker(new GPoint(-91.57617187,35.41393661),"
Bald Knob Middle School
103 West Park Street
Bald Knob, AR 72010

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bald Knob Middle School",'Bald_Knob=' + Bald_Knob.length); Beebe[Beebe.length] = createMarker(new GPoint(-91.89727020,35.06826401),"
Beebe Elementary School
1201 W. Center St.
Beebe, AR 72012

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Beebe Elementary School",'Beebe=' + Beebe.length); Beebe[Beebe.length] = createMarker(new GPoint(-91.89727020,35.06826401),"
Beebe High School
1201 W. Center St.
Beebe, AR 72012

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beebe High School",'Beebe=' + Beebe.length); Beebe[Beebe.length] = createMarker(new GPoint(-91.89727020,35.06826401),"
Beebe Intermediate
1201 W. Center St.
Beebe, AR 72012

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Beebe Intermediate",'Beebe=' + Beebe.length); Beebe[Beebe.length] = createMarker(new GPoint(-91.89727020,35.06826401),"
Beebe Junior High School
1201 W. Center St.
Beebe, AR 72012

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Beebe Junior High School",'Beebe=' + Beebe.length); Beebe[Beebe.length] = createMarker(new GPoint(-91.89727020,35.06826401),"
Beebe Middle School
1201 W. Center St.
Beebe, AR 72012

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Beebe Middle School",'Beebe=' + Beebe.length); Beebe[Beebe.length] = createMarker(new GPoint(-91.89727020,35.06826401),"
Beebe Primary
1201 W. Center St.
Beebe, AR 72012

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Beebe Primary",'Beebe=' + Beebe.length); Bradford[Bradford.length] = createMarker(new GPoint(-91.47930145,35.45180130),"
Bradford Elementary School
P.o. Box 60
Bradford, AR 72020

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bradford Elementary School",'Bradford=' + Bradford.length); Bradford[Bradford.length] = createMarker(new GPoint(-91.47930145,35.45180130),"
Bradford High School
P.o. Box 60
Bradford, AR 72020

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bradford High School",'Bradford=' + Bradford.length); Bald_Knob[Bald_Knob.length] = createMarker(new GPoint(-91.57617187,35.41393661),"
H.l. Lubker Elementary School
103 West Park Street
Bald Knob, AR 72010

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("H.l. Lubker Elementary School",'Bald_Knob=' + Bald_Knob.length); Judsonia[Judsonia.length] = createMarker(new GPoint(-91.63922882,35.27577209),"
Judsonia Elementary School
916 Judson Ave
Judsonia, AR 72081

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Judsonia Elementary School",'Judsonia=' + Judsonia.length); Judsonia[Judsonia.length] = createMarker(new GPoint(-91.63922882,35.27577209),"
Judsonia Middle School
916 Judson Ave
Judsonia, AR 72081

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Judsonia Middle School",'Judsonia=' + Judsonia.length); Kensett[Kensett.length] = createMarker(new GPoint(-91.67338562,35.23500443),"
Kensett Elementary School
701 West Dandridge
Kensett, AR 72082

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kensett Elementary School",'Kensett=' + Kensett.length); Kensett[Kensett.length] = createMarker(new GPoint(-91.67338562,35.23500443),"
Kensett Middle School
701 W Dandridge
Kensett, AR 72082

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kensett Middle School",'Kensett=' + Kensett.length); Beebe[Beebe.length] = createMarker(new GPoint(-91.89818900,35.06838700),"
Mcrae Elementary School
1201 W. Center St.
Beebe, AR 72012

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mcrae Elementary School",'Beebe=' + Beebe.length); Searcy[Searcy.length] = createMarker(new GPoint(-91.74256134,35.25526428),"
Mcrae Elementary School
601 Mcrae St.
Searcy, AR 72143

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mcrae Elementary School",'Searcy=' + Searcy.length); Mcrae[Mcrae.length] = createMarker(new GPoint(-91.82230377,35.11502075),"
Mcrae Elementary School
308 N. Wilk''s Street
Mcrae, AR 72102

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mcrae Elementary School",'Mcrae=' + Mcrae.length); Beebe[Beebe.length] = createMarker(new GPoint(-91.89818900,35.06838700),"
Mcrae High School
1201 W. Center St.
Beebe, AR 72012

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mcrae High School",'Beebe=' + Beebe.length); Mcrae[Mcrae.length] = createMarker(new GPoint(-91.82230377,35.11502075),"
Mcrae High School
308 N. Wilk''s Street
Mcrae, AR 72102

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mcrae High School",'Mcrae=' + Mcrae.length); Pangburn[Pangburn.length] = createMarker(new GPoint(-91.83677673,35.42852402),"
Pangburn Elementary School
1100 Short Street
Pangburn, AR 72121

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pangburn Elementary School",'Pangburn=' + Pangburn.length); Pangburn[Pangburn.length] = createMarker(new GPoint(-91.84258270,35.42621994),"
Pangburn High School
11oo Short Street
Pangburn, AR 72121

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pangburn High School",'Pangburn=' + Pangburn.length); Searcy[Searcy.length] = createMarker(new GPoint(-91.69145203,35.25297165),"
Riverview High School
810 Raider Drive
Searcy, AR 72143

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Riverview High School",'Searcy=' + Searcy.length); Rose_Bud[Rose_Bud.length] = createMarker(new GPoint(-92.07323456,35.33409119),"
Rose Bud Elementary School
124 School Rd
Rose Bud, AR 72137

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rose Bud Elementary School",'Rose_Bud=' + Rose_Bud.length); Rose_Bud[Rose_Bud.length] = createMarker(new GPoint(-92.07323456,35.33409119),"
Rose Bud High School
124 School Road
Rose Bud, AR 72137

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rose Bud High School",'Rose_Bud=' + Rose_Bud.length); Searcy[Searcy.length] = createMarker(new GPoint(-91.75796509,35.25157166),"
Searcy High School
301 North Ella
Searcy, AR 72143

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Searcy High School",'Searcy=' + Searcy.length); Searcy[Searcy.length] = createMarker(new GPoint(-91.70732117,35.24789429),"
Sidney Deener Elementary School
163 Cloverdale Blvd.
Searcy, AR 72143

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sidney Deener Elementary School",'Searcy=' + Searcy.length); Searcy[Searcy.length] = createMarker(new GPoint(-91.74720001,35.24606323),"
Southwest Middle School
1103 Woodruff Street
Searcy, AR 72143

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Southwest Middle School",'Searcy=' + Searcy.length); Searcy[Searcy.length] = createMarker(new GPoint(-91.77524567,35.24645615),"
Westside Elementary School
512 Country Club Rd
Searcy, AR 72143

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westside Elementary School",'Searcy=' + Searcy.length); Judsonia[Judsonia.length] = createMarker(new GPoint(-91.67556763,35.39686203),"
White Co. Central Elementary School
3259 Hwy. 157
Judsonia, AR 72081

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("White Co. Central Elementary School",'Judsonia=' + Judsonia.length); Judsonia[Judsonia.length] = createMarker(new GPoint(-91.67556763,35.39686203),"
White Co. Central High School
3259 Hwy. 157
Judsonia, AR 72081

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("White Co. Central High School",'Judsonia=' + Judsonia.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(Bald_Knob); map.removeOverlays(Beebe); map.removeOverlays(Bradford); map.removeOverlays(Judsonia); map.removeOverlays(Kensett); map.removeOverlays(Mcrae); map.removeOverlays(Pangburn); map.removeOverlays(Rose_Bud); map.removeOverlays(Searcy); 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(Searcy);map.removeOverlays(Bald_Knob); map.removeOverlays(Beebe); map.removeOverlays(Bradford); map.removeOverlays(Judsonia); map.removeOverlays(Kensett); map.removeOverlays(Mcrae); map.removeOverlays(Pangburn); map.removeOverlays(Rose_Bud); map.removeOverlays(Searcy); map.addOverlays(Bald_Knob); centerByArray(Bald_Knob, false, false); cntMarker += Bald_Knob.length; map.addOverlays(Beebe); centerByArray(Beebe, false, false); cntMarker += Beebe.length; map.addOverlays(Bradford); centerByArray(Bradford, false, false); cntMarker += Bradford.length; map.addOverlays(Judsonia); centerByArray(Judsonia, false, false); cntMarker += Judsonia.length; map.addOverlays(Kensett); centerByArray(Kensett, false, false); cntMarker += Kensett.length; map.addOverlays(Mcrae); centerByArray(Mcrae, false, false); cntMarker += Mcrae.length; map.addOverlays(Pangburn); centerByArray(Pangburn, false, false); cntMarker += Pangburn.length; map.addOverlays(Rose_Bud); centerByArray(Rose_Bud, false, false); cntMarker += Rose_Bud.length; map.addOverlays(Searcy); centerByArray(Searcy, false, false); cntMarker += Searcy.length; centerByArray(Searcy,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'); } }