function addMarkers() { mySelect = document.getElementById('selection'); Wintersville = [];Rayland = [];Brilliant = [];Yorkville = [];Tiltonsville = [];Adena = [];Steubenville = [];Richmond = [];Mingo_Junction = [];Irondale = [];Toronto = [];Bloomingdale = [];Bergholz = [];Hammondsville = [];mySelect.options[mySelect.options.length] = new Option("Adena schools",'all=Adena'); mySelect.options[mySelect.options.length] = new Option("Bergholz schools",'all=Bergholz'); mySelect.options[mySelect.options.length] = new Option("Bloomingdale schools",'all=Bloomingdale'); mySelect.options[mySelect.options.length] = new Option("Brilliant schools",'all=Brilliant'); mySelect.options[mySelect.options.length] = new Option("Hammondsville schools",'all=Hammondsville'); mySelect.options[mySelect.options.length] = new Option("Irondale schools",'all=Irondale'); mySelect.options[mySelect.options.length] = new Option("Mingo Junction schools",'all=Mingo_Junction'); mySelect.options[mySelect.options.length] = new Option("Rayland schools",'all=Rayland'); mySelect.options[mySelect.options.length] = new Option("Richmond schools",'all=Richmond'); mySelect.options[mySelect.options.length] = new Option("Steubenville schools",'all=Steubenville'); mySelect.options[mySelect.options.length] = new Option("Tiltonsville schools",'all=Tiltonsville'); mySelect.options[mySelect.options.length] = new Option("Toronto schools",'all=Toronto'); mySelect.options[mySelect.options.length] = new Option("Wintersville schools",'all=Wintersville'); mySelect.options[mySelect.options.length] = new Option("Yorkville schools",'all=Yorkville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Wintersville[Wintersville.length] = createMarker(new GPoint(-80.72299194,40.33446121),"
Bantam Ridge Elementary School
587 Bantam Ridge Rd
Wintersville, OH 43953

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bantam Ridge Elementary School",'Wintersville=' + Wintersville.length); Rayland[Rayland.length] = createMarker(new GPoint(-80.72216797,40.19104004),"
Buckeye Local High School
10692 State Route 150
Rayland, OH 43943

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Buckeye Local High School",'Rayland=' + Rayland.length); Brilliant[Brilliant.length] = createMarker(new GPoint(-80.63260651,40.26258469),"
Buckeye North Elementary School
1004 3rd St
Brilliant, OH 43913

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buckeye North Elementary School",'Brilliant=' + Brilliant.length); Brilliant[Brilliant.length] = createMarker(new GPoint(-80.63260651,40.26258469),"
Buckeye North Middle School
1004 3rd St
Brilliant, OH 43913

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Buckeye North Middle School",'Brilliant=' + Brilliant.length); Rayland[Rayland.length] = createMarker(new GPoint(-80.77399445,40.27215958),"
Buckeye Northwest Elementary School
680 Hill St
Rayland, OH 43943

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buckeye Northwest Elementary School",'Rayland=' + Rayland.length); Yorkville[Yorkville.length] = createMarker(new GPoint(-80.70746613,40.15780640),"
Buckeye South Elementary School
209 Market St
Yorkville, OH 43971

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buckeye South Elementary School",'Yorkville=' + Yorkville.length); Tiltonsville[Tiltonsville.length] = createMarker(new GPoint(-80.69766998,40.17078018),"
Buckeye Southwest Middle School
100 Walden Ave
Tiltonsville, OH 43963

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Buckeye Southwest Middle School",'Tiltonsville=' + Tiltonsville.length); Adena[Adena.length] = createMarker(new GPoint(-80.87220001,40.21879959),"
Buckeye West Elementary School
243 N Mill St
Adena, OH 43901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buckeye West Elementary School",'Adena=' + Adena.length); Steubenville[Steubenville.length] = createMarker(new GPoint(-80.66680145,40.37949753),"
Buena Vista Elementary School
3800 Schenley Ave
Steubenville, OH 43952

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buena Vista Elementary School",'Steubenville=' + Steubenville.length); Richmond[Richmond.length] = createMarker(new GPoint(-80.74273682,40.45159149),"
Edison High School
9890 State Route 152
Richmond, OH 43944

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Edison High School",'Richmond=' + Richmond.length); Steubenville[Steubenville.length] = createMarker(new GPoint(-80.61065674,40.37117386),"
Garfield Elementary School
936 N 5th St
Steubenville, OH 43952

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Steubenville=' + Steubenville.length); Steubenville[Steubenville.length] = createMarker(new GPoint(-80.63602448,40.36937714),"
Harding Middle School
2002 Sunset Blvd
Steubenville, OH 43952

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Harding Middle School",'Steubenville=' + Steubenville.length); Mingo_Junction[Mingo_Junction.length] = createMarker(new GPoint(-80.62085724,40.32631683),"
Hills Elementary School
707 Wilson Ave
Mingo Junction, OH 43938

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hills Elementary School",'Mingo_Junction=' + Mingo_Junction.length); Wintersville[Wintersville.length] = createMarker(new GPoint(-80.71386719,40.37697601),"
Indian Creek High School
200 Park Dr
Wintersville, OH 43953

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Indian Creek High School",'Wintersville=' + Wintersville.length); Mingo_Junction[Mingo_Junction.length] = createMarker(new GPoint(-80.60853577,40.31977463),"
Indian Creek Junior High School
110 Steuben St
Mingo Junction, OH 43938

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Indian Creek Junior High School",'Mingo_Junction=' + Mingo_Junction.length); Irondale[Irondale.length] = createMarker(new GPoint(-80.72834778,40.57136536),"
Irondale Elementary School
91 Rural Way
Irondale, OH 43932

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Irondale Elementary School",'Irondale=' + Irondale.length); Toronto[Toronto.length] = createMarker(new GPoint(-80.61304474,40.45527267),"
J T Karaffa Middle School
1307 Dennis Way
Toronto, OH 43964

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("J T Karaffa Middle School",'Toronto=' + Toronto.length); Bloomingdale[Bloomingdale.length] = createMarker(new GPoint(-80.76277924,40.35614014),"
Jefferson County High School
1509 County Highway 22a
Bloomingdale, OH 43910

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jefferson County High School",'Bloomingdale=' + Bloomingdale.length); Bergholz[Bergholz.length] = createMarker(new GPoint(-80.90048218,40.49676132),"
John E Gregg Elementary School
212 County Road 75a
Bergholz, OH 43908

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John E Gregg Elementary School",'Bergholz=' + Bergholz.length); Toronto[Toronto.length] = createMarker(new GPoint(-80.60072327,40.47791672),"
Lincoln Elementary School
1227 N River Ave
Toronto, OH 43964

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Toronto=' + Toronto.length); Steubenville[Steubenville.length] = createMarker(new GPoint(-80.62751007,40.34922028),"
Lincoln Elementary School
980 Lincoln Ave
Steubenville, OH 43952

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Steubenville=' + Steubenville.length); Steubenville[Steubenville.length] = createMarker(new GPoint(-80.63146210,40.36093903),"
Mckinley Elementary School
W Adams St
Steubenville, OH 43952

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Steubenville=' + Steubenville.length); Steubenville[Steubenville.length] = createMarker(new GPoint(-80.69984436,40.37330246),"
Pleasant Hill Elementary School
129 School St
Steubenville, OH 43952

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Hill Elementary School",'Steubenville=' + Steubenville.length); Richmond[Richmond.length] = createMarker(new GPoint(-80.76841736,40.42942429),"
Richmond Elementary School
210 S Park St
Richmond, OH 43944

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Richmond Elementary School",'Richmond=' + Richmond.length); Steubenville[Steubenville.length] = createMarker(new GPoint(-80.62304687,40.36560059),"
Roosevelt Elementary School
350 Belleview Blvd
Steubenville, OH 43952

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Steubenville=' + Steubenville.length); Toronto[Toronto.length] = createMarker(new GPoint(-80.61303711,40.45527649),"
S C Dennis Elementary School
1305 Dennis Way
Toronto, OH 43964

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("S C Dennis Elementary School",'Toronto=' + Toronto.length); Bergholz[Bergholz.length] = createMarker(new GPoint(-80.89485931,40.50397110),"
Springfield Middle School
4569 County Road 75
Bergholz, OH 43908

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Springfield Middle School",'Bergholz=' + Bergholz.length); Hammondsville[Hammondsville.length] = createMarker(new GPoint(-80.70919800,40.54962921),"
Stanton Middle School
14890 State Route 213
Hammondsville, OH 43930

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Stanton Middle School",'Hammondsville=' + Hammondsville.length); Steubenville[Steubenville.length] = createMarker(new GPoint(-80.61249542,40.36475372),"
Steubenville High School
420 N 4th St
Steubenville, OH 43952

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Steubenville High School",'Steubenville=' + Steubenville.length); Toronto[Toronto.length] = createMarker(new GPoint(-80.59970093,40.46926117),"
Toronto High School
300 Myers St
Toronto, OH 43964

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Toronto High School",'Toronto=' + Toronto.length); Bloomingdale[Bloomingdale.length] = createMarker(new GPoint(-80.82713318,40.33880615),"
Wayne Elementary School
5926 County Road 22a
Bloomingdale, OH 43910

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wayne Elementary School",'Bloomingdale=' + Bloomingdale.length); Steubenville[Steubenville.length] = createMarker(new GPoint(-80.61376953,40.36336136),"
Wells Elementary School
408 North St
Steubenville, OH 43952

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wells Elementary School",'Steubenville=' + Steubenville.length); Wintersville[Wintersville.length] = createMarker(new GPoint(-80.71321869,40.37583923),"
Wintersville Elementary School
100 Park Dr
Wintersville, OH 43953

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wintersville Elementary School",'Wintersville=' + Wintersville.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(Adena); map.removeOverlays(Bergholz); map.removeOverlays(Bloomingdale); map.removeOverlays(Brilliant); map.removeOverlays(Hammondsville); map.removeOverlays(Irondale); map.removeOverlays(Mingo_Junction); map.removeOverlays(Rayland); map.removeOverlays(Richmond); map.removeOverlays(Steubenville); map.removeOverlays(Tiltonsville); map.removeOverlays(Toronto); map.removeOverlays(Wintersville); map.removeOverlays(Yorkville); 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(Wintersville);map.removeOverlays(Adena); map.removeOverlays(Bergholz); map.removeOverlays(Bloomingdale); map.removeOverlays(Brilliant); map.removeOverlays(Hammondsville); map.removeOverlays(Irondale); map.removeOverlays(Mingo_Junction); map.removeOverlays(Rayland); map.removeOverlays(Richmond); map.removeOverlays(Steubenville); map.removeOverlays(Tiltonsville); map.removeOverlays(Toronto); map.removeOverlays(Wintersville); map.removeOverlays(Yorkville); map.addOverlays(Adena); centerByArray(Adena, false, false); cntMarker += Adena.length; map.addOverlays(Bergholz); centerByArray(Bergholz, false, false); cntMarker += Bergholz.length; map.addOverlays(Bloomingdale); centerByArray(Bloomingdale, false, false); cntMarker += Bloomingdale.length; map.addOverlays(Brilliant); centerByArray(Brilliant, false, false); cntMarker += Brilliant.length; map.addOverlays(Hammondsville); centerByArray(Hammondsville, false, false); cntMarker += Hammondsville.length; map.addOverlays(Irondale); centerByArray(Irondale, false, false); cntMarker += Irondale.length; map.addOverlays(Mingo_Junction); centerByArray(Mingo_Junction, false, false); cntMarker += Mingo_Junction.length; map.addOverlays(Rayland); centerByArray(Rayland, false, false); cntMarker += Rayland.length; map.addOverlays(Richmond); centerByArray(Richmond, false, false); cntMarker += Richmond.length; map.addOverlays(Steubenville); centerByArray(Steubenville, false, false); cntMarker += Steubenville.length; map.addOverlays(Tiltonsville); centerByArray(Tiltonsville, false, false); cntMarker += Tiltonsville.length; map.addOverlays(Toronto); centerByArray(Toronto, false, false); cntMarker += Toronto.length; map.addOverlays(Wintersville); centerByArray(Wintersville, false, false); cntMarker += Wintersville.length; map.addOverlays(Yorkville); centerByArray(Yorkville, false, false); cntMarker += Yorkville.length; centerByArray(Wintersville,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'); } }