function addMarkers() { mySelect = document.getElementById('selection'); Arcadia = [];Arlington = [];Findlay = [];Rawson = [];Mccomb = [];Mt_Blanchard = [];Van_Buren = [];Vanlue = [];mySelect.options[mySelect.options.length] = new Option("Arcadia schools",'all=Arcadia'); mySelect.options[mySelect.options.length] = new Option("Arlington schools",'all=Arlington'); mySelect.options[mySelect.options.length] = new Option("Findlay schools",'all=Findlay'); mySelect.options[mySelect.options.length] = new Option("Mccomb schools",'all=Mccomb'); mySelect.options[mySelect.options.length] = new Option("Mt Blanchard schools",'all=Mt_Blanchard'); mySelect.options[mySelect.options.length] = new Option("Rawson schools",'all=Rawson'); mySelect.options[mySelect.options.length] = new Option("Van Buren schools",'all=Van_Buren'); mySelect.options[mySelect.options.length] = new Option("Vanlue schools",'all=Vanlue'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Arcadia[Arcadia.length] = createMarker(new GPoint(-83.51535034,41.10781097),"
Arcadia Elementary School
19033 State Route 12
Arcadia, OH 44804

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arcadia Elementary School",'Arcadia=' + Arcadia.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-83.51535034,41.10781097),"
Arcadia High School
19033 State Route 12
Arcadia, OH 44804

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Arcadia High School",'Arcadia=' + Arcadia.length); Arcadia[Arcadia.length] = createMarker(new GPoint(-83.51531800,41.10792200),"
Arcadia Middle School
19033 State Route 12
Arcadia, OH 44804

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Arcadia Middle School",'Arcadia=' + Arcadia.length); Arlington[Arlington.length] = createMarker(new GPoint(-83.63710022,40.89300156),"
Arlington Local Elementary School
Po Box 260
Arlington, OH 45814

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arlington Local Elementary School",'Arlington=' + Arlington.length); Arlington[Arlington.length] = createMarker(new GPoint(-83.63710022,40.89300156),"
Arlington Local High School
Po Box 260
Arlington, OH 45814

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Arlington Local High School",'Arlington=' + Arlington.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.65562439,41.07618713),"
Bigelow Hill Elementary School
300 Hillcrest Ave
Findlay, OH 45840

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bigelow Hill Elementary School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.65228271,41.03923798),"
Central Middle School
200 W Main Cross St
Findlay, OH 45840

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Central Middle School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.65947723,41.01233673),"
Chamberlin Hill Elementary School
600 W Yates Ave
Findlay, OH 45840

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chamberlin Hill Elementary School",'Findlay=' + Findlay.length); Rawson[Rawson.length] = createMarker(new GPoint(-83.78534698,40.95267105),"
Cory-rawson Elementary School
220 S Main St
Rawson, OH 45881

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cory-rawson Elementary School",'Rawson=' + Rawson.length); Rawson[Rawson.length] = createMarker(new GPoint(-83.80728149,40.93679428),"
Cory-rawson High School
3930 County Road 26
Rawson, OH 45881

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cory-rawson High School",'Rawson=' + Rawson.length); Rawson[Rawson.length] = createMarker(new GPoint(-83.80728149,40.93679428),"
Cory-rawson Middle School
3930 County Road 26
Rawson, OH 45881

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Cory-rawson Middle School",'Rawson=' + Rawson.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.65389252,41.02696228),"
Donnell Middle School
301 Baldwin Ave
Findlay, OH 45840

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Donnell Middle School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.66457800,41.05535000),"
Findlay Digital Academy
1200 Broad Ave
Findlay, OH 45840

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Findlay Digital Academy",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.66468048,41.05553818),"
Findlay High School
1200 Broad Ave
Findlay, OH 45840

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Findlay High School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.64989471,41.06087112),"
Glenwood Middle School
1715 N Main St
Findlay, OH 45840

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Glenwood Middle School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.90048800,41.18223800),"
Hancock Co Alternative Opp Ctr High School
7746 County Road 140
Findlay, OH 45840

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hancock Co Alternative Opp Ctr High School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.64025116,41.05899811),"
Jacobs Elementary School
600 Jacobs Ave
Findlay, OH 45840

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jacobs Elementary School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.64926147,41.01993561),"
Jefferson Elementary School
204 Fairlawn Pl
Findlay, OH 45840

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.69875336,41.03385925),"
Liberty-benton Elementary School
9190 County Road 9
Findlay, OH 45840

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liberty-benton Elementary School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.69875336,41.03385925),"
Liberty-benton High School
9190 County Road 9
Findlay, OH 45840

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Liberty-benton High School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.69875336,41.03385925),"
Liberty-benton Middle School
9190 County Road 9
Findlay, OH 45840

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Liberty-benton Middle School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.65228271,41.03453827),"
Lincoln Elementary School
200 W Lincoln St
Findlay, OH 45840

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Findlay=' + Findlay.length); Mccomb[Mccomb.length] = createMarker(new GPoint(-83.79174805,41.10516739),"
Mccomb Local Elementary School
328 S Todd St
Mccomb, OH 45858

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mccomb Local Elementary School",'Mccomb=' + Mccomb.length); Mccomb[Mccomb.length] = createMarker(new GPoint(-83.79156200,41.10525400),"
Mccomb Local High School
328 S Todd St
Mccomb, OH 45858

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mccomb Local High School",'Mccomb=' + Mccomb.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.65028800,41.03740000),"
Millstream, East Campus
620 Lynn St
Findlay, OH 45840

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Millstream, East Campus",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.66476440,41.05424500),"
Millstream, South
1100 Broad Ave
Findlay, OH 45840

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Millstream, South",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.65055847,41.06776428),"
Northview Elementary School
133 Lexington Ave
Findlay, OH 45840

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northview Elementary School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.65055847,41.06776428),"
Northview Hearing Impaired
133 Lexington Ave
Findlay, OH 45840

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northview Hearing Impaired",'Findlay=' + Findlay.length); Mt_Blanchard[Mt_Blanchard.length] = createMarker(new GPoint(-83.51506805,40.80058670),"
Riverdale Elementary School
20613 State Route 37
Mt Blanchard, OH 45867

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverdale Elementary School",'Mt_Blanchard=' + Mt_Blanchard.length); Mt_Blanchard[Mt_Blanchard.length] = createMarker(new GPoint(-83.55671900,40.89857500),"
Riverdale High School
20613 State Route 37
Mt Blanchard, OH 45867

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Riverdale High School",'Mt_Blanchard=' + Mt_Blanchard.length); Mt_Blanchard[Mt_Blanchard.length] = createMarker(new GPoint(-83.51506805,40.80058670),"
Riverdale Middle School
20613 State Route 37
Mt Blanchard, OH 45867

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Riverdale Middle School",'Mt_Blanchard=' + Mt_Blanchard.length); Van_Buren[Van_Buren.length] = createMarker(new GPoint(-83.64931488,41.13615417),"
Van Buren Elementary School
301 S Main St
Van Buren, OH 45889

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Van Buren Elementary School",'Van_Buren=' + Van_Buren.length); Van_Buren[Van_Buren.length] = createMarker(new GPoint(-83.64931488,41.13615417),"
Van Buren High School
217 S Main St
Van Buren, OH 45889

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Van Buren High School",'Van_Buren=' + Van_Buren.length); Van_Buren[Van_Buren.length] = createMarker(new GPoint(-83.64931488,41.13615417),"
Van Buren Middle School
217 S Main St
Van Buren, OH 45889

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Van Buren Middle School",'Van_Buren=' + Van_Buren.length); Vanlue[Vanlue.length] = createMarker(new GPoint(-83.48519897,40.97259903),"
Vanlue Elementary School
Po Box 250
Vanlue, OH 45890

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Vanlue Elementary School",'Vanlue=' + Vanlue.length); Vanlue[Vanlue.length] = createMarker(new GPoint(-83.48519897,40.97259903),"
Vanlue High School
Po Box 250
Vanlue, OH 45890

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Vanlue High School",'Vanlue=' + Vanlue.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.65000153,41.04882813),"
Washington Elementary School
701 N Main St
Findlay, OH 45840

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.63667297,41.03306198),"
Whittier Elementary School
733 Wyandot St
Findlay, OH 45840

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Whittier Elementary School",'Findlay=' + Findlay.length); Findlay[Findlay.length] = createMarker(new GPoint(-83.61260223,41.04674911),"
Wilson Vance Elementary School
610 Bristol Dr
Findlay, OH 45840

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wilson Vance Elementary School",'Findlay=' + Findlay.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(Arcadia); map.removeOverlays(Arlington); map.removeOverlays(Findlay); map.removeOverlays(Mccomb); map.removeOverlays(Mt_Blanchard); map.removeOverlays(Rawson); map.removeOverlays(Van_Buren); map.removeOverlays(Vanlue); 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(Arcadia);map.removeOverlays(Arcadia); map.removeOverlays(Arlington); map.removeOverlays(Findlay); map.removeOverlays(Mccomb); map.removeOverlays(Mt_Blanchard); map.removeOverlays(Rawson); map.removeOverlays(Van_Buren); map.removeOverlays(Vanlue); map.addOverlays(Arcadia); centerByArray(Arcadia, false, false); cntMarker += Arcadia.length; map.addOverlays(Arlington); centerByArray(Arlington, false, false); cntMarker += Arlington.length; map.addOverlays(Findlay); centerByArray(Findlay, false, false); cntMarker += Findlay.length; map.addOverlays(Mccomb); centerByArray(Mccomb, false, false); cntMarker += Mccomb.length; map.addOverlays(Mt_Blanchard); centerByArray(Mt_Blanchard, false, false); cntMarker += Mt_Blanchard.length; map.addOverlays(Rawson); centerByArray(Rawson, false, false); cntMarker += Rawson.length; map.addOverlays(Van_Buren); centerByArray(Van_Buren, false, false); cntMarker += Van_Buren.length; map.addOverlays(Vanlue); centerByArray(Vanlue, false, false); cntMarker += Vanlue.length; centerByArray(Arcadia,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'); } }