function addMarkers() { mySelect = document.getElementById('selection'); Amelia = [];Batavia = [];Bethel = [];Milford = [];Owensville = [];Felicity = [];Williamsburg = [];Goshen = [];Loveland = [];New_Richmond = [];mySelect.options[mySelect.options.length] = new Option("Amelia schools",'all=Amelia'); mySelect.options[mySelect.options.length] = new Option("Batavia schools",'all=Batavia'); mySelect.options[mySelect.options.length] = new Option("Bethel schools",'all=Bethel'); mySelect.options[mySelect.options.length] = new Option("Felicity schools",'all=Felicity'); mySelect.options[mySelect.options.length] = new Option("Goshen schools",'all=Goshen'); mySelect.options[mySelect.options.length] = new Option("Loveland schools",'all=Loveland'); mySelect.options[mySelect.options.length] = new Option("Milford schools",'all=Milford'); mySelect.options[mySelect.options.length] = new Option("New Richmond schools",'all=New_Richmond'); mySelect.options[mySelect.options.length] = new Option("Owensville schools",'all=Owensville'); mySelect.options[mySelect.options.length] = new Option("Williamsburg schools",'all=Williamsburg'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Amelia[Amelia.length] = createMarker(new GPoint(-84.21605682,39.02662277),"
Amelia Elementary School
5 E Main St
Amelia, OH 45102

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Amelia Elementary School",'Amelia=' + Amelia.length); Batavia[Batavia.length] = createMarker(new GPoint(-84.23351288,39.06431580),"
Amelia High School
1351 Clough Pike
Batavia, OH 45103

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Amelia High School",'Batavia=' + Batavia.length); Batavia[Batavia.length] = createMarker(new GPoint(-84.23422241,39.06450653),"
Amelia Middle School
1341 Clough Pike
Batavia, OH 45103

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Amelia Middle School",'Batavia=' + Batavia.length); Batavia[Batavia.length] = createMarker(new GPoint(-84.13607788,39.12154770),"
Batavia Elementary School
215 Broadway St
Batavia, OH 45103

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Batavia Elementary School",'Batavia=' + Batavia.length); Batavia[Batavia.length] = createMarker(new GPoint(-84.12971497,39.07107162),"
Batavia High School
1 Bull Dog Pl
Batavia, OH 45103

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Batavia High School",'Batavia=' + Batavia.length); Batavia[Batavia.length] = createMarker(new GPoint(-84.18261719,39.07004547),"
Batavia Middle School
800 Bauer Ave
Batavia, OH 45103

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Batavia Middle School",'Batavia=' + Batavia.length); Bethel[Bethel.length] = createMarker(new GPoint(-84.06488037,38.96218872),"
Bethel Tate High School
3420 State Route 125
Bethel, OH 45106

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethel Tate High School",'Bethel=' + Bethel.length); Bethel[Bethel.length] = createMarker(new GPoint(-84.09286499,38.96519852),"
Bethel-tate Middle School
649 W Plane St
Bethel, OH 45106

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bethel-tate Middle School",'Bethel=' + Bethel.length); Bethel[Bethel.length] = createMarker(new GPoint(-84.08885193,38.96194458),"
Bick Primary Elementary School
101 Fossyl Dr
Bethel, OH 45106

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bick Primary Elementary School",'Bethel=' + Bethel.length); Milford[Milford.length] = createMarker(new GPoint(-84.23824310,39.21097565),"
Boyd E Smith Elementary School
1052 Jer Les St
Milford, OH 45150

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Boyd E Smith Elementary School",'Milford=' + Milford.length); Milford[Milford.length] = createMarker(new GPoint(-84.22308350,39.17905045),"
Charles L Seipelt Elementary School
5684 Cromley Dr
Milford, OH 45150

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Charles L Seipelt Elementary School",'Milford=' + Milford.length); Batavia[Batavia.length] = createMarker(new GPoint(-84.10286713,39.12909317),"
Clermont Northeastern Early Childhood Education Ce Elementary School
2792 Us Highway 50
Batavia, OH 45103

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clermont Northeastern Early Childhood Education Ce Elementary School",'Batavia=' + Batavia.length); Owensville[Owensville.length] = createMarker(new GPoint(-84.13719940,39.12739944),"
Clermont Northeastern Elementary School
Po Box 86
Owensville, OH 45160

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clermont Northeastern Elementary School",'Owensville=' + Owensville.length); Batavia[Batavia.length] = createMarker(new GPoint(-84.09337616,39.16355896),"
Clermont Northeastern High School
5327 Hutchinson Rd
Batavia, OH 45103

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clermont Northeastern High School",'Batavia=' + Batavia.length); Batavia[Batavia.length] = createMarker(new GPoint(-84.09334564,39.16386795),"
Clermont Northeastern Middle School
5347 Hutchinson Rd
Batavia, OH 45103

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Clermont Northeastern Middle School",'Batavia=' + Batavia.length); Felicity[Felicity.length] = createMarker(new GPoint(-84.13904572,38.79241562),"
Felicity-franklin Local High School
415 Washington St
Felicity, OH 45120

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Felicity-franklin Local High School",'Felicity=' + Felicity.length); Felicity[Felicity.length] = createMarker(new GPoint(-84.13904572,38.79241562),"
Felicity-franklin Local School
415 Washington St
Felicity, OH 45120

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Felicity-franklin Local School",'Felicity=' + Felicity.length); Felicity[Felicity.length] = createMarker(new GPoint(-84.13904572,38.79241562),"
Felicity-franklin Middle School
415 Washington St
Felicity, OH 45120

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Felicity-franklin Middle School",'Felicity=' + Felicity.length); Williamsburg[Williamsburg.length] = createMarker(new GPoint(-84.05684662,39.05603790),"
Genesis Center For Learning
549 W Main St Ste B
Williamsburg, OH 45176

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Genesis Center For Learning",'Williamsburg=' + Williamsburg.length); Goshen[Goshen.length] = createMarker(new GPoint(-84.15415955,39.22732162),"
Goshen High School
6707 Goshen Rd
Goshen, OH 45122

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Goshen High School",'Goshen=' + Goshen.length); Goshen[Goshen.length] = createMarker(new GPoint(-84.15299988,39.22679901),"
Goshen Middle School
6692 Goshen Rd
Goshen, OH 45122

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Goshen Middle School",'Goshen=' + Goshen.length); Bethel[Bethel.length] = createMarker(new GPoint(-84.08757019,38.96188736),"
Hill Intermediate Elementary School
150 Fossyl Dr
Bethel, OH 45106

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hill Intermediate Elementary School",'Bethel=' + Bethel.length); Amelia[Amelia.length] = createMarker(new GPoint(-84.19846344,39.02717590),"
Holly Hill Elementary School
3520 State Route 132
Amelia, OH 45102

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holly Hill Elementary School",'Amelia=' + Amelia.length); Milford[Milford.length] = createMarker(new GPoint(-84.29637900,39.17237500),"
Live Oaks Cdc High School
5956 Buckwheat Rd
Milford, OH 45150

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Live Oaks Cdc High School",'Milford=' + Milford.length); Loveland[Loveland.length] = createMarker(new GPoint(-84.25290680,39.24909210),"
Loveland Early Childhood Cente Elementary School
6740 Loveland Miamiville Rd
Loveland, OH 45140

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Loveland Early Childhood Cente Elementary School",'Loveland=' + Loveland.length); Goshen[Goshen.length] = createMarker(new GPoint(-84.15324402,39.22698975),"
Marr/cook Elementary School
6696 Goshen Rd
Goshen, OH 45122

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Marr/cook Elementary School",'Goshen=' + Goshen.length); Loveland[Loveland.length] = createMarker(new GPoint(-84.25943756,39.22750092),"
Mccormick Elementary School
751 Loveland Miamiville Rd
Loveland, OH 45140

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mccormick Elementary School",'Loveland=' + Loveland.length); Milford[Milford.length] = createMarker(new GPoint(-84.24235535,39.19327927),"
Meadowview Elementary School
1039 State Route 28
Milford, OH 45150

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Meadowview Elementary School",'Milford=' + Milford.length); Milford[Milford.length] = createMarker(new GPoint(-84.23564148,39.18238449),"
Milford Junior High School
5735 Pleasant Hill Rd
Milford, OH 45150

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Milford Junior High School",'Milford=' + Milford.length); Milford[Milford.length] = createMarker(new GPoint(-84.29055023,39.17760468),"
Milford Main Middle School
5556 Mount Zion Rd
Milford, OH 45150

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Milford Main Middle School",'Milford=' + Milford.length); Milford[Milford.length] = createMarker(new GPoint(-84.24205780,39.17564774),"
Milford Senior High School
1 Eagles Way
Milford, OH 45150

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Milford Senior High School",'Milford=' + Milford.length); New_Richmond[New_Richmond.length] = createMarker(new GPoint(-84.20397949,38.92935944),"
Monroe Elementary School
2117 Laurel Lindale Rd
New Richmond, OH 45157

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Monroe Elementary School",'New_Richmond=' + New_Richmond.length); Milford[Milford.length] = createMarker(new GPoint(-84.22145844,39.19412231),"
Mulberry Elementary School
5950 Buckwheat Rd
Milford, OH 45150

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mulberry Elementary School",'Milford=' + Milford.length); New_Richmond[New_Richmond.length] = createMarker(new GPoint(-84.26717377,38.95466232),"
New Richmond Elementary School
1141 Bethel New Richmond Rd
New Richmond, OH 45157

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Richmond Elementary School",'New_Richmond=' + New_Richmond.length); New_Richmond[New_Richmond.length] = createMarker(new GPoint(-84.26824951,38.95476151),"
New Richmond High School
1131 Bethel New Richmond Rd
New Richmond, OH 45157

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Richmond High School",'New_Richmond=' + New_Richmond.length); New_Richmond[New_Richmond.length] = createMarker(new GPoint(-84.26797485,38.95476151),"
New Richmond Middle School
1135 Bethel New Richmond Rd
New Richmond, OH 45157

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("New Richmond Middle School",'New_Richmond=' + New_Richmond.length); Milford[Milford.length] = createMarker(new GPoint(-84.28949738,39.15596771),"
Pattison Elementary School
5330 S Milford Rd
Milford, OH 45150

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pattison Elementary School",'Milford=' + Milford.length); Milford[Milford.length] = createMarker(new GPoint(-84.36351776,39.18201447),"
Sellman Middle School
527 Lila Ave
Milford, OH 45150

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sellman Middle School",'Milford=' + Milford.length); Goshen[Goshen.length] = createMarker(new GPoint(-84.15299988,39.22679901),"
Spaulding Elementary School
6755 Linton Rd
Goshen, OH 45122

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Spaulding Elementary School",'Goshen=' + Goshen.length); Bethel[Bethel.length] = createMarker(new GPoint(-84.08553314,38.96401215),"
U S Grant High School
718 W Plane St
Bethel, OH 45106

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("U S Grant High School",'Bethel=' + Bethel.length); Milford[Milford.length] = createMarker(new GPoint(-84.19481659,39.16651535),"
West Broad Street Elementary School
5556 Mount Zion Rd
Milford, OH 45150

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Broad Street Elementary School",'Milford=' + Milford.length); Williamsburg[Williamsburg.length] = createMarker(new GPoint(-84.06208801,39.05672455),"
Williamsburg Elementary School
839 Spring St
Williamsburg, OH 45176

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Williamsburg Elementary School",'Williamsburg=' + Williamsburg.length); Williamsburg[Williamsburg.length] = createMarker(new GPoint(-84.06561279,39.05060196),"
Williamsburg High School
500 S 5th St
Williamsburg, OH 45176

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Williamsburg High School",'Williamsburg=' + Williamsburg.length); Batavia[Batavia.length] = createMarker(new GPoint(-84.24459076,39.09860611),"
Willowville Elementary School
4529 Schoolhouse Rd
Batavia, OH 45103

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Willowville Elementary School",'Batavia=' + Batavia.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(Amelia); map.removeOverlays(Batavia); map.removeOverlays(Bethel); map.removeOverlays(Felicity); map.removeOverlays(Goshen); map.removeOverlays(Loveland); map.removeOverlays(Milford); map.removeOverlays(New_Richmond); map.removeOverlays(Owensville); map.removeOverlays(Williamsburg); 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(Amelia);map.removeOverlays(Amelia); map.removeOverlays(Batavia); map.removeOverlays(Bethel); map.removeOverlays(Felicity); map.removeOverlays(Goshen); map.removeOverlays(Loveland); map.removeOverlays(Milford); map.removeOverlays(New_Richmond); map.removeOverlays(Owensville); map.removeOverlays(Williamsburg); map.addOverlays(Amelia); centerByArray(Amelia, false, false); cntMarker += Amelia.length; map.addOverlays(Batavia); centerByArray(Batavia, false, false); cntMarker += Batavia.length; map.addOverlays(Bethel); centerByArray(Bethel, false, false); cntMarker += Bethel.length; map.addOverlays(Felicity); centerByArray(Felicity, false, false); cntMarker += Felicity.length; map.addOverlays(Goshen); centerByArray(Goshen, false, false); cntMarker += Goshen.length; map.addOverlays(Loveland); centerByArray(Loveland, false, false); cntMarker += Loveland.length; map.addOverlays(Milford); centerByArray(Milford, false, false); cntMarker += Milford.length; map.addOverlays(New_Richmond); centerByArray(New_Richmond, false, false); cntMarker += New_Richmond.length; map.addOverlays(Owensville); centerByArray(Owensville, false, false); cntMarker += Owensville.length; map.addOverlays(Williamsburg); centerByArray(Williamsburg, false, false); cntMarker += Williamsburg.length; centerByArray(Amelia,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'); } }