function addMarkers() { mySelect = document.getElementById('selection'); Albany = [];Muncie = [];Daleville = [];Eaton = [];Gaston = [];Selma = [];Yorktown = [];mySelect.options[mySelect.options.length] = new Option("Albany schools",'all=Albany'); mySelect.options[mySelect.options.length] = new Option("Daleville schools",'all=Daleville'); mySelect.options[mySelect.options.length] = new Option("Eaton schools",'all=Eaton'); mySelect.options[mySelect.options.length] = new Option("Gaston schools",'all=Gaston'); mySelect.options[mySelect.options.length] = new Option("Muncie schools",'all=Muncie'); mySelect.options[mySelect.options.length] = new Option("Selma schools",'all=Selma'); mySelect.options[mySelect.options.length] = new Option("Yorktown schools",'all=Yorktown'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Albany[Albany.length] = createMarker(new GPoint(-85.24468231,40.29983521),"
Albany Elementary School
700 W State St
Albany, IN 47320

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Albany Elementary School",'Albany=' + Albany.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.40906525,40.19778442),"
Burris Laboratory School
2000 University Ave
Muncie, IN 47306

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Burris Laboratory School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.34052277,40.19683838),"
Claypool Elementary School
3900 E Wysor St
Muncie, IN 47303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Claypool Elementary School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.38645935,40.19453812),"
Cowan Elementary School
1000 W Cr 600 S
Muncie, IN 47302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cowan Elementary School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.39375305,40.10760117),"
Cowan High School
9401 S Nottingham
Muncie, IN 47302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cowan High School",'Muncie=' + Muncie.length); Daleville[Daleville.length] = createMarker(new GPoint(-85.55548096,40.11679459),"
Daleville Elementary School
8600 S Bronco Dr
Daleville, IN 47334

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Daleville Elementary School",'Daleville=' + Daleville.length); Daleville[Daleville.length] = createMarker(new GPoint(-85.55548096,40.11864471),"
Daleville Jr/sr High School
8400 S Bronco Dr
Daleville, IN 47334

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Daleville Jr/sr High School",'Daleville=' + Daleville.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.38645935,40.19453812),"
Delta High School
3400 E Sr 28
Muncie, IN 47303

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Delta High School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.38645935,40.19453812),"
Delta Middle School
9800 N Cr 200 E
Muncie, IN 47303

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Delta Middle School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.38645935,40.19453812),"
Desoto Elementary School
8400 E 400 N
Muncie, IN 47303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Desoto Elementary School",'Muncie=' + Muncie.length); Eaton[Eaton.length] = createMarker(new GPoint(-85.35066986,40.34020996),"
Eaton Elementary School
200 N E Union St-po Box 497
Eaton, IN 47338

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eaton Elementary School",'Eaton=' + Eaton.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.38151550,40.18106461),"
Garfield Elementary School
1600 S Madison St
Muncie, IN 47302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Muncie=' + Muncie.length); Gaston[Gaston.length] = createMarker(new GPoint(-85.51339722,40.32030106),"
Gaston Elementary School
500 Jackson St
Gaston, IN 47342

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gaston Elementary School",'Gaston=' + Gaston.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.36737823,40.16475296),"
Grissom Elementary School
3201 S Macedonia Ave
Muncie, IN 47302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Grissom Elementary School",'Muncie=' + Muncie.length); Gaston[Gaston.length] = createMarker(new GPoint(-85.50113678,40.31375122),"
Harrison Elementary School
9710 W Cr 500 N
Gaston, IN 47342

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Harrison Elementary School",'Gaston=' + Gaston.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.38645935,40.19453812),"
In Aca For Sci Math & Humanities High School
Wagoner Halls Ball St Univ
Muncie, IN 47306

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("In Aca For Sci Math & Humanities High School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.36531830,40.20763779),"
Longfellow Elementary School
1900 E Centennial
Muncie, IN 47303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Longfellow Elementary School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.41865540,40.22566223),"
Mitchell Elementary School
2809 W Purdue Ave
Muncie, IN 47304

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mitchell Elementary School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.42940521,40.18916321),"
Morrison-mock School
3701 W Godman Ave
Muncie, IN 47304

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Morrison-mock School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.34481812,40.10681915),"
Muncie Area Career Center
2500 N Elgin
Muncie, IN 47303

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Muncie Area Career Center",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.38648224,40.20145035),"
Muncie Central High School
801 N Walnut St
Muncie, IN 47305

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Muncie Central High School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.37178040,40.16375732),"
Muncie Southside High School
1601 E 26th St
Muncie, IN 47302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Muncie Southside High School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.39514160,40.22436142),"
North View Elementary School
807 W Yale Ave
Muncie, IN 47304

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North View Elementary School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.41135406,40.21149063),"
Northside Middle School
2400 W Bethel Ave
Muncie, IN 47304

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Northside Middle School",'Muncie=' + Muncie.length); Selma[Selma.length] = createMarker(new GPoint(-85.27624512,40.14933777),"
Perry Elementary School
9400 E Windsor Rd
Selma, IN 47383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Perry Elementary School",'Selma=' + Selma.length); Yorktown[Yorktown.length] = createMarker(new GPoint(-85.49228668,40.18546295),"
Pleasant View Elementary School
9101 W River Rd
Yorktown, IN 47396

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant View Elementary School",'Yorktown=' + Yorktown.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.37250519,40.26236343),"
Royerton Elementary School
1401 E Royerton Rd
Muncie, IN 47303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Royerton Elementary School",'Muncie=' + Muncie.length); Selma[Selma.length] = createMarker(new GPoint(-85.26799774,40.16339874),"
Selma Elementary School
Po Box 336
Selma, IN 47383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Selma Elementary School",'Selma=' + Selma.length); Selma[Selma.length] = createMarker(new GPoint(-85.26860046,40.19155884),"
Selma Middle School
10501 E Cr 167 S
Selma, IN 47383

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Selma Middle School",'Selma=' + Selma.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.38832092,40.17684937),"
South View Elementary School
2100 S Franklin
Muncie, IN 47302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South View Elementary School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.42395782,40.20836258),"
Storer Elementary School
3211 Mansfield Dr
Muncie, IN 47304

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Storer Elementary School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.35041809,40.17843628),"
Sutton Elementary School
3100 E Memorial Dr
Muncie, IN 47302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sutton Elementary School",'Muncie=' + Muncie.length); Selma[Selma.length] = createMarker(new GPoint(-85.26860046,40.19155884),"
Wapahani High School
10401 E Cr 167 S
Selma, IN 47383

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wapahani High School",'Selma=' + Selma.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.37599945,40.19451904),"
Washington-carver Elementary School
1000 E Washington
Muncie, IN 47305

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington-carver Elementary School",'Muncie=' + Muncie.length); Gaston[Gaston.length] = createMarker(new GPoint(-85.50113678,40.31375122),"
Wes-del Middle/senior High School
10000 N Cr 600 W
Gaston, IN 47342

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wes-del Middle/senior High School",'Gaston=' + Gaston.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.42578888,40.19546127),"
West View Elementary School
3401 W Gilbert St
Muncie, IN 47304

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West View Elementary School",'Muncie=' + Muncie.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.42382050,40.17806244),"
Wilson Middle School
3100 S Tillotson St
Muncie, IN 47302

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Wilson Middle School",'Muncie=' + Muncie.length); Yorktown[Yorktown.length] = createMarker(new GPoint(-85.48999023,40.17640686),"
Yorktown Elementary School
8810 W Smith St
Yorktown, IN 47396

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Yorktown Elementary School",'Yorktown=' + Yorktown.length); Yorktown[Yorktown.length] = createMarker(new GPoint(-85.50330353,40.18600082),"
Yorktown High School
1100 S Tiger Dr
Yorktown, IN 47396

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Yorktown High School",'Yorktown=' + Yorktown.length); Yorktown[Yorktown.length] = createMarker(new GPoint(-85.49017334,40.17626953),"
Yorktown Middle School
8820 W Smith St
Yorktown, IN 47396

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Yorktown Middle School",'Yorktown=' + Yorktown.length); Muncie[Muncie.length] = createMarker(new GPoint(-85.42652893,40.18156815),"
Youth Opportunity Center
3700 W Kilgore Ave
Muncie, IN 47304

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Youth Opportunity Center",'Muncie=' + Muncie.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(Albany); map.removeOverlays(Daleville); map.removeOverlays(Eaton); map.removeOverlays(Gaston); map.removeOverlays(Muncie); map.removeOverlays(Selma); map.removeOverlays(Yorktown); 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(Albany);map.removeOverlays(Albany); map.removeOverlays(Daleville); map.removeOverlays(Eaton); map.removeOverlays(Gaston); map.removeOverlays(Muncie); map.removeOverlays(Selma); map.removeOverlays(Yorktown); map.addOverlays(Albany); centerByArray(Albany, false, false); cntMarker += Albany.length; map.addOverlays(Daleville); centerByArray(Daleville, false, false); cntMarker += Daleville.length; map.addOverlays(Eaton); centerByArray(Eaton, false, false); cntMarker += Eaton.length; map.addOverlays(Gaston); centerByArray(Gaston, false, false); cntMarker += Gaston.length; map.addOverlays(Muncie); centerByArray(Muncie, false, false); cntMarker += Muncie.length; map.addOverlays(Selma); centerByArray(Selma, false, false); cntMarker += Selma.length; map.addOverlays(Yorktown); centerByArray(Yorktown, false, false); cntMarker += Yorktown.length; centerByArray(Albany,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'); } }