function addMarkers() { mySelect = document.getElementById('selection'); Altheimer = [];Pine_Bluff = [];White_Hall = [];Redfield = [];mySelect.options[mySelect.options.length] = new Option("Altheimer schools",'all=Altheimer'); mySelect.options[mySelect.options.length] = new Option("Pine Bluff schools",'all=Pine_Bluff'); mySelect.options[mySelect.options.length] = new Option("Redfield schools",'all=Redfield'); mySelect.options[mySelect.options.length] = new Option("White Hall schools",'all=White_Hall'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Altheimer[Altheimer.length] = createMarker(new GPoint(-91.84677400,34.31931500),"
Altheimer Middle School
P O Box 640
Altheimer, AR 72004

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Altheimer Middle School",'Altheimer=' + Altheimer.length); Altheimer[Altheimer.length] = createMarker(new GPoint(-91.83753204,34.32390976),"
Altheimer-sherrill High School
Post Office Box 640
Altheimer, AR 72004

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Altheimer-sherrill High School",'Altheimer=' + Altheimer.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-91.97203064,34.21685410),"
Belair Elementary School
1301 Commerce Road
Pine Bluff, AR 71603

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Belair Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-91.98635101,34.21856308),"
Broadmoor Elementary School
1800 East 11th
Pine Bluff, AR 71601

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Broadmoor Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.05346680,34.21626282),"
Coleman Elementary School
4600 W. 13
Pine Bluff, AR 71603

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Coleman Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.05321503,34.24083710),"
Dollarway High School
4900 Dollarway Road
Pine Bluff, AR 71602

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dollarway High School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.02808380,34.23929977),"
Dollarway Junior High School
2602 Fluker Street
Pine Bluff, AR 71602

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Dollarway Junior High School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.04526520,34.19764709),"
Edgewood Elementary School
4100 W. 32
Pine Bluff, AR 71603

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edgewood Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.02051544,34.19513702),"
Forrest Park Elementary School
1903 West 34th
Pine Bluff, AR 71603

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Forrest Park Elementary School",'Pine_Bluff=' + Pine_Bluff.length); White_Hall[White_Hall.length] = createMarker(new GPoint(-92.09361267,34.25682068),"
Gandy Elementary School
400 Gandy Ave.
White Hall, AR 71602

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gandy Elementary School",'White_Hall=' + White_Hall.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.02837372,34.21923828),"
Greenville Elementary School
2501 West 10th
Pine Bluff, AR 71603

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greenville Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Redfield[Redfield.length] = createMarker(new GPoint(-92.17469788,34.44609833),"
Hardin Elementary School
P.o. Box 250
Redfield, AR 72132

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hardin Elementary School",'Redfield=' + Redfield.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-91.99373627,34.21425247),"
Indiana Street Elementary School
1519 Indiana Street
Pine Bluff, AR 71601

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Indiana Street Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.00671387,34.18857956),"
Jack Robey Jr. High School
4101 Olive Street
Pine Bluff, AR 71603

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Jack Robey Jr. High School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.00953900,34.22819900),"
Jefferson Area Vocational Center
221 South Beech
Pine Bluff, AR 71601

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jefferson Area Vocational Center",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.06522369,34.19541168),"
L. L. Owen Elementary School
3605 Oakwood Rd.
Pine Bluff, AR 71603

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("L. L. Owen Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.00844574,34.21461487),"
Lakeside Elementary School
609 West 15th
Pine Bluff, AR 71601

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lakeside Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Altheimer[Altheimer.length] = createMarker(new GPoint(-91.83753204,34.32390976),"
Martin Elementary School
102 Orchard St
Altheimer, AR 72004

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Martin Elementary School",'Altheimer=' + Altheimer.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.04926300,34.23939514),"
Matthews Elementary School
4501 Dollarway Road
Pine Bluff, AR 71602

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Matthews Elementary School",'Pine_Bluff=' + Pine_Bluff.length); White_Hall[White_Hall.length] = createMarker(new GPoint(-92.98959351,35.14810181),"
Moody Elementary School
700 Moody School Dr.
White Hall, AR 71602

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Moody Elementary School",'White_Hall=' + White_Hall.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.01159668,34.19910049),"
Oak Park Elementary School
2900 Orange
Pine Bluff, AR 71603

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Oak Park Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.00946045,34.21873856),"
Pine Bluff High School
711 West 11th
Pine Bluff, AR 71601

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pine Bluff High School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.06419373,34.24013519),"
Pinecrest Elementary School
2601 Fluker Street
Pine Bluff, AR 71602

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pinecrest Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Redfield[Redfield.length] = createMarker(new GPoint(-92.17469788,34.44609833),"
Redfield Junior High School
P.o. Box 350
Redfield, AR 72132

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Redfield Junior High School",'Redfield=' + Redfield.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.01628876,34.21643829),"
Sam Taylor Elementary School
1415 West 13th
Pine Bluff, AR 71603

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sam Taylor Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-91.98923492,34.20915604),"
Southeast Middle School
2001 Ohio Street
Pine Bluff, AR 71601

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Southeast Middle School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.02896881,34.18659210),"
Southwood Elementary School
4200 Fir Street
Pine Bluff, AR 71603

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southwood Elementary School",'Pine_Bluff=' + Pine_Bluff.length); White_Hall[White_Hall.length] = createMarker(new GPoint(-92.09300995,34.26713181),"
Taylor Elementary School
805 West St.
White Hall, AR 71602

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Taylor Elementary School",'White_Hall=' + White_Hall.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.00743866,34.19499969),"
Thirty-fourth Ave. Elementary School
801 East 34th
Pine Bluff, AR 71601

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Thirty-fourth Ave. Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.02824402,34.23954010),"
Townsend Park Elementary School
2601 Fluker Street
Pine Bluff, AR 71602

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Townsend Park Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.02733612,34.16526413),"
W. T. Cheney Elementary School
2206 Ridgway Road
Pine Bluff, AR 71603

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("W. T. Cheney Elementary School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.05475616,34.19708633),"
Watson Chapel High School
4000 Camden Rd.
Pine Bluff, AR 71603

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Watson Chapel High School",'Pine_Bluff=' + Pine_Bluff.length); Pine_Bluff[Pine_Bluff.length] = createMarker(new GPoint(-92.05455017,34.19723892),"
Watson Chapel Junior High School
3900 Camden Rd.
Pine Bluff, AR 71603

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Watson Chapel Junior High School",'Pine_Bluff=' + Pine_Bluff.length); White_Hall[White_Hall.length] = createMarker(new GPoint(-92.11171700,34.28236600),"
White Hall High School
700 Bulldog Dr.
White Hall, AR 71602

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("White Hall High School",'White_Hall=' + White_Hall.length); White_Hall[White_Hall.length] = createMarker(new GPoint(-92.08194733,34.26131439),"
White Hall Junior High School
8106 Dollarway Rd.
White Hall, AR 71602

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("White Hall Junior High School",'White_Hall=' + White_Hall.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(Altheimer); map.removeOverlays(Pine_Bluff); map.removeOverlays(Redfield); map.removeOverlays(White_Hall); 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(Altheimer);map.removeOverlays(Altheimer); map.removeOverlays(Pine_Bluff); map.removeOverlays(Redfield); map.removeOverlays(White_Hall); map.addOverlays(Altheimer); centerByArray(Altheimer, false, false); cntMarker += Altheimer.length; map.addOverlays(Pine_Bluff); centerByArray(Pine_Bluff, false, false); cntMarker += Pine_Bluff.length; map.addOverlays(Redfield); centerByArray(Redfield, false, false); cntMarker += Redfield.length; map.addOverlays(White_Hall); centerByArray(White_Hall, false, false); cntMarker += White_Hall.length; centerByArray(Altheimer,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'); } }