function addMarkers() { mySelect = document.getElementById('selection'); Attica = [];Bettsville = [];Tiffin = [];Bloomville = [];Fostoria = [];Wayne = [];Bascom = [];Mc_Cutchenville = [];Melmore = [];New_Riegel = [];Old_Fort = [];Republic = [];Bellevue = [];mySelect.options[mySelect.options.length] = new Option("Attica schools",'all=Attica'); mySelect.options[mySelect.options.length] = new Option("Bascom schools",'all=Bascom'); mySelect.options[mySelect.options.length] = new Option("Bellevue schools",'all=Bellevue'); mySelect.options[mySelect.options.length] = new Option("Bettsville schools",'all=Bettsville'); mySelect.options[mySelect.options.length] = new Option("Bloomville schools",'all=Bloomville'); mySelect.options[mySelect.options.length] = new Option("Fostoria schools",'all=Fostoria'); mySelect.options[mySelect.options.length] = new Option("Mc Cutchenville schools",'all=Mc_Cutchenville'); mySelect.options[mySelect.options.length] = new Option("Melmore schools",'all=Melmore'); mySelect.options[mySelect.options.length] = new Option("New Riegel schools",'all=New_Riegel'); mySelect.options[mySelect.options.length] = new Option("Old Fort schools",'all=Old_Fort'); mySelect.options[mySelect.options.length] = new Option("Republic schools",'all=Republic'); mySelect.options[mySelect.options.length] = new Option("Tiffin schools",'all=Tiffin'); mySelect.options[mySelect.options.length] = new Option("Wayne schools",'all=Wayne'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Attica[Attica.length] = createMarker(new GPoint(-82.88610077,41.06090164),"
Attica Elementary School
Po Box 462
Attica, OH 44807

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Attica Elementary School",'Attica=' + Attica.length); Bettsville[Bettsville.length] = createMarker(new GPoint(-83.23370361,41.24430084),"
Bettsville Elementary School
Po Box 6
Bettsville, OH 44815

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bettsville Elementary School",'Bettsville=' + Bettsville.length); Bettsville[Bettsville.length] = createMarker(new GPoint(-83.23370361,41.24430084),"
Bettsville High School
Po Box 6
Bettsville, OH 44815

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bettsville High School",'Bettsville=' + Bettsville.length); Bettsville[Bettsville.length] = createMarker(new GPoint(-83.23370361,41.24430084),"
Bettsville Middle School
Po Box 6
Bettsville, OH 44815

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bettsville Middle School",'Bettsville=' + Bettsville.length); Tiffin[Tiffin.length] = createMarker(new GPoint(-83.17109200,41.09800600),"
Bridges Community Academy
190 St Francis Ave
Tiffin, OH 44883

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bridges Community Academy",'Tiffin=' + Tiffin.length); Bloomville[Bloomville.length] = createMarker(new GPoint(-83.01511383,41.04687881),"
Buckeye North Elementary School
69 S Marion St
Bloomville, OH 44818

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buckeye North Elementary School",'Bloomville=' + Bloomville.length); Tiffin[Tiffin.length] = createMarker(new GPoint(-83.11239624,41.13887787),"
Clinton Elementary School
2036 E Township Road 122
Tiffin, OH 44883

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clinton Elementary School",'Tiffin=' + Tiffin.length); Tiffin[Tiffin.length] = createMarker(new GPoint(-83.17735291,41.10784531),"
Columbian High School
300 S Monroe St
Tiffin, OH 44883

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Columbian High School",'Tiffin=' + Tiffin.length); Fostoria[Fostoria.length] = createMarker(new GPoint(-83.41499329,41.14923859),"
Field Elementary School
127 W 6th St
Fostoria, OH 44830

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Field Elementary School",'Fostoria=' + Fostoria.length); Wayne[Wayne.length] = createMarker(new GPoint(-83.50431061,41.26948547),"
Fostoria
8110 Mccutcheonville Rd
Wayne, OH 43466

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fostoria",'Wayne=' + Wayne.length); Fostoria[Fostoria.length] = createMarker(new GPoint(-83.43125916,41.16674805),"
Fostoria Middle School
1202 H L Ford Dr
Fostoria, OH 44830

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fostoria Middle School",'Fostoria=' + Fostoria.length); Bascom[Bascom.length] = createMarker(new GPoint(-83.28520203,41.13270187),"
Hopewell-loudon Local Elementary School
Po Box 400
Bascom, OH 44809

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hopewell-loudon Local Elementary School",'Bascom=' + Bascom.length); Bascom[Bascom.length] = createMarker(new GPoint(-83.28520203,41.13270187),"
Hopewell-loudon Local High School
Po Box 400
Bascom, OH 44809

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hopewell-loudon Local High School",'Bascom=' + Bascom.length); Tiffin[Tiffin.length] = createMarker(new GPoint(-83.17405701,41.10146332),"
Krout Elementary School
20 Glenn St
Tiffin, OH 44883

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Krout Elementary School",'Tiffin=' + Tiffin.length); Fostoria[Fostoria.length] = createMarker(new GPoint(-83.32778168,41.21608353),"
Lakota Junior High School
8351 W County Road 28
Fostoria, OH 44830

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lakota Junior High School",'Fostoria=' + Fostoria.length); Tiffin[Tiffin.length] = createMarker(new GPoint(-83.16515350,41.12315369),"
Lincoln Elementary School
124 Ohio Ave
Tiffin, OH 44883

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Tiffin=' + Tiffin.length); Fostoria[Fostoria.length] = createMarker(new GPoint(-83.40509033,41.16332626),"
Longfellow Elementary School
619 Sandusky St
Fostoria, OH 44830

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Longfellow Elementary School",'Fostoria=' + Fostoria.length); Fostoria[Fostoria.length] = createMarker(new GPoint(-83.41496277,41.16395187),"
Lowell Elementary School
129 Elm St
Fostoria, OH 44830

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lowell Elementary School",'Fostoria=' + Fostoria.length); Mc_Cutchenville[Mc_Cutchenville.length] = createMarker(new GPoint(-83.25646973,40.99486160),"
Mccutchenville Elementary School
8850 S State Route 53
Mc Cutchenville, OH 44844

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mccutchenville Elementary School",'Mc_Cutchenville=' + Mc_Cutchenville.length); Melmore[Melmore.length] = createMarker(new GPoint(-83.14559937,41.03639984),"
Melmore Elementary School
Po Box 69
Melmore, OH 44845

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Melmore Elementary School",'Melmore=' + Melmore.length); New_Riegel[New_Riegel.length] = createMarker(new GPoint(-83.31942749,41.05308151),"
New Riegel Elementary School
44 N Perry St
New Riegel, OH 44853

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Riegel Elementary School",'New_Riegel=' + New_Riegel.length); New_Riegel[New_Riegel.length] = createMarker(new GPoint(-83.31942749,41.05308151),"
New Riegel High School
44 N Perry St
New Riegel, OH 44853

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Riegel High School",'New_Riegel=' + New_Riegel.length); Tiffin[Tiffin.length] = createMarker(new GPoint(-83.17663574,41.12394714),"
Noble Elementary School
130 Minerva St
Tiffin, OH 44883

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Noble Elementary School",'Tiffin=' + Tiffin.length); Old_Fort[Old_Fort.length] = createMarker(new GPoint(-83.14880371,41.23979950),"
Old Fort Elementary School
Po Box 64
Old Fort, OH 44861

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Old Fort Elementary School",'Old_Fort=' + Old_Fort.length); Old_Fort[Old_Fort.length] = createMarker(new GPoint(-83.14880371,41.23979950),"
Old Fort High School
Po Box 64
Old Fort, OH 44861

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Old Fort High School",'Old_Fort=' + Old_Fort.length); Republic[Republic.length] = createMarker(new GPoint(-83.00289917,41.13510132),"
Republic Elementary School
Po Box 39
Republic, OH 44867

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Republic Elementary School",'Republic=' + Republic.length); Fostoria[Fostoria.length] = createMarker(new GPoint(-83.41699982,41.17263412),"
Riley Elementary School
1324 Walnut St
Fostoria, OH 44830

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riley Elementary School",'Fostoria=' + Fostoria.length); Attica[Attica.length] = createMarker(new GPoint(-82.88610077,41.06090164),"
Seneca East High School
Po Box 462
Attica, OH 44807

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Seneca East High School",'Attica=' + Attica.length); Republic[Republic.length] = createMarker(new GPoint(-83.00289917,41.13510132),"
Seneca East Junior High School
Po Box 39
Republic, OH 44867

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Seneca East Junior High School",'Republic=' + Republic.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-82.83956909,41.16586304),"
Seneca-huron Elementary School
17174 Bismark Rd
Bellevue, OH 44811

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Seneca-huron Elementary School",'Bellevue=' + Bellevue.length); Tiffin[Tiffin.length] = createMarker(new GPoint(-83.15311432,41.08806992),"
Sentinel Career Center
793 E Township Road 201
Tiffin, OH 44883

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sentinel Career Center",'Tiffin=' + Tiffin.length); Tiffin[Tiffin.length] = createMarker(new GPoint(-83.17694300,41.10705500),"
Tiffin City Digital Academy
244 S Monroe St
Tiffin, OH 44883

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tiffin City Digital Academy",'Tiffin=' + Tiffin.length); Tiffin[Tiffin.length] = createMarker(new GPoint(-83.17438507,41.11469650),"
Tiffin Junior High School
138 E Market St
Tiffin, OH 44883

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Tiffin Junior High School",'Tiffin=' + Tiffin.length); Tiffin[Tiffin.length] = createMarker(new GPoint(-83.17720032,41.11009979),"
Tiffin Middle School
103 Shepherd Drive
Tiffin, OH 44883

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Tiffin Middle School",'Tiffin=' + Tiffin.length); Tiffin[Tiffin.length] = createMarker(new GPoint(-83.19388580,41.11753464),"
Washington Elementary School
151 Elmer St
Tiffin, OH 44883

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Tiffin=' + Tiffin.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(Attica); map.removeOverlays(Bascom); map.removeOverlays(Bellevue); map.removeOverlays(Bettsville); map.removeOverlays(Bloomville); map.removeOverlays(Fostoria); map.removeOverlays(Mc_Cutchenville); map.removeOverlays(Melmore); map.removeOverlays(New_Riegel); map.removeOverlays(Old_Fort); map.removeOverlays(Republic); map.removeOverlays(Tiffin); map.removeOverlays(Wayne); 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(Attica);map.removeOverlays(Attica); map.removeOverlays(Bascom); map.removeOverlays(Bellevue); map.removeOverlays(Bettsville); map.removeOverlays(Bloomville); map.removeOverlays(Fostoria); map.removeOverlays(Mc_Cutchenville); map.removeOverlays(Melmore); map.removeOverlays(New_Riegel); map.removeOverlays(Old_Fort); map.removeOverlays(Republic); map.removeOverlays(Tiffin); map.removeOverlays(Wayne); map.addOverlays(Attica); centerByArray(Attica, false, false); cntMarker += Attica.length; map.addOverlays(Bascom); centerByArray(Bascom, false, false); cntMarker += Bascom.length; map.addOverlays(Bellevue); centerByArray(Bellevue, false, false); cntMarker += Bellevue.length; map.addOverlays(Bettsville); centerByArray(Bettsville, false, false); cntMarker += Bettsville.length; map.addOverlays(Bloomville); centerByArray(Bloomville, false, false); cntMarker += Bloomville.length; map.addOverlays(Fostoria); centerByArray(Fostoria, false, false); cntMarker += Fostoria.length; map.addOverlays(Mc_Cutchenville); centerByArray(Mc_Cutchenville, false, false); cntMarker += Mc_Cutchenville.length; map.addOverlays(Melmore); centerByArray(Melmore, false, false); cntMarker += Melmore.length; map.addOverlays(New_Riegel); centerByArray(New_Riegel, false, false); cntMarker += New_Riegel.length; map.addOverlays(Old_Fort); centerByArray(Old_Fort, false, false); cntMarker += Old_Fort.length; map.addOverlays(Republic); centerByArray(Republic, false, false); cntMarker += Republic.length; map.addOverlays(Tiffin); centerByArray(Tiffin, false, false); cntMarker += Tiffin.length; map.addOverlays(Wayne); centerByArray(Wayne, false, false); cntMarker += Wayne.length; centerByArray(Attica,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'); } }