function addMarkers() { mySelect = document.getElementById('selection'); Lima = [];Lafayette = [];Harrod = [];Bluffton = [];Elida = [];Delphos = [];Gomer = [];Spencerville = [];mySelect.options[mySelect.options.length] = new Option("Bluffton schools",'all=Bluffton'); mySelect.options[mySelect.options.length] = new Option("Delphos schools",'all=Delphos'); mySelect.options[mySelect.options.length] = new Option("Elida schools",'all=Elida'); mySelect.options[mySelect.options.length] = new Option("Gomer schools",'all=Gomer'); mySelect.options[mySelect.options.length] = new Option("Harrod schools",'all=Harrod'); mySelect.options[mySelect.options.length] = new Option("Lafayette schools",'all=Lafayette'); mySelect.options[mySelect.options.length] = new Option("Lima schools",'all=Lima'); mySelect.options[mySelect.options.length] = new Option("Spencerville schools",'all=Spencerville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Lima[Lima.length] = createMarker(new GPoint(-84.10674900,40.73691400),"
Allen County Schools Alternative Program
345 S Elizabeth St
Lima, OH 45801

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Allen County Schools Alternative Program",'Lima=' + Lima.length); Lafayette[Lafayette.length] = createMarker(new GPoint(-84.11219788,40.74166107),"
Allen East High School
105 N Washington St
Lafayette, OH 45854

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Allen East High School",'Lafayette=' + Lafayette.length); Harrod[Harrod.length] = createMarker(new GPoint(-83.92523956,40.70626450),"
Allen East Middle School
9520 Harrod Rd
Harrod, OH 45850

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Allen East Middle School",'Harrod=' + Harrod.length); Lima[Lima.length] = createMarker(new GPoint(-84.11219788,40.74166107),"
Allen East Primary Elementary School
105 N Washington St
Lima, OH 45854

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Allen East Primary Elementary School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.15111542,40.69287109),"
Apollo Career Center
3325 Shawnee Rd
Lima, OH 45806

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Apollo Career Center",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.15111542,40.69287109),"
Apollo Practical Nursing
3325 Shawnee Rd
Lima, OH 45806

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Apollo Practical Nursing",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.08934300,40.72945100),"
Auglaize County Educational Academy
1130a East Albert St
Lima, OH 45804

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Auglaize County Educational Academy",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.08934300,40.72945100),"
Auglaize County Special Needs School
1130a East Albert St
Lima, OH 45804

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Auglaize County Special Needs School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.05138397,40.77528381),"
Bath Elementary School
2501 Slabtown Rd
Lima, OH 45801

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bath Elementary School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.05698395,40.77436447),"
Bath High School
2850 Bible Rd
Lima, OH 45801

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bath High School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.06562042,40.77436447),"
Bath Middle School
2700 Bible Rd
Lima, OH 45801

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bath Middle School",'Lima=' + Lima.length); Bluffton[Bluffton.length] = createMarker(new GPoint(-83.89315033,40.89421082),"
Bluffton Elementary School
102 S Jackson St
Bluffton, OH 45817

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bluffton Elementary School",'Bluffton=' + Bluffton.length); Bluffton[Bluffton.length] = createMarker(new GPoint(-83.89355469,40.89233398),"
Bluffton High School
106 W College Ave
Bluffton, OH 45817

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bluffton High School",'Bluffton=' + Bluffton.length); Bluffton[Bluffton.length] = createMarker(new GPoint(-83.89315796,40.89421082),"
Bluffton Middle School
116 S Jackson St
Bluffton, OH 45817

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bluffton Middle School",'Bluffton=' + Bluffton.length); Lima[Lima.length] = createMarker(new GPoint(-84.18376923,40.78754044),"
Elida Digital Academy
650 E Edwards St
Lima, OH 45801

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elida Digital Academy",'Lima=' + Lima.length); Elida[Elida.length] = createMarker(new GPoint(-84.18911743,40.78524017),"
Elida Elementary School
300 Pioneer Rd
Elida, OH 45807

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Elida Elementary School",'Elida=' + Elida.length); Elida[Elida.length] = createMarker(new GPoint(-84.20349884,40.78973770),"
Elida High School
101 E North St
Elida, OH 45807

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elida High School",'Elida=' + Elida.length); Elida[Elida.length] = createMarker(new GPoint(-84.18675232,40.78763580),"
Elida Middle School
4500 Sunnydale St
Elida, OH 45807

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Elida Middle School",'Elida=' + Elida.length); Lima[Lima.length] = createMarker(new GPoint(-84.15081787,40.67550659),"
Elmwood Elementary School
4295 Shawnee Rd
Lima, OH 45806

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Elmwood Elementary School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.09654236,40.75450134),"
Emerson Elementary School
650 E Edwards St
Lima, OH 45801

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Emerson Elementary School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.11089325,40.73738098),"
Faurot Elementary School
515 W Elm St
Lima, OH 45801

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Faurot Elementary School",'Lima=' + Lima.length); Delphos[Delphos.length] = createMarker(new GPoint(-84.33549500,40.84599304),"
Franklin Elementary School
424 E 4th St
Delphos, OH 45833

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Franklin Elementary School",'Delphos=' + Delphos.length); Lima[Lima.length] = createMarker(new GPoint(-84.09134674,40.73241043),"
Freedom Elementary School
575 Calumet Ave
Lima, OH 45804

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Freedom Elementary School",'Lima=' + Lima.length); Gomer[Gomer.length] = createMarker(new GPoint(-84.18164825,40.84389877),"
Gomer Elementary School
4040 W Lincoln Hwy
Gomer, OH 45809

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gomer Elementary School",'Gomer=' + Gomer.length); Lima[Lima.length] = createMarker(new GPoint(-84.11331700,40.74273900),"
Heir Force Community School
Po Box 180
Lima, OH 45802

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Heir Force Community School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.12641907,40.74845505),"
Heritage Elementary School
816 College Ave
Lima, OH 45805

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Heritage Elementary School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.12572479,40.74716949),"
Horace Mann Elementary School
1130 Rice Ave
Lima, OH 45805

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Horace Mann Elementary School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.11362200,40.75405800),"
Independence Elementary School
615 Tremont Ave
Lima, OH 45801

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Independence Elementary School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.11344147,40.75322723),"
Irving Elementary School
1130 Rice Ave
Lima, OH 45805

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Irving Elementary School",'Lima=' + Lima.length); Delphos[Delphos.length] = createMarker(new GPoint(-84.35399628,40.85070038),"
Jefferson High School
901 Wildcat Ln
Delphos, OH 45833

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jefferson High School",'Delphos=' + Delphos.length); Delphos[Delphos.length] = createMarker(new GPoint(-84.38689423,40.80115509),"
Landeck Elementary School
14750 Landeck Rd
Delphos, OH 45833

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Landeck Elementary School",'Delphos=' + Delphos.length); Lima[Lima.length] = createMarker(new GPoint(-84.10937500,40.73008900),"
Liberty Elementary School
338 W Kibby St
Lima, OH 45804

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liberty Elementary School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.10792542,40.73453140),"
Lima Alternative High School
1 Spartan Way
Lima, OH 45804

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lima Alternative High School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-79.09586334,36.07536316),"
Lima Alternative Special Need High School
1 Spartan Way
Lima, OH 45804

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lima Alternative Special Need High School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.09111786,40.73456955),"
Lima Digital Academy
515 Calumet Ave
Lima, OH 45804

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lima Digital Academy",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.10792542,40.73453140),"
Lima High School
1 Spartan Way
Lima, OH 45804

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lima High School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.10855103,40.75791168),"
Lima North Middle School
1135 N West St
Lima, OH 45801

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lima North Middle School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.09133911,40.73075485),"
Lima South Middle School
755 Saint Johns Ave
Lima, OH 45804

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lima South Middle School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.14693451,40.74595261),"
Lima West Middle School
503 N Cable Rd
Lima, OH 45805

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lima West Middle School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.12458038,40.73868179),"
Lowell Elementary School
1003 W Spring St
Lima, OH 45805

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lowell Elementary School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.18518066,40.71036148),"
Maplewood Elementary School
1670 Wonderlick Rd
Lima, OH 45805

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Maplewood Elementary School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.05396271,40.68756485),"
Perry Elementary School
2770 E Breese Rd
Lima, OH 45806

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Perry Elementary School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.05396271,40.68756485),"
Perry High School
2770 E Breese Rd
Lima, OH 45806

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Perry High School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.10372162,40.71166229),"
Quest Academy Community
190 E 8th St
Lima, OH 45804

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Quest Academy Community",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.16537476,40.69346237),"
Shawnee High School
3333 Zurmehly Rd
Lima, OH 45806

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shawnee High School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.16375732,40.69346237),"
Shawnee Middle School
3235 Zurmehly Rd
Lima, OH 45806

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Shawnee Middle School",'Lima=' + Lima.length); Spencerville[Spencerville.length] = createMarker(new GPoint(-84.34848022,40.70721054),"
Spencerville Elementary School
436 E 4th St
Spencerville, OH 45887

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Spencerville Elementary School",'Spencerville=' + Spencerville.length); Spencerville[Spencerville.length] = createMarker(new GPoint(-84.34460449,40.70527267),"
Spencerville High School
600 School St
Spencerville, OH 45887

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Spencerville High School",'Spencerville=' + Spencerville.length); Spencerville[Spencerville.length] = createMarker(new GPoint(-84.34848022,40.70721054),"
Spencerville Middle School
436 E 4th St
Spencerville, OH 45887

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Spencerville Middle School",'Spencerville=' + Spencerville.length); Lima[Lima.length] = createMarker(new GPoint(-84.09191132,40.71880341),"
Unity Elementary School
925 E 3rd St
Lima, OH 45804

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Unity Elementary School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.14693451,40.74591827),"
Westwood Elementary School
501 N Cable Rd
Lima, OH 45805

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westwood Elementary School",'Lima=' + Lima.length); Lima[Lima.length] = createMarker(new GPoint(-84.10087585,40.72072983),"
Whittier Elementary School
400 E Holmes Ave
Lima, OH 45804

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Whittier Elementary School",'Lima=' + Lima.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(Bluffton); map.removeOverlays(Delphos); map.removeOverlays(Elida); map.removeOverlays(Gomer); map.removeOverlays(Harrod); map.removeOverlays(Lafayette); map.removeOverlays(Lima); map.removeOverlays(Spencerville); 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(Lima);map.removeOverlays(Bluffton); map.removeOverlays(Delphos); map.removeOverlays(Elida); map.removeOverlays(Gomer); map.removeOverlays(Harrod); map.removeOverlays(Lafayette); map.removeOverlays(Lima); map.removeOverlays(Spencerville); map.addOverlays(Bluffton); centerByArray(Bluffton, false, false); cntMarker += Bluffton.length; map.addOverlays(Delphos); centerByArray(Delphos, false, false); cntMarker += Delphos.length; map.addOverlays(Elida); centerByArray(Elida, false, false); cntMarker += Elida.length; map.addOverlays(Gomer); centerByArray(Gomer, false, false); cntMarker += Gomer.length; map.addOverlays(Harrod); centerByArray(Harrod, false, false); cntMarker += Harrod.length; map.addOverlays(Lafayette); centerByArray(Lafayette, false, false); cntMarker += Lafayette.length; map.addOverlays(Lima); centerByArray(Lima, false, false); cntMarker += Lima.length; map.addOverlays(Spencerville); centerByArray(Spencerville, false, false); cntMarker += Spencerville.length; centerByArray(Lima,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'); } }