function addMarkers() { mySelect = document.getElementById('selection'); Lewis_Center = [];Sunbury = [];Ashley = [];Delaware = [];Radnor = [];Ostrander = [];Dublin = [];Galena = [];Powell = [];Westerville = [];mySelect.options[mySelect.options.length] = new Option("Ashley schools",'all=Ashley'); mySelect.options[mySelect.options.length] = new Option("Delaware schools",'all=Delaware'); mySelect.options[mySelect.options.length] = new Option("Dublin schools",'all=Dublin'); mySelect.options[mySelect.options.length] = new Option("Galena schools",'all=Galena'); mySelect.options[mySelect.options.length] = new Option("Lewis Center schools",'all=Lewis_Center'); mySelect.options[mySelect.options.length] = new Option("Ostrander schools",'all=Ostrander'); mySelect.options[mySelect.options.length] = new Option("Powell schools",'all=Powell'); mySelect.options[mySelect.options.length] = new Option("Radnor schools",'all=Radnor'); mySelect.options[mySelect.options.length] = new Option("Sunbury schools",'all=Sunbury'); mySelect.options[mySelect.options.length] = new Option("Westerville schools",'all=Westerville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Lewis_Center[Lewis_Center.length] = createMarker(new GPoint(-82.99207306,40.18921280),"
Alum Creek Elementary School
2515 Parklawn Dr
Lewis Center, OH 43035

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Alum Creek Elementary School",'Lewis_Center=' + Lewis_Center.length); Lewis_Center[Lewis_Center.length] = createMarker(new GPoint(-83.00569916,40.21729660),"
Arrowhead Elementary School
2385 Hollenback Rd
Lewis Center, OH 43035

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arrowhead Elementary School",'Lewis_Center=' + Lewis_Center.length); Sunbury[Sunbury.length] = createMarker(new GPoint(-82.86443329,40.23270035),"
Big Walnut Elementary School
940 S Old 3c Rd
Sunbury, OH 43074

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Big Walnut Elementary School",'Sunbury=' + Sunbury.length); Sunbury[Sunbury.length] = createMarker(new GPoint(-82.85369873,40.26250076),"
Big Walnut High School
Po Box 5001
Sunbury, OH 43074

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Big Walnut High School",'Sunbury=' + Sunbury.length); Sunbury[Sunbury.length] = createMarker(new GPoint(-82.85369873,40.26250076),"
Big Walnut Middle School
Po Box 5002
Sunbury, OH 43074

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Big Walnut Middle School",'Sunbury=' + Sunbury.length); Ashley[Ashley.length] = createMarker(new GPoint(-82.96499634,40.41170120),"
Buckeye Valley East Elementary School
Po Box 356
Ashley, OH 43003

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buckeye Valley East Elementary School",'Ashley=' + Ashley.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.09247589,40.35038376),"
Buckeye Valley Local High School
901 Coover Rd
Delaware, OH 43015

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Buckeye Valley Local High School",'Delaware=' + Delaware.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.08804321,40.35018539),"
Buckeye Valley Local Middle School
683 Coover Rd
Delaware, OH 43015

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Buckeye Valley Local Middle School",'Delaware=' + Delaware.length); Radnor[Radnor.length] = createMarker(new GPoint(-83.14929199,40.38084412),"
Buckeye Valley North Elementary School
4230 State Route 203
Radnor, OH 43066

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buckeye Valley North Elementary School",'Radnor=' + Radnor.length); Ostrander[Ostrander.length] = createMarker(new GPoint(-83.20269775,40.27429962),"
Buckeye Valley West Elementary School
Po Box 68
Ostrander, OH 43061

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buckeye Valley West Elementary School",'Ostrander=' + Ostrander.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.07206726,40.31005096),"
David Smith Elementary School
355 N Liberty St
Delaware, OH 43015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("David Smith Elementary School",'Delaware=' + Delaware.length); Dublin[Dublin.length] = createMarker(new GPoint(-83.16794586,40.14876175),"
Deer Run Elementary School
8815 Avery Rd
Dublin, OH 43017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Deer Run Elementary School",'Dublin=' + Dublin.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.02630615,40.30153656),"
Delaware Area Career Center North Campus
1610 State Route 521
Delaware, OH 43015

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Delaware Area Career Center North Campus",'Delaware=' + Delaware.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.04024506,40.23101044),"
Delaware Area Career Center South Campus
4565 Columbus Pike
Delaware, OH 43015

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Delaware Area Career Center South Campus",'Delaware=' + Delaware.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.04024506,40.23101044),"
Delaware South Campus Vocatio High School
4565 Columbus Pike
Delaware, OH 43015

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Delaware South Campus Vocatio High School",'Delaware=' + Delaware.length); Dublin[Dublin.length] = createMarker(new GPoint(-83.15386200,40.16100693),"
Eli Pinney Elementary School
9989 Concord Rd
Dublin, OH 43017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eli Pinney Elementary School",'Dublin=' + Dublin.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.06788635,40.29764175),"
Ervin Carlisle Elementary School
746 St Rt 37 W
Delaware, OH 43015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ervin Carlisle Elementary School",'Delaware=' + Delaware.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.07105255,40.29896927),"
Frank B Willis Intermediate Middle School
74 W William St
Delaware, OH 43015

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Frank B Willis Intermediate Middle School",'Delaware=' + Delaware.length); Lewis_Center[Lewis_Center.length] = createMarker(new GPoint(-83.00514500,40.17960000),"
Glen Oak Elementary School
7300 Blue Holly Dr
Lewis Center, OH 43035

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glen Oak Elementary School",'Lewis_Center=' + Lewis_Center.length); Sunbury[Sunbury.length] = createMarker(new GPoint(-82.85801697,40.24523544),"
Harrison Street Elementary School
70 Harrison St
Sunbury, OH 43074

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Harrison Street Elementary School",'Sunbury=' + Sunbury.length); Galena[Galena.length] = createMarker(new GPoint(-82.82609558,40.16920471),"
Hylen Souders Elementary School
4121 Miller Paul Rd
Galena, OH 43021

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hylen Souders Elementary School",'Galena=' + Galena.length); Powell[Powell.length] = createMarker(new GPoint(-83.10336304,40.19632721),"
Indian Springs Elementary School
3828 Home Rd
Powell, OH 43065

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Indian Springs Elementary School",'Powell=' + Powell.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.05477905,40.29969025),"
James Conger Elementary School
10 Channing St
Delaware, OH 43015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("James Conger Elementary School",'Delaware=' + Delaware.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.08803558,40.31355286),"
John C Dempsey Middle School
599 Pennsylvania Ave
Delaware, OH 43015

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("John C Dempsey Middle School",'Delaware=' + Delaware.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.07186890,40.29217529),"
Laura Woodward Elementary School
200 S Washington St
Delaware, OH 43015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Laura Woodward Elementary School",'Delaware=' + Delaware.length); Lewis_Center[Lewis_Center.length] = createMarker(new GPoint(-83.00441742,40.16663361),"
Oak Creek Elementary School
1256 Westwood Dr
Lewis Center, OH 43035

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak Creek Elementary School",'Lewis_Center=' + Lewis_Center.length); Lewis_Center[Lewis_Center.length] = createMarker(new GPoint(-83.02080536,40.20022202),"
Olentangy High School
675 Lewis Center Rd
Lewis Center, OH 43035

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Olentangy High School",'Lewis_Center=' + Lewis_Center.length); Powell[Powell.length] = createMarker(new GPoint(-83.09943390,40.19616699),"
Olentangy Liberty High School
3584 Home Rd
Powell, OH 43065

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Olentangy Liberty High School",'Powell=' + Powell.length); Powell[Powell.length] = createMarker(new GPoint(-83.07804871,40.18461227),"
Olentangy Liberty Middle School
7940 Liberty Rd N
Powell, OH 43065

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Olentangy Liberty Middle School",'Powell=' + Powell.length); Lewis_Center[Lewis_Center.length] = createMarker(new GPoint(-83.02141571,40.21322632),"
Olentangy Shanahan Middle School
814 Shanahan Rd
Lewis Center, OH 43035

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Olentangy Shanahan Middle School",'Lewis_Center=' + Lewis_Center.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.09419250,40.29810715),"
Robert F Schultz Elementary School
499 Applegate Ln
Delaware, OH 43015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robert F Schultz Elementary School",'Delaware=' + Delaware.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.07819366,40.31109238),"
Rutherford B Hayes High School
289 Euclid Ave
Delaware, OH 43015

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rutherford B Hayes High School",'Delaware=' + Delaware.length); Powell[Powell.length] = createMarker(new GPoint(-83.08513641,40.16244507),"
Scioto Ridge Elementary School
8715 Big Bear Ave
Powell, OH 43065

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Scioto Ridge Elementary School",'Powell=' + Powell.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.14214200,40.19612000),"
Scioto River (sjcf)
5993 Home Rd
Delaware, OH 43015

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Scioto River (sjcf)",'Delaware=' + Delaware.length); Lewis_Center[Lewis_Center.length] = createMarker(new GPoint(-83.02037048,40.21325684),"
Shanahan Elementary School
814 Shanahan Rd
Lewis Center, OH 43035

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shanahan Elementary School",'Lewis_Center=' + Lewis_Center.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.08912600,40.31270000),"
Technology Center Junior High School
621 Pennsylvania Ave
Delaware, OH 43015

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Technology Center Junior High School",'Delaware=' + Delaware.length); Lewis_Center[Lewis_Center.length] = createMarker(new GPoint(-82.99949646,40.17425919),"
Third Middle School Middle School
2680 E Orange Rd
Lewis Center, OH 43035

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Third Middle School Middle School",'Lewis_Center=' + Lewis_Center.length); Powell[Powell.length] = createMarker(new GPoint(-83.07754517,40.14524078),"
Tyler Run Elementary School
580 Salisbury Dr
Powell, OH 43065

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tyler Run Elementary School",'Powell=' + Powell.length); Galena[Galena.length] = createMarker(new GPoint(-82.93855286,40.18268585),"
Walnut Creek Elementary School
5600 Grand Oak Blvd
Galena, OH 43021

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Walnut Creek Elementary School",'Galena=' + Galena.length); Westerville[Westerville.length] = createMarker(new GPoint(-82.89736938,40.13201904),"
Westerville-north High School
950 County Line Rd
Westerville, OH 43081

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westerville-north High School",'Westerville=' + Westerville.length); Dublin[Dublin.length] = createMarker(new GPoint(-83.16502380,40.14710236),"
Willard Grizzell Middle School
8705 Avery Rd
Dublin, OH 43017

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Willard Grizzell Middle School",'Dublin=' + Dublin.length); Delaware[Delaware.length] = createMarker(new GPoint(-83.07392120,40.29249954),"
William K Willis (rjcf) High School
5993 Home Rd
Delaware, OH 43015

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("William K Willis (rjcf) High School",'Delaware=' + Delaware.length); Powell[Powell.length] = createMarker(new GPoint(-83.07817841,40.18213654),"
Wyandot Run Elementary School
2800 Carriage Rd
Powell, OH 43065

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wyandot Run Elementary School",'Powell=' + Powell.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(Ashley); map.removeOverlays(Delaware); map.removeOverlays(Dublin); map.removeOverlays(Galena); map.removeOverlays(Lewis_Center); map.removeOverlays(Ostrander); map.removeOverlays(Powell); map.removeOverlays(Radnor); map.removeOverlays(Sunbury); map.removeOverlays(Westerville); 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(Lewis_Center);map.removeOverlays(Ashley); map.removeOverlays(Delaware); map.removeOverlays(Dublin); map.removeOverlays(Galena); map.removeOverlays(Lewis_Center); map.removeOverlays(Ostrander); map.removeOverlays(Powell); map.removeOverlays(Radnor); map.removeOverlays(Sunbury); map.removeOverlays(Westerville); map.addOverlays(Ashley); centerByArray(Ashley, false, false); cntMarker += Ashley.length; map.addOverlays(Delaware); centerByArray(Delaware, false, false); cntMarker += Delaware.length; map.addOverlays(Dublin); centerByArray(Dublin, false, false); cntMarker += Dublin.length; map.addOverlays(Galena); centerByArray(Galena, false, false); cntMarker += Galena.length; map.addOverlays(Lewis_Center); centerByArray(Lewis_Center, false, false); cntMarker += Lewis_Center.length; map.addOverlays(Ostrander); centerByArray(Ostrander, false, false); cntMarker += Ostrander.length; map.addOverlays(Powell); centerByArray(Powell, false, false); cntMarker += Powell.length; map.addOverlays(Radnor); centerByArray(Radnor, false, false); cntMarker += Radnor.length; map.addOverlays(Sunbury); centerByArray(Sunbury, false, false); cntMarker += Sunbury.length; map.addOverlays(Westerville); centerByArray(Westerville, false, false); cntMarker += Westerville.length; centerByArray(Lewis_Center,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'); } }