function addMarkers() { mySelect = document.getElementById('selection'); South_Webster = [];Portsmouth = [];New_Boston = [];Franklin_Furnace = [];Sciotoville = [];Minford = [];Mc_Dermott = [];West_Portsmouth = [];Lucasville = [];Wheelersburg = [];mySelect.options[mySelect.options.length] = new Option("Franklin Furnace schools",'all=Franklin_Furnace'); mySelect.options[mySelect.options.length] = new Option("Lucasville schools",'all=Lucasville'); mySelect.options[mySelect.options.length] = new Option("Mc Dermott schools",'all=Mc_Dermott'); mySelect.options[mySelect.options.length] = new Option("Minford schools",'all=Minford'); mySelect.options[mySelect.options.length] = new Option("New Boston schools",'all=New_Boston'); mySelect.options[mySelect.options.length] = new Option("Portsmouth schools",'all=Portsmouth'); mySelect.options[mySelect.options.length] = new Option("Sciotoville schools",'all=Sciotoville'); mySelect.options[mySelect.options.length] = new Option("South Webster schools",'all=South_Webster'); mySelect.options[mySelect.options.length] = new Option("West Portsmouth schools",'all=West_Portsmouth'); mySelect.options[mySelect.options.length] = new Option("Wheelersburg schools",'all=Wheelersburg'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); South_Webster[South_Webster.length] = createMarker(new GPoint(-82.72229767,38.81610107),"
Bloom-vernon Elementary School
Po Box 479
South Webster, OH 45682

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bloom-vernon Elementary School",'South_Webster=' + South_Webster.length); Portsmouth[Portsmouth.length] = createMarker(new GPoint(-82.98238373,38.80441666),"
Clay High School
44 Clay High St
Portsmouth, OH 45662

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clay High School",'Portsmouth=' + Portsmouth.length); New_Boston[New_Boston.length] = createMarker(new GPoint(-82.93576813,38.75428391),"
Glenwood High School
522 Glenwood Ave
New Boston, OH 45662

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Glenwood High School",'New_Boston=' + New_Boston.length); Franklin_Furnace[Franklin_Furnace.length] = createMarker(new GPoint(-82.84530640,38.61716461),"
Green Elementary School
46 Braunlin Rd
Franklin Furnace, OH 45629

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Green Elementary School",'Franklin_Furnace=' + Franklin_Furnace.length); Franklin_Furnace[Franklin_Furnace.length] = createMarker(new GPoint(-82.84273529,38.61725998),"
Green High School
4057 Gallia Pike
Franklin Furnace, OH 45629

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Green High School",'Franklin_Furnace=' + Franklin_Furnace.length); Franklin_Furnace[Franklin_Furnace.length] = createMarker(new GPoint(-82.84530640,38.61716461),"
Green Primary Elementary School
535 Junior Furnace Powellsvill
Franklin Furnace, OH 45629

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Green Primary Elementary School",'Franklin_Furnace=' + Franklin_Furnace.length); Sciotoville[Sciotoville.length] = createMarker(new GPoint(-82.88401794,38.76757050),"
Harding Elementary School
5929 Harding Ave
Sciotoville, OH 45662

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Harding Elementary School",'Sciotoville=' + Sciotoville.length); Portsmouth[Portsmouth.length] = createMarker(new GPoint(-82.97837830,38.74270248),"
Highland Elementary School
1511 Hutchins St
Portsmouth, OH 45662

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Highland Elementary School",'Portsmouth=' + Portsmouth.length); Portsmouth[Portsmouth.length] = createMarker(new GPoint(-82.98974609,38.74710846),"
Lincoln Elementary School
1121 Kinneys Ln
Portsmouth, OH 45662

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Portsmouth=' + Portsmouth.length); Portsmouth[Portsmouth.length] = createMarker(new GPoint(-82.97883606,38.74770355),"
Mckinley Elementary School
1729 Kinneys Ln
Portsmouth, OH 45662

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Portsmouth=' + Portsmouth.length); Minford[Minford.length] = createMarker(new GPoint(-82.85874900,38.86041800),"
Minford High School
Po Box 204
Minford, OH 45653

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Minford High School",'Minford=' + Minford.length); Minford[Minford.length] = createMarker(new GPoint(-82.84269714,38.87730026),"
Minford Middle School
Po Box 204
Minford, OH 45653

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Minford Middle School",'Minford=' + Minford.length); Minford[Minford.length] = createMarker(new GPoint(-82.84269714,38.87730026),"
Minford Primary Elementary School
Po Box 204
Minford, OH 45653

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Minford Primary Elementary School",'Minford=' + Minford.length); Mc_Dermott[Mc_Dermott.length] = createMarker(new GPoint(-83.08438873,38.87717056),"
Northwest Elementary School
4738 Henley Deemer Rd
Mc Dermott, OH 45652

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northwest Elementary School",'Mc_Dermott=' + Mc_Dermott.length); Mc_Dermott[Mc_Dermott.length] = createMarker(new GPoint(-83.08161926,38.87908173),"
Northwest High School
914 Mohawk Dr
Mc Dermott, OH 45652

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northwest High School",'Mc_Dermott=' + Mc_Dermott.length); Mc_Dermott[Mc_Dermott.length] = createMarker(new GPoint(-83.08484650,38.88097382),"
Northwest Middle School
692 Mohawk Dr
Mc Dermott, OH 45652

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Northwest Middle School",'Mc_Dermott=' + Mc_Dermott.length); New_Boston[New_Boston.length] = createMarker(new GPoint(-82.93289185,38.75811386),"
Oak Intermediate Elementary School
824 Harrisonville Ave
New Boston, OH 45662

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Oak Intermediate Elementary School",'New_Boston=' + New_Boston.length); Portsmouth[Portsmouth.length] = createMarker(new GPoint(-82.99047852,38.73464966),"
Portsmouth High School
1149 Gallia St
Portsmouth, OH 45662

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Portsmouth High School",'Portsmouth=' + Portsmouth.length); West_Portsmouth[West_Portsmouth.length] = createMarker(new GPoint(-83.05095673,38.71837997),"
Portsmouth West Elementary School
15332a Us Highway 52
West Portsmouth, OH 45663

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Portsmouth West Elementary School",'West_Portsmouth=' + West_Portsmouth.length); West_Portsmouth[West_Portsmouth.length] = createMarker(new GPoint(-83.05095673,38.71837997),"
Portsmouth West High School
15332 Us Highway 52
West Portsmouth, OH 45663

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Portsmouth West High School",'West_Portsmouth=' + West_Portsmouth.length); West_Portsmouth[West_Portsmouth.length] = createMarker(new GPoint(-83.03607178,38.75967026),"
Portsmouth West Middle School
1420 13th St
West Portsmouth, OH 45663

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Portsmouth West Middle School",'West_Portsmouth=' + West_Portsmouth.length); Portsmouth[Portsmouth.length] = createMarker(new GPoint(-82.98230743,38.75893784),"
Roosevelt Elementary School
1409 Coles Blvd
Portsmouth, OH 45662

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Portsmouth=' + Portsmouth.length); Portsmouth[Portsmouth.length] = createMarker(new GPoint(-82.97315216,38.78620911),"
Rosemount Elementary School
4484 Rose Valley Rd
Portsmouth, OH 45662

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rosemount Elementary School",'Portsmouth=' + Portsmouth.length); Portsmouth[Portsmouth.length] = createMarker(new GPoint(-82.93980408,38.82012558),"
Rubyville Elementary School
3019 Maple Benner Rd
Portsmouth, OH 45662

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rubyville Elementary School",'Portsmouth=' + Portsmouth.length); Lucasville[Lucasville.length] = createMarker(new GPoint(-82.97811890,38.85472870),"
Scioto County High School
951 Vern Riffe Dr
Lucasville, OH 45648

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Scioto County High School",'Lucasville=' + Lucasville.length); Portsmouth[Portsmouth.length] = createMarker(new GPoint(-82.88919067,38.75790024),"
Sciotoville High School
224 Marshall St
Portsmouth, OH 45662

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sciotoville High School",'Portsmouth=' + Portsmouth.length); South_Webster[South_Webster.length] = createMarker(new GPoint(-82.72666200,38.81347000),"
South Webster Jr/sr High School
Po Box 100
South Webster, OH 45682

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Webster Jr/sr High School",'South_Webster=' + South_Webster.length); New_Boston[New_Boston.length] = createMarker(new GPoint(-82.93927002,38.74903107),"
Stanton Primary Elementary School
3800 Stanton Ave
New Boston, OH 45662

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stanton Primary Elementary School",'New_Boston=' + New_Boston.length); Franklin_Furnace[Franklin_Furnace.length] = createMarker(new GPoint(-82.83180237,38.64450073),"
Tecumseh (orvjcf)
4696 Gallia Pike
Franklin Furnace, OH 45629

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tecumseh (orvjcf)",'Franklin_Furnace=' + Franklin_Furnace.length); Portsmouth[Portsmouth.length] = createMarker(new GPoint(-82.98899078,38.73310852),"
U S Grant Middle School
1149 Gallia St
Portsmouth, OH 45662

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("U S Grant Middle School",'Portsmouth=' + Portsmouth.length); Lucasville[Lucasville.length] = createMarker(new GPoint(-82.99269867,38.88539886),"
Valley Elementary School
1821a State Route 728
Lucasville, OH 45648

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Valley Elementary School",'Lucasville=' + Lucasville.length); Lucasville[Lucasville.length] = createMarker(new GPoint(-82.99269867,38.88539886),"
Valley High School
1821 State Route 728
Lucasville, OH 45648

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valley High School",'Lucasville=' + Lucasville.length); Lucasville[Lucasville.length] = createMarker(new GPoint(-82.97872925,38.88038254),"
Valley Middle School
393 Indian Dr
Lucasville, OH 45648

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Valley Middle School",'Lucasville=' + Lucasville.length); Wheelersburg[Wheelersburg.length] = createMarker(new GPoint(-82.83776093,38.74088669),"
Wheelersburg Elementary School
1731 Dogwood Ridge Rd
Wheelersburg, OH 45694

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wheelersburg Elementary School",'Wheelersburg=' + Wheelersburg.length); Wheelersburg[Wheelersburg.length] = createMarker(new GPoint(-82.85309601,38.72553635),"
Wheelersburg High School
701 Pirate Dr
Wheelersburg, OH 45694

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wheelersburg High School",'Wheelersburg=' + Wheelersburg.length); Wheelersburg[Wheelersburg.length] = createMarker(new GPoint(-82.83776093,38.74088669),"
Wheelersburg Middle School
1731 Dogwood Ridge Rd
Wheelersburg, OH 45694

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Wheelersburg Middle School",'Wheelersburg=' + Wheelersburg.length); Portsmouth[Portsmouth.length] = createMarker(new GPoint(-82.97757721,38.73460770),"
Wilson Elementary School
613 Campbell Ave
Portsmouth, OH 45662

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wilson Elementary School",'Portsmouth=' + Portsmouth.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(Franklin_Furnace); map.removeOverlays(Lucasville); map.removeOverlays(Mc_Dermott); map.removeOverlays(Minford); map.removeOverlays(New_Boston); map.removeOverlays(Portsmouth); map.removeOverlays(Sciotoville); map.removeOverlays(South_Webster); map.removeOverlays(West_Portsmouth); map.removeOverlays(Wheelersburg); 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(South_Webster);map.removeOverlays(Franklin_Furnace); map.removeOverlays(Lucasville); map.removeOverlays(Mc_Dermott); map.removeOverlays(Minford); map.removeOverlays(New_Boston); map.removeOverlays(Portsmouth); map.removeOverlays(Sciotoville); map.removeOverlays(South_Webster); map.removeOverlays(West_Portsmouth); map.removeOverlays(Wheelersburg); map.addOverlays(Franklin_Furnace); centerByArray(Franklin_Furnace, false, false); cntMarker += Franklin_Furnace.length; map.addOverlays(Lucasville); centerByArray(Lucasville, false, false); cntMarker += Lucasville.length; map.addOverlays(Mc_Dermott); centerByArray(Mc_Dermott, false, false); cntMarker += Mc_Dermott.length; map.addOverlays(Minford); centerByArray(Minford, false, false); cntMarker += Minford.length; map.addOverlays(New_Boston); centerByArray(New_Boston, false, false); cntMarker += New_Boston.length; map.addOverlays(Portsmouth); centerByArray(Portsmouth, false, false); cntMarker += Portsmouth.length; map.addOverlays(Sciotoville); centerByArray(Sciotoville, false, false); cntMarker += Sciotoville.length; map.addOverlays(South_Webster); centerByArray(South_Webster, false, false); cntMarker += South_Webster.length; map.addOverlays(West_Portsmouth); centerByArray(West_Portsmouth, false, false); cntMarker += West_Portsmouth.length; map.addOverlays(Wheelersburg); centerByArray(Wheelersburg, false, false); cntMarker += Wheelersburg.length; centerByArray(South_Webster,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'); } }