function addMarkers() { mySelect = document.getElementById('selection'); Baltic = [];Bolivar = [];New_Philadelphia = [];Magnolia = [];Uhrichsville = [];Dennison = [];Dover = [];Dundee = [];Newcomerstown = [];Sugarcreek = [];Gnadenhutten = [];Tuscarawas = [];Midvale = [];Mineral_City = [];Port_Washington = [];Strasburg = [];Zoarville = [];mySelect.options[mySelect.options.length] = new Option("Baltic schools",'all=Baltic'); mySelect.options[mySelect.options.length] = new Option("Bolivar schools",'all=Bolivar'); mySelect.options[mySelect.options.length] = new Option("Dennison schools",'all=Dennison'); mySelect.options[mySelect.options.length] = new Option("Dover schools",'all=Dover'); mySelect.options[mySelect.options.length] = new Option("Dundee schools",'all=Dundee'); mySelect.options[mySelect.options.length] = new Option("Gnadenhutten schools",'all=Gnadenhutten'); mySelect.options[mySelect.options.length] = new Option("Magnolia schools",'all=Magnolia'); mySelect.options[mySelect.options.length] = new Option("Midvale schools",'all=Midvale'); mySelect.options[mySelect.options.length] = new Option("Mineral City schools",'all=Mineral_City'); mySelect.options[mySelect.options.length] = new Option("New Philadelphia schools",'all=New_Philadelphia'); mySelect.options[mySelect.options.length] = new Option("Newcomerstown schools",'all=Newcomerstown'); mySelect.options[mySelect.options.length] = new Option("Port Washington schools",'all=Port_Washington'); mySelect.options[mySelect.options.length] = new Option("Strasburg schools",'all=Strasburg'); mySelect.options[mySelect.options.length] = new Option("Sugarcreek schools",'all=Sugarcreek'); mySelect.options[mySelect.options.length] = new Option("Tuscarawas schools",'all=Tuscarawas'); mySelect.options[mySelect.options.length] = new Option("Uhrichsville schools",'all=Uhrichsville'); mySelect.options[mySelect.options.length] = new Option("Zoarville schools",'all=Zoarville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Baltic[Baltic.length] = createMarker(new GPoint(-81.70539856,40.44369888),"
Baltic Elementary School
Po Box 266
Baltic, OH 43804

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Baltic Elementary School",'Baltic=' + Baltic.length); Bolivar[Bolivar.length] = createMarker(new GPoint(-81.44920349,40.63639832),"
Bolivar Elementary School
Po Box 196
Bolivar, OH 44612

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bolivar Elementary School",'Bolivar=' + Bolivar.length); New_Philadelphia[New_Philadelphia.length] = createMarker(new GPoint(-81.40190125,40.46887589),"
Buckeye Career Center
545 University Dr Ne
New Philadelphia, OH 44663

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Buckeye Career Center",'New_Philadelphia=' + New_Philadelphia.length); Magnolia[Magnolia.length] = createMarker(new GPoint(-81.34852600,40.63856125),"
Cardinal Digital Academy, Inc
5362 State Route 183 Ne
Magnolia, OH 44643

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cardinal Digital Academy, Inc",'Magnolia=' + Magnolia.length); New_Philadelphia[New_Philadelphia.length] = createMarker(new GPoint(-81.44583130,40.49304962),"
Central Elementary School
145 Ray Ave Nw
New Philadelphia, OH 44663

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'New_Philadelphia=' + New_Philadelphia.length); Uhrichsville[Uhrichsville.length] = createMarker(new GPoint(-81.38188934,40.39179993),"
Claymont High School
4205 Indian Hill Rd Se
Uhrichsville, OH 44683

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Claymont High School",'Uhrichsville=' + Uhrichsville.length); Dennison[Dennison.length] = createMarker(new GPoint(-81.33383942,40.39433670),"
Claymont Intermediate Elementary School
220 N 3rd St
Dennison, OH 44621

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Claymont Intermediate Elementary School",'Dennison=' + Dennison.length); Uhrichsville[Uhrichsville.length] = createMarker(new GPoint(-81.34534454,40.39426422),"
Claymont Junior High School
215 E 6th St
Uhrichsville, OH 44683

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Claymont Junior High School",'Uhrichsville=' + Uhrichsville.length); Dover[Dover.length] = createMarker(new GPoint(-81.48474884,40.53276825),"
Dover Avenue Elementary School
125 W 13th St
Dover, OH 44622

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dover Avenue Elementary School",'Dover=' + Dover.length); Dover[Dover.length] = createMarker(new GPoint(-81.48053741,40.52348709),"
Dover High School
520 N Walnut St
Dover, OH 44622

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dover High School",'Dover=' + Dover.length); Dover[Dover.length] = createMarker(new GPoint(-81.48966980,40.54139328),"
Dover Middle School
2131 N Wooster Ave
Dover, OH 44622

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Dover Middle School",'Dover=' + Dover.length); Dundee[Dundee.length] = createMarker(new GPoint(-81.64640045,40.61119843),"
Dundee Elementary School
Po Box 145
Dundee, OH 44624

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dundee Elementary School",'Dundee=' + Dundee.length); Newcomerstown[Newcomerstown.length] = createMarker(new GPoint(-81.60405731,40.27510071),"
East Elementary School
137 S College St
Newcomerstown, OH 43832

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Elementary School",'Newcomerstown=' + Newcomerstown.length); New_Philadelphia[New_Philadelphia.length] = createMarker(new GPoint(-81.43553925,40.48854065),"
East Elementary School
470 Fair Ave Ne
New Philadelphia, OH 44663

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Elementary School",'New_Philadelphia=' + New_Philadelphia.length); Dover[Dover.length] = createMarker(new GPoint(-81.46866608,40.52882385),"
East Elementary School
325 Betscher Ave
Dover, OH 44622

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Elementary School",'Dover=' + Dover.length); Uhrichsville[Uhrichsville.length] = createMarker(new GPoint(-81.34124756,40.40108109),"
Eastport Avenue Elementary School
1200 Eastport Ave
Uhrichsville, OH 44683

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eastport Avenue Elementary School",'Uhrichsville=' + Uhrichsville.length); Sugarcreek[Sugarcreek.length] = createMarker(new GPoint(-81.63990021,40.50781250),"
Garaway High School
146 Dover Rd Nw
Sugarcreek, OH 44681

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Garaway High School",'Sugarcreek=' + Sugarcreek.length); Gnadenhutten[Gnadenhutten.length] = createMarker(new GPoint(-81.43489838,40.36709976),"
Indian Valley High School
Po Box 130
Gnadenhutten, OH 44629

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Indian Valley High School",'Gnadenhutten=' + Gnadenhutten.length); Tuscarawas[Tuscarawas.length] = createMarker(new GPoint(-81.40270233,40.39720154),"
Indian Valley Middle School
Po Box 356
Tuscarawas, OH 44682

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Indian Valley Middle School",'Tuscarawas=' + Tuscarawas.length); New_Philadelphia[New_Philadelphia.length] = createMarker(new GPoint(-81.45106506,40.49425507),"
Joseph Welty Middle School
315 4th St Nw
New Philadelphia, OH 44663

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Joseph Welty Middle School",'New_Philadelphia=' + New_Philadelphia.length); Midvale[Midvale.length] = createMarker(new GPoint(-81.37200165,40.43659973),"
Midvale Elementary School
Po Box 246
Midvale, OH 44653

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Midvale Elementary School",'Midvale=' + Midvale.length); Sugarcreek[Sugarcreek.length] = createMarker(new GPoint(-81.65139008,40.50679398),"
Miller Avenue Elementary School
840 Miller Ave Sw
Sugarcreek, OH 44681

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Miller Avenue Elementary School",'Sugarcreek=' + Sugarcreek.length); Mineral_City[Mineral_City.length] = createMarker(new GPoint(-81.36101532,40.60341644),"
Mineral City Elementary School
8647 1st St Ne
Mineral City, OH 44656

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mineral City Elementary School",'Mineral_City=' + Mineral_City.length); Mineral_City[Mineral_City.length] = createMarker(new GPoint(-81.30107880,40.54260254),"
New Cumberland Elementary School
3986 New Cumberland Rd Ne
Mineral City, OH 44656

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Cumberland Elementary School",'Mineral_City=' + Mineral_City.length); New_Philadelphia[New_Philadelphia.length] = createMarker(new GPoint(-81.45036316,40.49381256),"
New Philadelphia High School
343 Ray Ave Nw
New Philadelphia, OH 44663

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Philadelphia High School",'New_Philadelphia=' + New_Philadelphia.length); Newcomerstown[Newcomerstown.length] = createMarker(new GPoint(-81.61264038,40.26453018),"
Newcomerstown High School
659 Beaver St
Newcomerstown, OH 43832

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Newcomerstown High School",'Newcomerstown=' + Newcomerstown.length); Newcomerstown[Newcomerstown.length] = createMarker(new GPoint(-81.60942841,40.27051926),"
Newcomerstown Middle School
325 W State St
Newcomerstown, OH 43832

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Newcomerstown Middle School",'Newcomerstown=' + Newcomerstown.length); Dennison[Dennison.length] = createMarker(new GPoint(-81.32134247,40.39302826),"
Park Elementary School
200 Jewett Ave
Dennison, OH 44621

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Park Elementary School",'Dennison=' + Dennison.length); Port_Washington[Port_Washington.length] = createMarker(new GPoint(-81.50520325,40.31579971),"
Port Washington Elementary School
Po Box 8
Port Washington, OH 43837

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Port Washington Elementary School",'Port_Washington=' + Port_Washington.length); New_Philadelphia[New_Philadelphia.length] = createMarker(new GPoint(-81.44957000,40.48846300),"
Quaker Digital Academy
248 Front Ave Sw
New Philadelphia, OH 44663

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Quaker Digital Academy",'New_Philadelphia=' + New_Philadelphia.length); Sugarcreek[Sugarcreek.length] = createMarker(new GPoint(-81.63021088,40.44976044),"
Ragersville Elementary School
2405 Ragersville Rd Sw
Sugarcreek, OH 44681

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ragersville Elementary School",'Sugarcreek=' + Sugarcreek.length); Magnolia[Magnolia.length] = createMarker(new GPoint(-81.34852600,40.63856125),"
Sandy Valley High School
5362 State Route 183 Ne
Magnolia, OH 44643

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sandy Valley High School",'Magnolia=' + Magnolia.length); New_Philadelphia[New_Philadelphia.length] = createMarker(new GPoint(-81.44973755,40.46904373),"
South Elementary School
132 Providence Ave Sw
New Philadelphia, OH 44663

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Elementary School",'New_Philadelphia=' + New_Philadelphia.length); Dover[Dover.length] = createMarker(new GPoint(-81.46440887,40.51263428),"
South Elementary School
280 E Shafer Ave
Dover, OH 44622

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Elementary School",'Dover=' + Dover.length); Strasburg[Strasburg.length] = createMarker(new GPoint(-81.53033447,40.59703827),"
Strasburg-franklin Elementary School
140 N Bodmer Ave
Strasburg, OH 44680

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Strasburg-franklin Elementary School",'Strasburg=' + Strasburg.length); Strasburg[Strasburg.length] = createMarker(new GPoint(-81.53033447,40.59703827),"
Strasburg-franklin High School
140 N Bodmer Ave
Strasburg, OH 44680

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Strasburg-franklin High School",'Strasburg=' + Strasburg.length); Uhrichsville[Uhrichsville.length] = createMarker(new GPoint(-81.34932709,40.38867188),"
Trenton Avenue Elementary School
320 Trenton Ave
Uhrichsville, OH 44683

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Trenton Avenue Elementary School",'Uhrichsville=' + Uhrichsville.length); New_Philadelphia[New_Philadelphia.length] = createMarker(new GPoint(-81.46504211,40.50116730),"
Tuscarawas Avenue Elementary School
935 Tuscarawas Ave Nw
New Philadelphia, OH 44663

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tuscarawas Avenue Elementary School",'New_Philadelphia=' + New_Philadelphia.length); Zoarville[Zoarville.length] = createMarker(new GPoint(-81.38818359,40.59818649),"
Tuscarawas Valley High School
2637 Tusky Valley Rd Ne
Zoarville, OH 44656

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tuscarawas Valley High School",'Zoarville=' + Zoarville.length); Zoarville[Zoarville.length] = createMarker(new GPoint(-81.38822937,40.59824753),"
Tuscarawas Valley Middle School
2633 Tusky Valley Rd Ne
Zoarville, OH 44656

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Tuscarawas Valley Middle School",'Zoarville=' + Zoarville.length); Newcomerstown[Newcomerstown.length] = createMarker(new GPoint(-81.61244965,40.26633835),"
West Elementary School
517 Beaver St
Newcomerstown, OH 43832

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Elementary School",'Newcomerstown=' + Newcomerstown.length); New_Philadelphia[New_Philadelphia.length] = createMarker(new GPoint(-81.45986176,40.49377060),"
West Elementary School
232 Tuscarawas Ave Nw
New Philadelphia, OH 44663

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Elementary School",'New_Philadelphia=' + New_Philadelphia.length); New_Philadelphia[New_Philadelphia.length] = createMarker(new GPoint(-81.49729156,40.46850586),"
York Elementary School
938 Stonecreek Rd Sw
New Philadelphia, OH 44663

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("York Elementary School",'New_Philadelphia=' + New_Philadelphia.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(Baltic); map.removeOverlays(Bolivar); map.removeOverlays(Dennison); map.removeOverlays(Dover); map.removeOverlays(Dundee); map.removeOverlays(Gnadenhutten); map.removeOverlays(Magnolia); map.removeOverlays(Midvale); map.removeOverlays(Mineral_City); map.removeOverlays(New_Philadelphia); map.removeOverlays(Newcomerstown); map.removeOverlays(Port_Washington); map.removeOverlays(Strasburg); map.removeOverlays(Sugarcreek); map.removeOverlays(Tuscarawas); map.removeOverlays(Uhrichsville); map.removeOverlays(Zoarville); 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(Baltic);map.removeOverlays(Baltic); map.removeOverlays(Bolivar); map.removeOverlays(Dennison); map.removeOverlays(Dover); map.removeOverlays(Dundee); map.removeOverlays(Gnadenhutten); map.removeOverlays(Magnolia); map.removeOverlays(Midvale); map.removeOverlays(Mineral_City); map.removeOverlays(New_Philadelphia); map.removeOverlays(Newcomerstown); map.removeOverlays(Port_Washington); map.removeOverlays(Strasburg); map.removeOverlays(Sugarcreek); map.removeOverlays(Tuscarawas); map.removeOverlays(Uhrichsville); map.removeOverlays(Zoarville); map.addOverlays(Baltic); centerByArray(Baltic, false, false); cntMarker += Baltic.length; map.addOverlays(Bolivar); centerByArray(Bolivar, false, false); cntMarker += Bolivar.length; map.addOverlays(Dennison); centerByArray(Dennison, false, false); cntMarker += Dennison.length; map.addOverlays(Dover); centerByArray(Dover, false, false); cntMarker += Dover.length; map.addOverlays(Dundee); centerByArray(Dundee, false, false); cntMarker += Dundee.length; map.addOverlays(Gnadenhutten); centerByArray(Gnadenhutten, false, false); cntMarker += Gnadenhutten.length; map.addOverlays(Magnolia); centerByArray(Magnolia, false, false); cntMarker += Magnolia.length; map.addOverlays(Midvale); centerByArray(Midvale, false, false); cntMarker += Midvale.length; map.addOverlays(Mineral_City); centerByArray(Mineral_City, false, false); cntMarker += Mineral_City.length; map.addOverlays(New_Philadelphia); centerByArray(New_Philadelphia, false, false); cntMarker += New_Philadelphia.length; map.addOverlays(Newcomerstown); centerByArray(Newcomerstown, false, false); cntMarker += Newcomerstown.length; map.addOverlays(Port_Washington); centerByArray(Port_Washington, false, false); cntMarker += Port_Washington.length; map.addOverlays(Strasburg); centerByArray(Strasburg, false, false); cntMarker += Strasburg.length; map.addOverlays(Sugarcreek); centerByArray(Sugarcreek, false, false); cntMarker += Sugarcreek.length; map.addOverlays(Tuscarawas); centerByArray(Tuscarawas, false, false); cntMarker += Tuscarawas.length; map.addOverlays(Uhrichsville); centerByArray(Uhrichsville, false, false); cntMarker += Uhrichsville.length; map.addOverlays(Zoarville); centerByArray(Zoarville, false, false); cntMarker += Zoarville.length; centerByArray(Baltic,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'); } }