function addMarkers() { mySelect = document.getElementById('selection'); Mansfield = [];Shelby = [];Bellville = [];Butler = [];Lexington = [];Lucas = [];Shiloh = [];Plymouth = [];mySelect.options[mySelect.options.length] = new Option("Bellville schools",'all=Bellville'); mySelect.options[mySelect.options.length] = new Option("Butler schools",'all=Butler'); mySelect.options[mySelect.options.length] = new Option("Lexington schools",'all=Lexington'); mySelect.options[mySelect.options.length] = new Option("Lucas schools",'all=Lucas'); mySelect.options[mySelect.options.length] = new Option("Mansfield schools",'all=Mansfield'); mySelect.options[mySelect.options.length] = new Option("Plymouth schools",'all=Plymouth'); mySelect.options[mySelect.options.length] = new Option("Shelby schools",'all=Shelby'); mySelect.options[mySelect.options.length] = new Option("Shiloh schools",'all=Shiloh'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.51983400,40.76317300),"
Adult And Community Education
150 W 5th St
Mansfield, OH 44902

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Adult And Community Education",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.52294922,40.77044678),"
Alternative High School
215 N Trimble Rd
Mansfield, OH 44906

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alternative High School",'Mansfield=' + Mansfield.length); Shelby[Shelby.length] = createMarker(new GPoint(-82.67240143,40.88363647),"
Auburn Elementary School
109 Auburn Ave
Shelby, OH 44875

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Auburn Elementary School",'Shelby=' + Shelby.length); Bellville[Bellville.length] = createMarker(new GPoint(-82.50862122,40.61874771),"
Bellville Elementary School
195 School St
Bellville, OH 44813

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bellville Elementary School",'Bellville=' + Bellville.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.54034424,40.75279236),"
Brinkerhoff Elementary School
240 Euclid Ave
Mansfield, OH 44903

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brinkerhoff Elementary School",'Mansfield=' + Mansfield.length); Butler[Butler.length] = createMarker(new GPoint(-82.42831421,40.59045029),"
Butler Elementary School
125 College St
Butler, OH 44822

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Butler Elementary School",'Butler=' + Butler.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.52777100,40.75724792),"
Carpenter Elementary School
71 Carpenter Rd
Mansfield, OH 44903

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carpenter Elementary School",'Mansfield=' + Mansfield.length); Lexington[Lexington.length] = createMarker(new GPoint(-82.58339691,40.67407990),"
Central Elementary School
124 Frederick St
Lexington, OH 44904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Lexington=' + Lexington.length); Shelby[Shelby.length] = createMarker(new GPoint(-82.65828705,40.88047791),"
Central Elementary School
25 High School Ave
Shelby, OH 44875

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Shelby=' + Shelby.length); Bellville[Bellville.length] = createMarker(new GPoint(-82.47924805,40.60953522),"
Clear Fork High School
987 State Route 97 E
Bellville, OH 44813

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clear Fork High School",'Bellville=' + Bellville.length); Bellville[Bellville.length] = createMarker(new GPoint(-82.47924805,40.60953522),"
Clear Fork Middle School
987 State Route 97 E
Bellville, OH 44813

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Clear Fork Middle School",'Bellville=' + Bellville.length); Shelby[Shelby.length] = createMarker(new GPoint(-82.64584351,40.86920929),"
Dowds Elementary School
18 Seneca Dr
Shelby, OH 44875

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dowds Elementary School",'Shelby=' + Shelby.length); Lexington[Lexington.length] = createMarker(new GPoint(-82.57552338,40.67587662),"
Eastern Elementary School
155 Castor Rd
Lexington, OH 44904

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Eastern Elementary School",'Lexington=' + Lexington.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.46058655,40.79219818),"
Eastview Elementary School
1262 Eastview Dr
Mansfield, OH 44905

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eastview Elementary School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.50992584,40.75354385),"
Hedges Elementary School
176 Hedges St
Mansfield, OH 44902

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hedges Elementary School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.51636800,40.76045600),"
Interactive Media & Construction, Inc.
75 N Walnut St
Mansfield, OH 44902

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Interactive Media & Construction, Inc.",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.48781586,40.75505829),"
Jesse Beer
103 Bahl Ave
Mansfield, OH 44905

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jesse Beer",'Mansfield=' + Mansfield.length); Lexington[Lexington.length] = createMarker(new GPoint(-82.58869171,40.67353821),"
Lexington High School
103 Clever Ln
Lexington, OH 44904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lexington High School",'Lexington=' + Lexington.length); Lexington[Lexington.length] = createMarker(new GPoint(-82.58331299,40.67482376),"
Lexington Junior High School
90 Frederick St
Lexington, OH 44904

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lexington Junior High School",'Lexington=' + Lexington.length); Lucas[Lucas.length] = createMarker(new GPoint(-82.41819763,40.72121048),"
Lucas Elementary School
84 Lucas North Rd
Lucas, OH 44843

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lucas Elementary School",'Lucas=' + Lucas.length); Lucas[Lucas.length] = createMarker(new GPoint(-82.41819763,40.72121429),"
Lucas Heritage Middle School
80 Lucas North Rd
Lucas, OH 44843

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lucas Heritage Middle School",'Lucas=' + Lucas.length); Lucas[Lucas.length] = createMarker(new GPoint(-82.41625214,40.70483780),"
Lucas High School
5 1st Ave
Lucas, OH 44843

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lucas High School",'Lucas=' + Lucas.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.52716064,40.75189972),"
Madison High School
600 Esley Ln
Mansfield, OH 44905

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Madison High School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.48788452,40.76878357),"
Madison Junior High School
690 Ashland Rd
Mansfield, OH 44905

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Madison Junior High School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.48468018,40.73827744),"
Madison South Elementary School
700 S Illinois Ave
Mansfield, OH 44907

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Madison South Elementary School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.52079773,40.73302078),"
Malabar Middle School
205 W Cook Rd
Mansfield, OH 44907

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Malabar Middle School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.51654816,40.76058960),"
Mansfield Community Elementary School
455 Park Ave W
Mansfield, OH 44906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mansfield Community Elementary School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.51743700,40.76108900),"
Mansfield Enhancement Academy
53 W 4th St
Mansfield, OH 44902

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mansfield Enhancement Academy",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.54056549,40.76285553),"
Mansfield High School
124 N Linden Rd
Mansfield, OH 44906

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mansfield High School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.42729187,40.76879883),"
Mifflin Elementary School
441 Reed Rd
Mansfield, OH 44903

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mifflin Elementary School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.49997711,40.77033234),"
Newman Elementary School
457 Central Ave
Mansfield, OH 44905

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Newman Elementary School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.64705658,40.76745987),"
Ontario High School
467 Shelby Ontario Rd
Mansfield, OH 44906

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ontario High School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.64682007,40.76666260),"
Ontario Middle School
447 Shelby Ontario Rd
Mansfield, OH 44906

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ontario Middle School",'Mansfield=' + Mansfield.length); Shelby[Shelby.length] = createMarker(new GPoint(-82.66683197,40.90229416),"
Pioneer Career & Technology
27 Ryan Rd
Shelby, OH 44875

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pioneer Career & Technology",'Shelby=' + Shelby.length); Shiloh[Shiloh.length] = createMarker(new GPoint(-82.66742706,40.99539185),"
Plymouth Elementary School
26 Mechanic St.
Shiloh, OH 44878

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Plymouth Elementary School",'Shiloh=' + Shiloh.length); Plymouth[Plymouth.length] = createMarker(new GPoint(-82.65534210,40.98987961),"
Plymouth High School
400 Trux St
Plymouth, OH 44865

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Plymouth High School",'Plymouth=' + Plymouth.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.52039337,40.74555588),"
Prospect Elementary School
485 Gilbert Ave
Mansfield, OH 44907

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Prospect Elementary School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.52886963,40.72906494),"
Ranchwood Elementary School
1033 Larchwood Rd
Mansfield, OH 44907

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ranchwood Elementary School",'Mansfield=' + Mansfield.length); Shelby[Shelby.length] = createMarker(new GPoint(-82.64865112,40.88293839),"
Russell Elementary School
111 E Whitney Ave
Shelby, OH 44875

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Russell Elementary School",'Shelby=' + Shelby.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.52837372,40.74746323),"
Senior High-cline Ave Bldg High School
314 Cline Ave
Mansfield, OH 44907

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Senior High-cline Ave Bldg High School",'Mansfield=' + Mansfield.length); Shelby[Shelby.length] = createMarker(new GPoint(-82.67051697,40.88666534),"
Shelby High School
109 W Smiley Ave
Shelby, OH 44875

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shelby High School",'Shelby=' + Shelby.length); Shelby[Shelby.length] = createMarker(new GPoint(-82.65937805,40.87762070),"
Shelby Middle School
16 Park Ave
Shelby, OH 44875

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Shelby Middle School",'Shelby=' + Shelby.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.53694916,40.77828217),"
Sherman Elementary School
1138 Springmill St
Mansfield, OH 44906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sherman Elementary School",'Mansfield=' + Mansfield.length); Shiloh[Shiloh.length] = createMarker(new GPoint(-82.60168457,40.96794510),"
Shiloh Elementary School
26 Mechanics St
Shiloh, OH 44878

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shiloh Elementary School",'Shiloh=' + Shiloh.length); Plymouth[Plymouth.length] = createMarker(new GPoint(-82.65534210,40.98987961),"
Shiloh Middle School
400 Trux St
Plymouth, OH 44865

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Shiloh Middle School",'Plymouth=' + Plymouth.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.61533356,40.77656174),"
Simpson Middle School
218 W 4th St
Mansfield, OH 44903

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Simpson Middle School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.55458069,40.79151917),"
Springmill Elementary School
1200 Nestor Dr
Mansfield, OH 44906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Springmill Elementary School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.64598083,40.76531982),"
Stingel Intermediate Elementary School
416 Shelby Ontario Rd
Mansfield, OH 44906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stingel Intermediate Elementary School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.64611053,40.76565933),"
Stingel Primary Elementary School
426 Shelby Ontario Rd
Mansfield, OH 44906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stingel Primary Elementary School",'Mansfield=' + Mansfield.length); Lexington[Lexington.length] = createMarker(new GPoint(-82.59650421,40.68383789),"
Western Elementary School
385 W Main St
Lexington, OH 44904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Western Elementary School",'Lexington=' + Lexington.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.53301239,40.74277878),"
Woodland Elementary School
460 Davis Rd
Mansfield, OH 44907

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodland Elementary School",'Mansfield=' + Mansfield.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.46302032,40.77063751),"
Wooster Heights Elementary School
1419 Grace St
Mansfield, OH 44905

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wooster Heights Elementary School",'Mansfield=' + Mansfield.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(Bellville); map.removeOverlays(Butler); map.removeOverlays(Lexington); map.removeOverlays(Lucas); map.removeOverlays(Mansfield); map.removeOverlays(Plymouth); map.removeOverlays(Shelby); map.removeOverlays(Shiloh); 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(Mansfield);map.removeOverlays(Bellville); map.removeOverlays(Butler); map.removeOverlays(Lexington); map.removeOverlays(Lucas); map.removeOverlays(Mansfield); map.removeOverlays(Plymouth); map.removeOverlays(Shelby); map.removeOverlays(Shiloh); map.addOverlays(Bellville); centerByArray(Bellville, false, false); cntMarker += Bellville.length; map.addOverlays(Butler); centerByArray(Butler, false, false); cntMarker += Butler.length; map.addOverlays(Lexington); centerByArray(Lexington, false, false); cntMarker += Lexington.length; map.addOverlays(Lucas); centerByArray(Lucas, false, false); cntMarker += Lucas.length; map.addOverlays(Mansfield); centerByArray(Mansfield, false, false); cntMarker += Mansfield.length; map.addOverlays(Plymouth); centerByArray(Plymouth, false, false); cntMarker += Plymouth.length; map.addOverlays(Shelby); centerByArray(Shelby, false, false); cntMarker += Shelby.length; map.addOverlays(Shiloh); centerByArray(Shiloh, false, false); cntMarker += Shiloh.length; centerByArray(Mansfield,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'); } }