function addMarkers() { mySelect = document.getElementById('selection'); Marion = [];Caledonia = [];Green_Camp = [];Prospect = [];La_Rue = [];Morral = [];mySelect.options[mySelect.options.length] = new Option("Caledonia schools",'all=Caledonia'); mySelect.options[mySelect.options.length] = new Option("Green Camp schools",'all=Green_Camp'); mySelect.options[mySelect.options.length] = new Option("La Rue schools",'all=La_Rue'); mySelect.options[mySelect.options.length] = new Option("Marion schools",'all=Marion'); mySelect.options[mySelect.options.length] = new Option("Morral schools",'all=Morral'); mySelect.options[mySelect.options.length] = new Option("Prospect schools",'all=Prospect'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Marion[Marion.length] = createMarker(new GPoint(-83.10472870,40.58311081),"
Baker Middle School
400 Pennsylvania Ave
Marion, OH 43302

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Baker Middle School",'Marion=' + Marion.length); Caledonia[Caledonia.length] = createMarker(new GPoint(-83.02185059,40.58263016),"
Claridon Elementary School
3938 Marion Mount Gilead Rd
Caledonia, OH 43314

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Claridon Elementary School",'Caledonia=' + Caledonia.length); Marion[Marion.length] = createMarker(new GPoint(-83.16050720,40.56740189),"
Colonial Acres Elementary School
1565 Amherst Dr
Marion, OH 43302

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Colonial Acres Elementary School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.14947510,40.57179260),"
Edison Middle School
871 Chatfield Rd
Marion, OH 43302

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Edison Middle School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.25238800,40.56619263),"
Elgin Digital Academy
4616 Larue Prospect Rd W
Marion, OH 43302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elgin Digital Academy",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.24668121,40.56679916),"
Elgin High School
1239 Keener Rd S
Marion, OH 43302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elgin High School",'Marion=' + Marion.length); Green_Camp[Green_Camp.length] = createMarker(new GPoint(-83.20960236,40.53200150),"
Elgin Junior High School
Po Box 214
Green Camp, OH 43322

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Elgin Junior High School",'Green_Camp=' + Green_Camp.length); Prospect[Prospect.length] = createMarker(new GPoint(-83.18737030,40.45186996),"
Elgin South Elementary School
200 N East St
Prospect, OH 43342

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Elgin South Elementary School",'Prospect=' + Prospect.length); La_Rue[La_Rue.length] = createMarker(new GPoint(-83.38421631,40.58024597),"
Elgin West Elementary School
350 N High St
La Rue, OH 43332

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Elgin West Elementary School",'La_Rue=' + La_Rue.length); Marion[Marion.length] = createMarker(new GPoint(-83.11898804,40.60689163),"
Fair Park Elementary School
1000 Robinson St
Marion, OH 43302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fair Park Elementary School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.10468292,40.58546448),"
George Washington Elementary School
400 Pennsylvania Ave
Marion, OH 43302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George Washington Elementary School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.09007263,40.59108734),"
Harding High School
1500 Harding Hwy E
Marion, OH 43302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harding High School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.04262543,40.57364655),"
Heritage Elementary School
720 Columbus Sandusky Rd S
Marion, OH 43302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Heritage Elementary School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.12239838,40.58340073),"
Hickory Grove (majcf) High School
332 Marion-williamsport Rd
Marion, OH 43302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hickory Grove (majcf) High School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.15020752,40.58419800),"
Indian Mound Elementary School
625 Brightwood Dr
Marion, OH 43302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Indian Mound Elementary School",'Marion=' + Marion.length); Morral[Morral.length] = createMarker(new GPoint(-83.17347717,40.64283371),"
Jackson-eastside Elementary School
3103 Hillman Ford Rd
Morral, OH 43337

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jackson-eastside Elementary School",'Morral=' + Morral.length); Marion[Marion.length] = createMarker(new GPoint(-83.08489990,40.58100128),"
James A Garfield Elementary School
1170 Brookside Rd
Marion, OH 43302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("James A Garfield Elementary School",'Marion=' + Marion.length); Caledonia[Caledonia.length] = createMarker(new GPoint(-82.97848511,40.61689377),"
Liberty Elementary School
1932 Whetstone River Rd N
Caledonia, OH 43314

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liberty Elementary School",'Caledonia=' + Caledonia.length); Marion[Marion.length] = createMarker(new GPoint(-83.12239838,40.58340073),"
Marion City Digital Academy
910 E Church St
Marion, OH 43302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marion City Digital Academy",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.12075806,40.59509659),"
Mark Street Elementary School
412 E Mark St
Marion, OH 43302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mark Street Elementary School",'Marion=' + Marion.length); Morral[Morral.length] = createMarker(new GPoint(-83.20973206,40.68766403),"
Morral Elementary School
175 W Neff St
Morral, OH 43337

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Morral Elementary School",'Morral=' + Morral.length); Marion[Marion.length] = createMarker(new GPoint(-83.13247681,40.59834671),"
Oak Street Elementary School
565 Oak St
Marion, OH 43302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak Street Elementary School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.14530945,40.57487869),"
Oakland Elementary School
765 Uncapher Ave
Marion, OH 43302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakland Elementary School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.13790131,40.57884979),"
Olney Avenue Elementary School
575 Olney Ave
Marion, OH 43302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Olney Avenue Elementary School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.13131714,40.58156967),"
Pearl Street Elementary School
436 Pearl St
Marion, OH 43302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pearl Street Elementary School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.13971710,40.52006149),"
Pleasant Community Digital
1107 Owens Rd W
Marion, OH 43302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pleasant Community Digital",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.13966370,40.52006149),"
Pleasant Elementary School
1105 Owens Rd W
Marion, OH 43302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Elementary School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.13956451,40.52006149),"
Pleasant High School
1101 Owens Rd W
Marion, OH 43302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pleasant High School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.13591003,40.51998520),"
Pleasant Middle School
3507 Smeltzer Rd
Marion, OH 43302

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pleasant Middle School",'Marion=' + Marion.length); Morral[Morral.length] = createMarker(new GPoint(-83.17347717,40.64286041),"
Ridgedale Elementary School
3105 Hillman Ford Rd
Morral, OH 43337

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ridgedale Elementary School",'Morral=' + Morral.length); Morral[Morral.length] = createMarker(new GPoint(-83.17347717,40.64362717),"
Ridgedale Jr/sr High School
3165 Hillman Ford Rd
Morral, OH 43337

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ridgedale Jr/sr High School",'Morral=' + Morral.length); Caledonia[Caledonia.length] = createMarker(new GPoint(-83.03166962,40.61063766),"
River Valley Digital Academy
197 Brocklesby Rd
Caledonia, OH 43314

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("River Valley Digital Academy",'Caledonia=' + Caledonia.length); Caledonia[Caledonia.length] = createMarker(new GPoint(-83.01430511,40.58290482),"
River Valley High School
4280 Marion Mount Gilead Rd
Caledonia, OH 43314

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("River Valley High School",'Caledonia=' + Caledonia.length); Caledonia[Caledonia.length] = createMarker(new GPoint(-83.01332092,40.58293533),"
River Valley Middle School
4334 Marion Mount Gilead Rd
Caledonia, OH 43314

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("River Valley Middle School",'Caledonia=' + Caledonia.length); Marion[Marion.length] = createMarker(new GPoint(-83.63459778,41.02329636),"
Silver Street Elementary School
750 Silver St
Marion, OH 43302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Silver Street Elementary School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.11927795,40.60703659),"
Taft Elementary School
1000 Robinson St
Marion, OH 43302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Taft Elementary School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.12776947,40.59652710),"
Taft Middle School
474 N State St
Marion, OH 43302

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Taft Middle School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.08433533,40.58103943),"
Treca Digital Academy
1713 Marion Mount Gilead Rd
Marion, OH 43302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Treca Digital Academy",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.07066345,40.58159637),"
Tri-rivers Career Center
2222 Marion Mount Gilead Rd
Marion, OH 43302

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tri-rivers Career Center",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.12158800,40.58215800),"
Ulysses S. Grant Middle School
420 Presidential Dr
Marion, OH 43302

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ulysses S. Grant Middle School",'Marion=' + Marion.length); Marion[Marion.length] = createMarker(new GPoint(-83.12304800,40.57099400),"
William Mckinley Elementary School
100 Executive Dr
Marion, OH 43302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("William Mckinley Elementary School",'Marion=' + Marion.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(Caledonia); map.removeOverlays(Green_Camp); map.removeOverlays(La_Rue); map.removeOverlays(Marion); map.removeOverlays(Morral); map.removeOverlays(Prospect); 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(Marion);map.removeOverlays(Caledonia); map.removeOverlays(Green_Camp); map.removeOverlays(La_Rue); map.removeOverlays(Marion); map.removeOverlays(Morral); map.removeOverlays(Prospect); map.addOverlays(Caledonia); centerByArray(Caledonia, false, false); cntMarker += Caledonia.length; map.addOverlays(Green_Camp); centerByArray(Green_Camp, false, false); cntMarker += Green_Camp.length; map.addOverlays(La_Rue); centerByArray(La_Rue, false, false); cntMarker += La_Rue.length; map.addOverlays(Marion); centerByArray(Marion, false, false); cntMarker += Marion.length; map.addOverlays(Morral); centerByArray(Morral, false, false); cntMarker += Morral.length; map.addOverlays(Prospect); centerByArray(Prospect, false, false); cntMarker += Prospect.length; centerByArray(Marion,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'); } }