function addMarkers() { mySelect = document.getElementById('selection'); Amanda = [];Sugar_Grove = [];Lithopolis = [];Carroll = [];Bremen = [];Lancaster = [];Pickerington = [];West_Rushville = [];Baltimore = [];Millersport = [];Pleasantville = [];Rushville = [];Reynoldsburg = [];mySelect.options[mySelect.options.length] = new Option("Amanda schools",'all=Amanda'); mySelect.options[mySelect.options.length] = new Option("Baltimore schools",'all=Baltimore'); mySelect.options[mySelect.options.length] = new Option("Bremen schools",'all=Bremen'); mySelect.options[mySelect.options.length] = new Option("Carroll schools",'all=Carroll'); mySelect.options[mySelect.options.length] = new Option("Lancaster schools",'all=Lancaster'); mySelect.options[mySelect.options.length] = new Option("Lithopolis schools",'all=Lithopolis'); mySelect.options[mySelect.options.length] = new Option("Millersport schools",'all=Millersport'); mySelect.options[mySelect.options.length] = new Option("Pickerington schools",'all=Pickerington'); mySelect.options[mySelect.options.length] = new Option("Pleasantville schools",'all=Pleasantville'); mySelect.options[mySelect.options.length] = new Option("Reynoldsburg schools",'all=Reynoldsburg'); mySelect.options[mySelect.options.length] = new Option("Rushville schools",'all=Rushville'); mySelect.options[mySelect.options.length] = new Option("Sugar Grove schools",'all=Sugar_Grove'); mySelect.options[mySelect.options.length] = new Option("West Rushville schools",'all=West_Rushville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Amanda[Amanda.length] = createMarker(new GPoint(-82.74119568,39.65164566),"
Amanda Clearcreek Digital Admy
414 N School St
Amanda, OH 43102

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Amanda Clearcreek Digital Admy",'Amanda=' + Amanda.length); Amanda[Amanda.length] = createMarker(new GPoint(-82.73845673,39.64858246),"
Amanda-clearcreek Elementary School
328 E Main St
Amanda, OH 43102

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Amanda-clearcreek Elementary School",'Amanda=' + Amanda.length); Amanda[Amanda.length] = createMarker(new GPoint(-82.73845673,39.64858246),"
Amanda-clearcreek High School
328 E Main St
Amanda, OH 43102

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Amanda-clearcreek High School",'Amanda=' + Amanda.length); Amanda[Amanda.length] = createMarker(new GPoint(-82.73845673,39.64858246),"
Amanda-clearcreek Junior High School
328 E Main St
Amanda, OH 43102

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Amanda-clearcreek Junior High School",'Amanda=' + Amanda.length); Amanda[Amanda.length] = createMarker(new GPoint(-82.73845673,39.64858246),"
Amanda-clearcreek Primary School
414 N School St
Amanda, OH 43102

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Amanda-clearcreek Primary School",'Amanda=' + Amanda.length); Sugar_Grove[Sugar_Grove.length] = createMarker(new GPoint(-82.54792023,39.62897491),"
Berne Union Elementary School
506 N Main St
Sugar Grove, OH 43155

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Berne Union Elementary School",'Sugar_Grove=' + Sugar_Grove.length); Sugar_Grove[Sugar_Grove.length] = createMarker(new GPoint(-82.54792023,39.62897491),"
Berne Union High School
506 N Main St
Sugar Grove, OH 43155

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Berne Union High School",'Sugar_Grove=' + Sugar_Grove.length); Sugar_Grove[Sugar_Grove.length] = createMarker(new GPoint(-82.54792023,39.62897491),"
Berne Union Middle School
506 N Main St
Sugar Grove, OH 43155

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Berne Union Middle School",'Sugar_Grove=' + Sugar_Grove.length); Lithopolis[Lithopolis.length] = createMarker(new GPoint(-82.80629730,39.80270004),"
Bloom Elementary School
Po Box 208
Lithopolis, OH 43136

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bloom Elementary School",'Lithopolis=' + Lithopolis.length); Carroll[Carroll.length] = createMarker(new GPoint(-82.70770264,39.79769897),"
Bloom-carroll Digital Academy
Po Box 338
Carroll, OH 43112

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bloom-carroll Digital Academy",'Carroll=' + Carroll.length); Carroll[Carroll.length] = createMarker(new GPoint(-82.69946289,39.80007172),"
Bloom-carroll High School
5240 Plum Road Nw
Carroll, OH 43112

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bloom-carroll High School",'Carroll=' + Carroll.length); Carroll[Carroll.length] = createMarker(new GPoint(-82.69946289,39.80007172),"
Bloom-carroll Middle School
69 S Beaver Street
Carroll, OH 43112

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bloom-carroll Middle School",'Carroll=' + Carroll.length); Bremen[Bremen.length] = createMarker(new GPoint(-82.43403625,39.70046616),"
Bremen Elementary School
210 Strayer Ave
Bremen, OH 43107

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bremen Elementary School",'Bremen=' + Bremen.length); Carroll[Carroll.length] = createMarker(new GPoint(-82.69946289,39.80007172),"
Carroll Elementary School
69 S Beaver Street
Carroll, OH 43112

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carroll Elementary School",'Carroll=' + Carroll.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.62371063,39.71424103),"
Cedar Heights Elementary School
1515 Cedar Hill Rd
Lancaster, OH 43130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cedar Heights Elementary School",'Lancaster=' + Lancaster.length); Pickerington[Pickerington.length] = createMarker(new GPoint(-82.77636719,39.87801743),"
Diley Middle School
750 Preston Trails Dr
Pickerington, OH 43147

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Diley Middle School",'Pickerington=' + Pickerington.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.58552551,39.71472931),"
East Elementary School
751 E Wheeling St
Lancaster, OH 43130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Elementary School",'Lancaster=' + Lancaster.length); Carroll[Carroll.length] = createMarker(new GPoint(-82.67603302,39.76589203),"
Fairfield Career Center
4000 Columbus Lancaster Rd Nw
Carroll, OH 43112

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fairfield Career Center",'Carroll=' + Carroll.length); Pickerington[Pickerington.length] = createMarker(new GPoint(-82.77074432,39.92467880),"
Fairfield Elementary School
13000 Coventry Ave
Pickerington, OH 43147

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairfield Elementary School",'Pickerington=' + Pickerington.length); West_Rushville[West_Rushville.length] = createMarker(new GPoint(-82.41149902,39.76789856),"
Fairfield Union Digital Admy
Po Box 67
West Rushville, OH 43163

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fairfield Union Digital Admy",'West_Rushville=' + West_Rushville.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.60328900,39.71375400),"
Fairfield Union High School
6401 Cincinnati Zanesville Rd
Lancaster, OH 43130

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fairfield Union High School",'Lancaster=' + Lancaster.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.47450256,39.75493240),"
Fairfield Union Junior High School
6401 Cincinnati Zanesville Rd
Lancaster, OH 43130

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fairfield Union Junior High School",'Lancaster=' + Lancaster.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.61416626,39.71779251),"
General Sherman Junior High School
701 Union St
Lancaster, OH 43130

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("General Sherman Junior High School",'Lancaster=' + Lancaster.length); Pickerington[Pickerington.length] = createMarker(new GPoint(-82.76531982,39.91502380),"
Harmon Middle School
12410 Harmon Rd
Pickerington, OH 43147

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Harmon Middle School",'Pickerington=' + Pickerington.length); Pickerington[Pickerington.length] = createMarker(new GPoint(-82.75079346,39.88581467),"
Heritage Elementary School
100 N East St
Pickerington, OH 43147

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Heritage Elementary School",'Pickerington=' + Pickerington.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.60218048,39.71345139),"
Lancaster Digital Academy
111 S Broad St
Lancaster, OH 43130

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lancaster Digital Academy",'Lancaster=' + Lancaster.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.59758100,39.70987800),"
Lancaster Fairfield Alternative School
320 E Locust St
Lancaster, OH 43130

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lancaster Fairfield Alternative School",'Lancaster=' + Lancaster.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.59079742,39.73218155),"
Lancaster High School & Stanbery Campus High Schoo
1312 Granville Pike
Lancaster, OH 43130

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lancaster High School & Stanbery Campus High Schoo",'Lancaster=' + Lancaster.length); Baltimore[Baltimore.length] = createMarker(new GPoint(-82.60520935,39.83649063),"
Liberty Union Elementary School
1000 S Main St
Baltimore, OH 43105

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liberty Union Elementary School",'Baltimore=' + Baltimore.length); Baltimore[Baltimore.length] = createMarker(new GPoint(-82.60677338,39.84673691),"
Liberty Union High School
500 W Washington St
Baltimore, OH 43105

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Liberty Union High School",'Baltimore=' + Baltimore.length); Baltimore[Baltimore.length] = createMarker(new GPoint(-82.60806274,39.84675217),"
Liberty Union Middle School
600 W Washington St
Baltimore, OH 43105

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Liberty Union Middle School",'Baltimore=' + Baltimore.length); Baltimore[Baltimore.length] = createMarker(new GPoint(-82.60831451,39.84649658),"
Liberty Union Thurston Digital
621 W Washington St
Baltimore, OH 43105

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Liberty Union Thurston Digital",'Baltimore=' + Baltimore.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.57022858,39.72771072),"
Medill Elementary School
1151 James Rd
Lancaster, OH 43130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Medill Elementary School",'Lancaster=' + Lancaster.length); Millersport[Millersport.length] = createMarker(new GPoint(-82.53170013,39.90459824),"
Millersport Elementary School
Po Box 278
Millersport, OH 43046

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Millersport Elementary School",'Millersport=' + Millersport.length); Millersport[Millersport.length] = createMarker(new GPoint(-82.53170013,39.90459824),"
Millersport Jr/sr High School
Po Box 278
Millersport, OH 43046

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Millersport Jr/sr High School",'Millersport=' + Millersport.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.60166931,39.72143173),"
North Elementary School
710 N Broad St
Lancaster, OH 43130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Elementary School",'Lancaster=' + Lancaster.length); Pickerington[Pickerington.length] = createMarker(new GPoint(-82.77634430,39.88970947),"
Pickerington Elementary School
775 Long Rd
Pickerington, OH 43147

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pickerington Elementary School",'Pickerington=' + Pickerington.length); Pickerington[Pickerington.length] = createMarker(new GPoint(-82.75435638,39.87396240),"
Pickerington High School Central
300 Opportunity Way
Pickerington, OH 43147

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pickerington High School Central",'Pickerington=' + Pickerington.length); Pickerington[Pickerington.length] = createMarker(new GPoint(-82.73323059,39.90756989),"
Pickerington High School North
7800 Refugee Rd
Pickerington, OH 43147

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pickerington High School North",'Pickerington=' + Pickerington.length); Pickerington[Pickerington.length] = createMarker(new GPoint(-82.72777557,39.91474533),"
Pickerington Lakeview Junior High School
12445 Ault Rd
Pickerington, OH 43147

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pickerington Lakeview Junior High School",'Pickerington=' + Pickerington.length); Pickerington[Pickerington.length] = createMarker(new GPoint(-82.75907898,39.88114166),"
Pickerington Ridgeview Junior High School
130 Hill Rd S
Pickerington, OH 43147

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pickerington Ridgeview Junior High School",'Pickerington=' + Pickerington.length); Pleasantville[Pleasantville.length] = createMarker(new GPoint(-82.52180481,39.80781174),"
Pleasantville Elementary School
225 Lincoln Ave
Pleasantville, OH 43148

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasantville Elementary School",'Pleasantville=' + Pleasantville.length); Rushville[Rushville.length] = createMarker(new GPoint(-82.43757629,39.76367950),"
Rushville Middle School
8155 Rushville Rd Ne
Rushville, OH 43150

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rushville Middle School",'Rushville=' + Rushville.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.48287964,39.71295929),"
Sanderson Elementary School
1450 Marietta Rd Ne
Lancaster, OH 43130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sanderson Elementary School",'Lancaster=' + Lancaster.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.59913635,39.71116638),"
South Elementary School
220 E Walnut St
Lancaster, OH 43130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Elementary School",'Lancaster=' + Lancaster.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.61267853,39.70570374),"
Tallmadge Elementary School
611 Lewis Ave
Lancaster, OH 43130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tallmadge Elementary School",'Lancaster=' + Lancaster.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.62173462,39.74170303),"
Tarhe Elementary School
425 Whittier Dr N
Lancaster, OH 43130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tarhe Elementary School",'Lancaster=' + Lancaster.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.58500671,39.72331619),"
Thomas Ewing Junior High School
825 E Fair Ave
Lancaster, OH 43130

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Thomas Ewing Junior High School",'Lancaster=' + Lancaster.length); Reynoldsburg[Reynoldsburg.length] = createMarker(new GPoint(-82.80986786,39.92622757),"
Tussing Elementary School
7117 Tussing Rd
Reynoldsburg, OH 43068

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tussing Elementary School",'Reynoldsburg=' + Reynoldsburg.length); Pickerington[Pickerington.length] = createMarker(new GPoint(-82.75505829,39.90836716),"
Violet Elementary School
8855 Education Dr
Pickerington, OH 43147

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Violet Elementary School",'Pickerington=' + Pickerington.length); Millersport[Millersport.length] = createMarker(new GPoint(-82.53491974,39.89629745),"
Walnut Twp Digital Academy
11850 Lancaster Street
Millersport, OH 43046

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Walnut Twp Digital Academy",'Millersport=' + Millersport.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.61749268,39.72061157),"
West Elementary School
625 Garfield Ave
Lancaster, OH 43130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Elementary School",'Lancaster=' + Lancaster.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(Amanda); map.removeOverlays(Baltimore); map.removeOverlays(Bremen); map.removeOverlays(Carroll); map.removeOverlays(Lancaster); map.removeOverlays(Lithopolis); map.removeOverlays(Millersport); map.removeOverlays(Pickerington); map.removeOverlays(Pleasantville); map.removeOverlays(Reynoldsburg); map.removeOverlays(Rushville); map.removeOverlays(Sugar_Grove); map.removeOverlays(West_Rushville); 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(Amanda);map.removeOverlays(Amanda); map.removeOverlays(Baltimore); map.removeOverlays(Bremen); map.removeOverlays(Carroll); map.removeOverlays(Lancaster); map.removeOverlays(Lithopolis); map.removeOverlays(Millersport); map.removeOverlays(Pickerington); map.removeOverlays(Pleasantville); map.removeOverlays(Reynoldsburg); map.removeOverlays(Rushville); map.removeOverlays(Sugar_Grove); map.removeOverlays(West_Rushville); map.addOverlays(Amanda); centerByArray(Amanda, false, false); cntMarker += Amanda.length; map.addOverlays(Baltimore); centerByArray(Baltimore, false, false); cntMarker += Baltimore.length; map.addOverlays(Bremen); centerByArray(Bremen, false, false); cntMarker += Bremen.length; map.addOverlays(Carroll); centerByArray(Carroll, false, false); cntMarker += Carroll.length; map.addOverlays(Lancaster); centerByArray(Lancaster, false, false); cntMarker += Lancaster.length; map.addOverlays(Lithopolis); centerByArray(Lithopolis, false, false); cntMarker += Lithopolis.length; map.addOverlays(Millersport); centerByArray(Millersport, false, false); cntMarker += Millersport.length; map.addOverlays(Pickerington); centerByArray(Pickerington, false, false); cntMarker += Pickerington.length; map.addOverlays(Pleasantville); centerByArray(Pleasantville, false, false); cntMarker += Pleasantville.length; map.addOverlays(Reynoldsburg); centerByArray(Reynoldsburg, false, false); cntMarker += Reynoldsburg.length; map.addOverlays(Rushville); centerByArray(Rushville, false, false); cntMarker += Rushville.length; map.addOverlays(Sugar_Grove); centerByArray(Sugar_Grove, false, false); cntMarker += Sugar_Grove.length; map.addOverlays(West_Rushville); centerByArray(West_Rushville, false, false); cntMarker += West_Rushville.length; centerByArray(Amanda,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'); } }