function addMarkers() { mySelect = document.getElementById('selection'); Alma = [];Alpena = [];Altheimer = [];Altus = [];Amity = [];Arkadelphia = [];Arkansas_City = [];Armorel = [];Ashdown = [];Atkins = [];Augusta = [];mySelect.options[mySelect.options.length] = new Option("Alma schools",'all=Alma'); mySelect.options[mySelect.options.length] = new Option("Alpena schools",'all=Alpena'); mySelect.options[mySelect.options.length] = new Option("Altheimer schools",'all=Altheimer'); mySelect.options[mySelect.options.length] = new Option("Altus schools",'all=Altus'); mySelect.options[mySelect.options.length] = new Option("Amity schools",'all=Amity'); mySelect.options[mySelect.options.length] = new Option("Arkadelphia schools",'all=Arkadelphia'); mySelect.options[mySelect.options.length] = new Option("Arkansas City schools",'all=Arkansas_City'); mySelect.options[mySelect.options.length] = new Option("Armorel schools",'all=Armorel'); mySelect.options[mySelect.options.length] = new Option("Ashdown schools",'all=Ashdown'); mySelect.options[mySelect.options.length] = new Option("Atkins schools",'all=Atkins'); mySelect.options[mySelect.options.length] = new Option("Augusta schools",'all=Augusta'); Alma[Alma.length] = createMarker(new GPoint(-94.21510315,35.49489975),"
Alma High School
P. O. Box 2139
Alma, AR 72921

[ View School Profile ]
",iconGr); Alma[Alma.length] = createMarker(new GPoint(-94.21510315,35.49489975),"
Alma Intermediate School
P. O. Box 2259
Alma, AR 72921

[ View School Profile ]
",iconRd); Alma[Alma.length] = createMarker(new GPoint(-94.21510315,35.49489975),"
Alma Middle School
P. O. Box 2229
Alma, AR 72921

[ View School Profile ]
",iconBl); Alma[Alma.length] = createMarker(new GPoint(-94.21510315,35.49489975),"
Alma Primary School
P. O. Box 2299
Alma, AR 72921

[ View School Profile ]
",iconRd); Alpena[Alpena.length] = createMarker(new GPoint(-93.28690338,36.29550171),"
Alpena Elementary School
P.o. Box 270
Alpena, AR 72611

[ View School Profile ]
",iconRd); Alpena[Alpena.length] = createMarker(new GPoint(-93.28690338,36.29550171),"
Alpena High School
P.o. Box 270
Alpena, AR 72611

[ View School Profile ]
",iconGr); Altheimer[Altheimer.length] = createMarker(new GPoint(-91.84677400,34.31931500),"
Altheimer Middle School
P O Box 640
Altheimer, AR 72004

[ View School Profile ]
",iconBl); 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); Altus[Altus.length] = createMarker(new GPoint(-93.78990173,35.41600037),"
Altus-denning Elementary School
P.o. Box 339
Altus, AR 72821

[ View School Profile ]
",iconRd); Amity[Amity.length] = createMarker(new GPoint(-93.46092224,34.26446915),"
Amity Elementary School
111 School Street
Amity, AR 71921

[ View School Profile ]
",iconRd); Arkadelphia[Arkadelphia.length] = createMarker(new GPoint(-93.09773254,34.12205887),"
Arkadelphia High School
401 High School Road
Arkadelphia, AR 71923

[ View School Profile ]
",iconGr); Arkansas_City[Arkansas_City.length] = createMarker(new GPoint(-91.21080017,33.62080002),"
Arkansas City Elementary School
P.o. Box 248
Arkansas City, AR 71630

[ View School Profile ]
",iconRd); Arkansas_City[Arkansas_City.length] = createMarker(new GPoint(-91.21080017,33.62080002),"
Arkansas City High School
P O Box 248
Arkansas City, AR 71630

[ View School Profile ]
",iconGr); Armorel[Armorel.length] = createMarker(new GPoint(-89.79850769,35.91927719),"
Armorel Elementary School
7 South Main
Armorel, AR 72310

[ View School Profile ]
",iconRd); Armorel[Armorel.length] = createMarker(new GPoint(-89.79850769,35.91927719),"
Armorel High School
7 South Main
Armorel, AR 72310

[ View School Profile ]
",iconGr); Ashdown[Ashdown.length] = createMarker(new GPoint(-94.12114716,33.67171478),"
Ashdown High School
751 Rankin St
Ashdown, AR 71822

[ View School Profile ]
",iconGr); Ashdown[Ashdown.length] = createMarker(new GPoint(-94.11423492,33.66926193),"
Ashdown Junior High School
600 S Ellen Dr
Ashdown, AR 71822

[ View School Profile ]
",iconBl); Atkins[Atkins.length] = createMarker(new GPoint(-92.93903351,35.24415588),"
Atkins Elementary School
302 Avenue Two Nw
Atkins, AR 72823

[ View School Profile ]
",iconRd); Atkins[Atkins.length] = createMarker(new GPoint(-92.94066620,35.24529266),"
Atkins High School
403 Avenue Three Nw
Atkins, AR 72823

[ View School Profile ]
",iconGr); Atkins[Atkins.length] = createMarker(new GPoint(-92.93903351,35.24415588),"
Atkins Middle School
302 Avenue Two Nw
Atkins, AR 72823

[ View School Profile ]
",iconBl); Augusta[Augusta.length] = createMarker(new GPoint(-91.36534882,35.27983856),"
Augusta Elementary School
320 Sycamore Street
Augusta, AR 72006

[ View School Profile ]
",iconRd); Augusta[Augusta.length] = createMarker(new GPoint(-91.36534882,35.27983856),"
Augusta High School
320 Sycamore Street
Augusta, AR 72006

[ View School Profile ]
",iconGr); Ashdown[Ashdown.length] = createMarker(new GPoint(-94.14556122,33.67156219),"
C. D. Franks Elementary School
1321 Foster St
Ashdown, AR 71822

[ View School Profile ]
",iconRd); Amity[Amity.length] = createMarker(new GPoint(-93.30149841,34.19440079),"
Centerpoint High School
755 Hwy 8 East
Amity, AR 71921

[ View School Profile ]
",iconGr); Arkadelphia[Arkadelphia.length] = createMarker(new GPoint(-93.05996704,34.12307739),"
Central Primary School
233 N 11th St
Arkadelphia, AR 71923

[ View School Profile ]
",iconRd); Arkadelphia[Arkadelphia.length] = createMarker(new GPoint(-93.06277466,34.12125015),"
Goza Middle School
1305 Caddo Street
Arkadelphia, AR 71923

[ View School Profile ]
",iconBl); Ashdown[Ashdown.length] = createMarker(new GPoint(-94.12525940,33.67303848),"
L.f. Henderson Intermediate School
410 Burke St
Ashdown, AR 71822

[ View School Profile ]
",iconBl); Arkadelphia[Arkadelphia.length] = createMarker(new GPoint(-93.07458496,34.11368561),"
Louisa Perritt Primary
1900 Walnut St
Arkadelphia, AR 71923

[ View School Profile ]
",iconRd); Ashdown[Ashdown.length] = createMarker(new GPoint(-94.14559937,33.67156219),"
Margaret Daniels Primary
1323 Foster
Ashdown, AR 71822

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

[ View School Profile ]
",iconRd); Altus[Altus.length] = createMarker(new GPoint(-93.76285400,35.44692300),"
Ozark 7th Grade School
P.o. Box 339
Altus, AR 72821

[ View School Profile ]
",iconBl); Arkadelphia[Arkadelphia.length] = createMarker(new GPoint(-93.06795502,34.12323761),"
Peake Elementary School
1609 Pine St
Arkadelphia, AR 71923

[ View School Profile ]
",iconBl); } // 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(Alma); map.removeOverlays(Alpena); map.removeOverlays(Altheimer); map.removeOverlays(Altus); map.removeOverlays(Amity); map.removeOverlays(Arkadelphia); map.removeOverlays(Arkansas_City); map.removeOverlays(Armorel); map.removeOverlays(Ashdown); map.removeOverlays(Atkins); map.removeOverlays(Augusta); 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(Alma);map.removeOverlays(Alma); map.removeOverlays(Alpena); map.removeOverlays(Altheimer); map.removeOverlays(Altus); map.removeOverlays(Amity); map.removeOverlays(Arkadelphia); map.removeOverlays(Arkansas_City); map.removeOverlays(Armorel); map.removeOverlays(Ashdown); map.removeOverlays(Atkins); map.removeOverlays(Augusta); map.addOverlays(Alma); centerByArray(Alma, false, false); cntMarker += Alma.length; map.addOverlays(Alpena); centerByArray(Alpena, false, false); cntMarker += Alpena.length; map.addOverlays(Altheimer); centerByArray(Altheimer, false, false); cntMarker += Altheimer.length; map.addOverlays(Altus); centerByArray(Altus, false, false); cntMarker += Altus.length; map.addOverlays(Amity); centerByArray(Amity, false, false); cntMarker += Amity.length; map.addOverlays(Arkadelphia); centerByArray(Arkadelphia, false, false); cntMarker += Arkadelphia.length; map.addOverlays(Arkansas_City); centerByArray(Arkansas_City, false, false); cntMarker += Arkansas_City.length; map.addOverlays(Armorel); centerByArray(Armorel, false, false); cntMarker += Armorel.length; map.addOverlays(Ashdown); centerByArray(Ashdown, false, false); cntMarker += Ashdown.length; map.addOverlays(Atkins); centerByArray(Atkins, false, false); cntMarker += Atkins.length; map.addOverlays(Augusta); centerByArray(Augusta, false, false); cntMarker += Augusta.length; centerByArray(Alma,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'); } }