function addMarkers() { mySelect = document.getElementById('selection'); Jonesboro = [];Bay = [];Brookland = [];Leachville = [];Monette = [];Jonesoro = [];Caraway = [];Lake_City = [];mySelect.options[mySelect.options.length] = new Option("Bay schools",'all=Bay'); mySelect.options[mySelect.options.length] = new Option("Brookland schools",'all=Brookland'); mySelect.options[mySelect.options.length] = new Option("Caraway schools",'all=Caraway'); mySelect.options[mySelect.options.length] = new Option("Jonesboro schools",'all=Jonesboro'); mySelect.options[mySelect.options.length] = new Option("Jonesoro schools",'all=Jonesoro'); mySelect.options[mySelect.options.length] = new Option("Lake City schools",'all=Lake_City'); mySelect.options[mySelect.options.length] = new Option("Leachville schools",'all=Leachville'); mySelect.options[mySelect.options.length] = new Option("Monette schools",'all=Monette'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.72776031,35.82873535),"
Annie Camp Junior High School
1814 W Nettleton Ave
Jonesboro, AR 72401

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Annie Camp Junior High School",'Jonesboro=' + Jonesboro.length); Bay[Bay.length] = createMarker(new GPoint(-90.55180359,35.74499893),"
Bay Elementary School
P.o. Box 39
Bay, AR 72411

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bay Elementary School",'Bay=' + Bay.length); Bay[Bay.length] = createMarker(new GPoint(-90.55180359,35.74499893),"
Bay High School
P.o. Box 39
Bay, AR 72411

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bay High School",'Bay=' + Bay.length); Brookland[Brookland.length] = createMarker(new GPoint(-90.57746887,35.90753555),"
Brookland Elementary School
220 N. Oak St.
Brookland, AR 72417

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brookland Elementary School",'Brookland=' + Brookland.length); Brookland[Brookland.length] = createMarker(new GPoint(-90.57746887,35.90753555),"
Brookland High School
100 W. School St.
Brookland, AR 72417

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brookland High School",'Brookland=' + Brookland.length); Brookland[Brookland.length] = createMarker(new GPoint(-90.57724800,35.90737600),"
Brookland Intermediate School
100 W. School St.
Brookland, AR 72417

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Brookland Intermediate School",'Brookland=' + Brookland.length); Leachville[Leachville.length] = createMarker(new GPoint(-90.21569824,35.94189835),"
Buffalo Is. Central East Elementary School
P.o. Box 110
Leachville, AR 72438

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buffalo Is. Central East Elementary School",'Leachville=' + Leachville.length); Monette[Monette.length] = createMarker(new GPoint(-90.34020233,35.91049957),"
Buffalo Is. Central High School
P.o. Box 730
Monette, AR 72447

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Buffalo Is. Central High School",'Monette=' + Monette.length); Leachville[Leachville.length] = createMarker(new GPoint(-90.21569824,35.94189835),"
Buffalo Is. Central Junior High School
P.o. Box 110
Leachville, AR 72438

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Buffalo Is. Central Junior High School",'Leachville=' + Leachville.length); Monette[Monette.length] = createMarker(new GPoint(-90.34020233,35.91049957),"
Buffalo Is. Central West Elementary School
P.o. Box 730
Monette, AR 72447

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buffalo Is. Central West Elementary School",'Monette=' + Monette.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.68581390,35.82473755),"
Douglas Macarthur Junior High School
1615 Wilkins Ave
Jonesboro, AR 72401

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Douglas Macarthur Junior High School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.71077400,35.82991900),"
Early Childhood Learning Cntr
1307 Flint St
Jonesboro, AR 72401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Early Childhood Learning Cntr",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.67797089,35.78866196),"
Fox Meadow Elementary School
2305 Fox Meadow Lane
Jonesboro, AR 72401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fox Meadow Elementary School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.67831100,35.78876200),"
Fox Meadow Intermediate Center
2309 Fox Meadow Ln
Jonesboro, AR 72404

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fox Meadow Intermediate Center",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.68762970,35.82241058),"
Hillcrest Elementary School
1804 Hillcrest Dr
Jonesboro, AR 72401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hillcrest Elementary School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.70541100,35.82469400),"
Jonesboro Area Technical Center
1727 South Main
Jonesboro, AR 72401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jonesboro Area Technical Center",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.70526886,35.82443619),"
Jonesboro High School
1730 S Main St
Jonesboro, AR 72401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jonesboro High School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.71118164,35.82873535),"
Kindergarten Center
618 W Nettleton
Jonesboro, AR 72401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kindergarten Center",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.64929962,35.81859970),"
Nettleton Central Elementary School
2305 Promise Lane
Jonesboro, AR 72401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Nettleton Central Elementary School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.64981079,35.81276321),"
Nettleton High School
4201 Chieftain Lane
Jonesboro, AR 72401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nettleton High School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.70404816,35.84209061),"
Nettleton Intermediate Center
3801 Vera Strret
Jonesboro, AR 72401

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Nettleton Intermediate Center",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.64968109,35.81303787),"
Nettleton Junior High School
4208 Chieftain Lane
Jonesboro, AR 72401

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Nettleton Junior High School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.70207977,35.87900543),"
Philadelphia Elementary School
213 E Thomas Green
Jonesboro, AR 72401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Philadelphia Elementary School",'Jonesboro=' + Jonesboro.length); Jonesoro[Jonesoro.length] = createMarker(new GPoint(-90.72482300,35.87220001),"
Raider Open Door Academy Charter
4109 Race Street
Jonesoro, AR 72401

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Raider Open Door Academy Charter",'Jonesoro=' + Jonesoro.length); Caraway[Caraway.length] = createMarker(new GPoint(-90.32839966,35.76079941),"
Riverside East Elementary School
P.o. Box 699
Caraway, AR 72419

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverside East Elementary School",'Caraway=' + Caraway.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-90.44439697,35.82149887),"
Riverside High School
P.o. Box 178
Lake City, AR 72437

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Riverside High School",'Lake_City=' + Lake_City.length); Caraway[Caraway.length] = createMarker(new GPoint(-90.32839966,35.76079941),"
Riverside Junior High School
P.o. Box 699
Caraway, AR 72419

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Riverside Junior High School",'Caraway=' + Caraway.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-90.44439697,35.82149887),"
Riverside West Elementary School
P.o. Box 178
Lake City, AR 72437

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverside West Elementary School",'Lake_City=' + Lake_City.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.70182800,35.83130646),"
Sixth Grade Academic Center
1218 Cobb St
Jonesboro, AR 72401

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sixth Grade Academic Center",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.71789551,35.82416153),"
South Elementary School
1001 Rosemond
Jonesboro, AR 72401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Elementary School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.65432739,35.84643555),"
University Hgts. Elementary School
300 Bowling Lane
Jonesboro, AR 72401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("University Hgts. Elementary School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.74446106,35.77793884),"
Valley View Elementary School
2119 Valley View Dr
Jonesboro, AR 72404

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Valley View Elementary School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.74446106,35.77793884),"
Valley View High School
2118a Valley View Dr
Jonesboro, AR 72404

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valley View High School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.71899414,35.83853531),"
West Elementary School
1110 Washington Ave
Jonesboro, AR 72401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Elementary School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.80888367,35.85107040),"
Westside Elementary School
1834 Hwy 91 W
Jonesboro, AR 72404

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westside Elementary School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.80806732,35.85341644),"
Westside High School
1630 Hwy 91 W
Jonesboro, AR 72404

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westside High School",'Jonesboro=' + Jonesboro.length); Jonesboro[Jonesboro.length] = createMarker(new GPoint(-90.80875397,35.85146332),"
Westside Middle School
1800 Hwy 91 W
Jonesboro, AR 72404

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Westside Middle School",'Jonesboro=' + Jonesboro.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(Bay); map.removeOverlays(Brookland); map.removeOverlays(Caraway); map.removeOverlays(Jonesboro); map.removeOverlays(Jonesoro); map.removeOverlays(Lake_City); map.removeOverlays(Leachville); map.removeOverlays(Monette); 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(Jonesboro);map.removeOverlays(Bay); map.removeOverlays(Brookland); map.removeOverlays(Caraway); map.removeOverlays(Jonesboro); map.removeOverlays(Jonesoro); map.removeOverlays(Lake_City); map.removeOverlays(Leachville); map.removeOverlays(Monette); map.addOverlays(Bay); centerByArray(Bay, false, false); cntMarker += Bay.length; map.addOverlays(Brookland); centerByArray(Brookland, false, false); cntMarker += Brookland.length; map.addOverlays(Caraway); centerByArray(Caraway, false, false); cntMarker += Caraway.length; map.addOverlays(Jonesboro); centerByArray(Jonesboro, false, false); cntMarker += Jonesboro.length; map.addOverlays(Jonesoro); centerByArray(Jonesoro, false, false); cntMarker += Jonesoro.length; map.addOverlays(Lake_City); centerByArray(Lake_City, false, false); cntMarker += Lake_City.length; map.addOverlays(Leachville); centerByArray(Leachville, false, false); cntMarker += Leachville.length; map.addOverlays(Monette); centerByArray(Monette, false, false); cntMarker += Monette.length; centerByArray(Jonesboro,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'); } }