function addMarkers() { mySelect = document.getElementById('selection'); Brunswick = [];Medina = [];Wadsworth = [];Spencer = [];Lodi = [];Seville = [];Hinckley = [];Litchfield = [];Sharon_Center = [];Westfield_Center = [];mySelect.options[mySelect.options.length] = new Option("Brunswick schools",'all=Brunswick'); mySelect.options[mySelect.options.length] = new Option("Hinckley schools",'all=Hinckley'); mySelect.options[mySelect.options.length] = new Option("Litchfield schools",'all=Litchfield'); mySelect.options[mySelect.options.length] = new Option("Lodi schools",'all=Lodi'); mySelect.options[mySelect.options.length] = new Option("Medina schools",'all=Medina'); mySelect.options[mySelect.options.length] = new Option("Seville schools",'all=Seville'); mySelect.options[mySelect.options.length] = new Option("Sharon Center schools",'all=Sharon_Center'); mySelect.options[mySelect.options.length] = new Option("Spencer schools",'all=Spencer'); mySelect.options[mySelect.options.length] = new Option("Wadsworth schools",'all=Wadsworth'); mySelect.options[mySelect.options.length] = new Option("Westfield Center schools",'all=Westfield_Center'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Brunswick[Brunswick.length] = createMarker(new GPoint(-81.82569885,41.22359085),"
Applewood Elementary School
3891 Applewood Dr
Brunswick, OH 44212

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Applewood Elementary School",'Brunswick=' + Brunswick.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-81.81389618,41.23839188),"
Brunswick High School
3581 Center Rd
Brunswick, OH 44212

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brunswick High School",'Brunswick=' + Brunswick.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-81.82524872,41.26892471),"
Brunswick Memorial Elementary School
3845 Magnolia Dr
Brunswick, OH 44212

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brunswick Memorial Elementary School",'Brunswick=' + Brunswick.length); Medina[Medina.length] = createMarker(new GPoint(-81.92527771,41.19052124),"
Buckeye High School
3084 Columbia Rd
Medina, OH 44256

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Buckeye High School",'Medina=' + Medina.length); Medina[Medina.length] = createMarker(new GPoint(-81.92527771,41.19154739),"
Buckeye Junior High School
3024 Columbia Rd
Medina, OH 44256

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Buckeye Junior High School",'Medina=' + Medina.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-81.81301117,41.23839188),"
C R Towslee Elementary School
3555 Center Rd
Brunswick, OH 44212

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("C R Towslee Elementary School",'Brunswick=' + Brunswick.length); Wadsworth[Wadsworth.length] = createMarker(new GPoint(-81.72939301,41.02439117),"
Central Intermediate School
151 Main St
Wadsworth, OH 44281

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Central Intermediate School",'Wadsworth=' + Wadsworth.length); Spencer[Spencer.length] = createMarker(new GPoint(-82.02448273,41.10228348),"
Chatham Elementary School
6306 Avon Lake Rd
Spencer, OH 44275

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chatham Elementary School",'Spencer=' + Spencer.length); Medina[Medina.length] = createMarker(new GPoint(-81.85885620,41.14420319),"
Claggett Middle School
420 E Union St
Medina, OH 44256

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Claggett Middle School",'Medina=' + Medina.length); Lodi[Lodi.length] = createMarker(new GPoint(-81.96577454,41.04084396),"
Cloverleaf High School
8525 Friendsville Rd
Lodi, OH 44254

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cloverleaf High School",'Lodi=' + Lodi.length); Seville[Seville.length] = createMarker(new GPoint(-81.96170044,41.04149628),"
Cloverleaf Middle School
7500 Buffham Rd
Seville, OH 44273

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Cloverleaf Middle School",'Seville=' + Seville.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-81.78501892,41.26850510),"
Crestview Elementary School
300 W 130th St
Brunswick, OH 44212

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Crestview Elementary School",'Brunswick=' + Brunswick.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-81.84123993,41.23410416),"
Edwards Middle School
1497 Pearl Rd
Brunswick, OH 44212

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Edwards Middle School",'Brunswick=' + Brunswick.length); Medina[Medina.length] = createMarker(new GPoint(-81.87006378,41.12774277),"
Ella Canavan Elementary School
825 Lawrence St
Medina, OH 44256

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ella Canavan Elementary School",'Medina=' + Medina.length); Wadsworth[Wadsworth.length] = createMarker(new GPoint(-81.72612000,41.01303864),"
Franklin Elementary School
200 Takacs Dr
Wadsworth, OH 44281

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Franklin Elementary School",'Wadsworth=' + Wadsworth.length); Medina[Medina.length] = createMarker(new GPoint(-81.86334991,41.13742447),"
Garfield Elementary School
234 S Broadway St
Medina, OH 44256

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Medina=' + Medina.length); Medina[Medina.length] = createMarker(new GPoint(-81.86401900,41.14032000),"
Granger Elementary School
3940 Ridge Rd
Medina, OH 44256

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Granger Elementary School",'Medina=' + Medina.length); Medina[Medina.length] = createMarker(new GPoint(-81.85719299,41.11354828),"
H G Blake Elementary School
4704 Lexington Ridge Dr
Medina, OH 44256

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("H G Blake Elementary School",'Medina=' + Medina.length); Medina[Medina.length] = createMarker(new GPoint(-81.84876251,41.12573242),"
Heritage Elementary School
833 Guilford Blvd
Medina, OH 44256

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Heritage Elementary School",'Medina=' + Medina.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-81.85308838,41.24574280),"
Hickory Ridge Elementary School
4628 Hickory Ridge Ave
Brunswick, OH 44212

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hickory Ridge Elementary School",'Brunswick=' + Brunswick.length); Medina[Medina.length] = createMarker(new GPoint(-81.74198151,41.16927338),"
Highland High School
4150 Ridge Rd
Medina, OH 44256

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Highland High School",'Medina=' + Medina.length); Medina[Medina.length] = createMarker(new GPoint(-81.74188232,41.16746902),"
Highland Middle School
3880 Ridge Rd
Medina, OH 44256

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Highland Middle School",'Medina=' + Medina.length); Hinckley[Hinckley.length] = createMarker(new GPoint(-81.74283600,41.23836136),"
Hinckley Elementary School
1586 Center Rd
Hinckley, OH 44233

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hinckley Elementary School",'Hinckley=' + Hinckley.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-81.81511688,41.22349167),"
Huntington Elementary School
1931 Huntington Cir
Brunswick, OH 44212

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Huntington Elementary School",'Brunswick=' + Brunswick.length); Wadsworth[Wadsworth.length] = createMarker(new GPoint(-81.73851776,41.02553558),"
Isham Memorial Elementary School
348 College St
Wadsworth, OH 44281

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Isham Memorial Elementary School",'Wadsworth=' + Wadsworth.length); Medina[Medina.length] = createMarker(new GPoint(-81.93496704,41.10017776),"
Lafayette Elementary School
6357 Lafayette Rd
Medina, OH 44256

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lafayette Elementary School",'Medina=' + Medina.length); Wadsworth[Wadsworth.length] = createMarker(new GPoint(-81.72795868,41.03029633),"
Lincoln Elementary School
268 N Lyman St
Wadsworth, OH 44281

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Wadsworth=' + Wadsworth.length); Litchfield[Litchfield.length] = createMarker(new GPoint(-82.02536774,41.17003632),"
Litchfield Elementary School
9339 Brooker St
Litchfield, OH 44253

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Litchfield Elementary School",'Litchfield=' + Litchfield.length); Medina[Medina.length] = createMarker(new GPoint(-81.93255615,41.23867035),"
Liverpool Elementary School
3140 Columbia Rd
Medina, OH 44256

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liverpool Elementary School",'Medina=' + Medina.length); Lodi[Lodi.length] = createMarker(new GPoint(-82.00853729,41.03302765),"
Lodi Elementary School
301 Mill St
Lodi, OH 44254

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lodi Elementary School",'Lodi=' + Lodi.length); Medina[Medina.length] = createMarker(new GPoint(-81.85099030,41.14220047),"
Medina City Kdg Center Elementary School
739 Weymouth Rd
Medina, OH 44256

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Medina City Kdg Center Elementary School",'Medina=' + Medina.length); Medina[Medina.length] = createMarker(new GPoint(-81.90301514,41.15523529),"
Medina County Career Center
1101 W Liberty St
Medina, OH 44256

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Medina County Career Center",'Medina=' + Medina.length); Medina[Medina.length] = createMarker(new GPoint(-81.85126495,41.14315414),"
Medina High School
777 E Union St
Medina, OH 44256

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Medina High School",'Medina=' + Medina.length); Wadsworth[Wadsworth.length] = createMarker(new GPoint(-81.71411133,41.02573776),"
Overlook Elementary School
524 Broad St
Wadsworth, OH 44281

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Overlook Elementary School",'Wadsworth=' + Wadsworth.length); Medina[Medina.length] = createMarker(new GPoint(-81.87220764,41.11996460),"
Root Middle School
333 W Sturbridge Dr
Medina, OH 44256

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Root Middle School",'Medina=' + Medina.length); Seville[Seville.length] = createMarker(new GPoint(-81.86097717,41.00996399),"
Seville Elementary School
24 E Main St
Seville, OH 44273

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Seville Elementary School",'Seville=' + Seville.length); Sharon_Center[Sharon_Center.length] = createMarker(new GPoint(-81.73580170,41.09970093),"
Sharon Elementary School
Po Box 179
Sharon Center, OH 44274

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sharon Elementary School",'Sharon_Center=' + Sharon_Center.length); Medina[Medina.length] = createMarker(new GPoint(-81.85549164,41.14260864),"
Sidney Fenn Elementary School
320 N Spring Grove St
Medina, OH 44256

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sidney Fenn Elementary School",'Medina=' + Medina.length); Wadsworth[Wadsworth.length] = createMarker(new GPoint(-81.73139191,41.03913879),"
Valley View Elementary School
160 W Good Ave
Wadsworth, OH 44281

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Valley View Elementary School",'Wadsworth=' + Wadsworth.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-81.84111786,41.23569107),"
Visintainer Middle School
1459 Pearl Rd
Brunswick, OH 44212

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Visintainer Middle School",'Brunswick=' + Brunswick.length); Wadsworth[Wadsworth.length] = createMarker(new GPoint(-81.71015930,41.02546310),"
Wadsworth High School
625 Broad St
Wadsworth, OH 44281

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wadsworth High School",'Wadsworth=' + Wadsworth.length); Wadsworth[Wadsworth.length] = createMarker(new GPoint(-81.70402527,41.02447891),"
Wadsworth Middle School
150 Silvercreek Rd
Wadsworth, OH 44281

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wadsworth Middle School",'Wadsworth=' + Wadsworth.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-81.81745148,41.26127243),"
Walter Kidder Elementary School
3650 Grafton Rd
Brunswick, OH 44212

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Walter Kidder Elementary School",'Brunswick=' + Brunswick.length); Westfield_Center[Westfield_Center.length] = createMarker(new GPoint(-81.92960358,41.02949905),"
Westfield Elementary School
Po Box 5003
Westfield Center, OH 44251

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westfield Elementary School",'Westfield_Center=' + Westfield_Center.length); Brunswick[Brunswick.length] = createMarker(new GPoint(-81.82363892,41.24734879),"
Willetts Middle School
1045 Hadcock Rd
Brunswick, OH 44212

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Willetts Middle School",'Brunswick=' + Brunswick.length); Medina[Medina.length] = createMarker(new GPoint(-81.92862701,41.16743851),"
York Elementary School
3180 Columbia Rd
Medina, OH 44256

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("York Elementary School",'Medina=' + Medina.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(Brunswick); map.removeOverlays(Hinckley); map.removeOverlays(Litchfield); map.removeOverlays(Lodi); map.removeOverlays(Medina); map.removeOverlays(Seville); map.removeOverlays(Sharon_Center); map.removeOverlays(Spencer); map.removeOverlays(Wadsworth); map.removeOverlays(Westfield_Center); 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(Brunswick);map.removeOverlays(Brunswick); map.removeOverlays(Hinckley); map.removeOverlays(Litchfield); map.removeOverlays(Lodi); map.removeOverlays(Medina); map.removeOverlays(Seville); map.removeOverlays(Sharon_Center); map.removeOverlays(Spencer); map.removeOverlays(Wadsworth); map.removeOverlays(Westfield_Center); map.addOverlays(Brunswick); centerByArray(Brunswick, false, false); cntMarker += Brunswick.length; map.addOverlays(Hinckley); centerByArray(Hinckley, false, false); cntMarker += Hinckley.length; map.addOverlays(Litchfield); centerByArray(Litchfield, false, false); cntMarker += Litchfield.length; map.addOverlays(Lodi); centerByArray(Lodi, false, false); cntMarker += Lodi.length; map.addOverlays(Medina); centerByArray(Medina, false, false); cntMarker += Medina.length; map.addOverlays(Seville); centerByArray(Seville, false, false); cntMarker += Seville.length; map.addOverlays(Sharon_Center); centerByArray(Sharon_Center, false, false); cntMarker += Sharon_Center.length; map.addOverlays(Spencer); centerByArray(Spencer, false, false); cntMarker += Spencer.length; map.addOverlays(Wadsworth); centerByArray(Wadsworth, false, false); cntMarker += Wadsworth.length; map.addOverlays(Westfield_Center); centerByArray(Westfield_Center, false, false); cntMarker += Westfield_Center.length; centerByArray(Brunswick,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'); } }