function addMarkers(){ mySelect = document.getElementById('selection'); Goshen = [];Middlebury = [];Elkhart = [];Bristol = [];Nappanee = [];Granger = [];Wakarusa = [];Millersburg = [];mySelect.options[mySelect.options.length] = new Option("Bristol schools",'all=Bristol'); mySelect.options[mySelect.options.length] = new Option("Elkhart schools",'all=Elkhart'); mySelect.options[mySelect.options.length] = new Option("Goshen schools",'all=Goshen'); mySelect.options[mySelect.options.length] = new Option("Granger schools",'all=Granger'); mySelect.options[mySelect.options.length] = new Option("Middlebury schools",'all=Middlebury'); mySelect.options[mySelect.options.length] = new Option("Millersburg schools",'all=Millersburg'); mySelect.options[mySelect.options.length] = new Option("Nappanee schools",'all=Nappanee'); mySelect.options[mySelect.options.length] = new Option("Wakarusa schools",'all=Wakarusa'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Goshen[Goshen.length] = createMarker(new GPoint(-85.84120000,41.58900000),"
Basher Alternative School
P.o. Box 843
Goshen, IN 46527
Co-ed school, 6-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Basher Alternative School",'Goshen=' + Goshen.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.82815700,41.54565400),"
Bethany Christian Schools
2904 South Main Street
Goshen, IN 46526
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethany Christian Schools",'Goshen=' + Goshen.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.84120000,41.58900000),"
Brennerman Daycare Center
Po Box 495
Goshen, IN 46527
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brennerman Daycare Center",'Goshen=' + Goshen.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.71321500,41.57478200),"
Clinton Center Amish School
63452 County Road 37
Goshen, IN 46528
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clinton Center Amish School",'Goshen=' + Goshen.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.82510000,41.61010000),"
Clinton Christian School
61763 County Road 35 Rr1
Goshen, IN 46528
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clinton Christian School",'Goshen=' + Goshen.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.74466500,41.58116100),"
Cloverleaf School
14630 County Road 34
Goshen, IN 46528
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cloverleaf School",'Goshen=' + Goshen.length); Middlebury[Middlebury.length] = createMarker(new GPoint(-85.73428300,41.61751200),"
Eight Square School
60517 County Road 35
Middlebury, IN 46540
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eight Square School",'Middlebury=' + Middlebury.length); Elkhart[Elkhart.length] = createMarker(new GPoint(-85.92822400,41.70218800),"
Elkhart Adventist Christian School
3601 E Bristol Street
Elkhart, IN 46514
Co-ed school, 1-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elkhart Adventist Christian School",'Elkhart=' + Elkhart.length); Elkhart[Elkhart.length] = createMarker(new GPoint(-85.96349200,41.63789900),"
Elkhart Christian Academy
25943 County Road 22
Elkhart, IN 46517
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elkhart Christian Academy",'Elkhart=' + Elkhart.length); Elkhart[Elkhart.length] = createMarker(new GPoint(-85.92475300,41.70206300),"
Elkhart S D A School
23818 County Road 10
Elkhart, IN 46514
Co-ed school, KG-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elkhart S D A School",'Elkhart=' + Elkhart.length); Middlebury[Middlebury.length] = createMarker(new GPoint(-85.67122200,41.62791700),"
Forest Grove School
59800 County Road 43
Middlebury, IN 46540
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Forest Grove School",'Middlebury=' + Middlebury.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.82841600,41.56556300),"
Goshen College Laboratory Kindergarten
1700 S Main Street
Goshen, IN 46526
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Goshen College Laboratory Kindergarten",'Goshen=' + Goshen.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.82510000,41.61010000),"
Grace Christian School
64640 Cr37
Goshen, IN 46528
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Christian School",'Goshen=' + Goshen.length); Middlebury[Middlebury.length] = createMarker(new GPoint(-85.70060000,41.68630000),"
Grace Christian School
13804 Cr-20
Middlebury, IN 46540
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Christian School",'Middlebury=' + Middlebury.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.84690000,41.56810000),"
Harrison Christian School
64784 County Road 11
Goshen, IN 46526
Co-ed school, 1-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harrison Christian School",'Goshen=' + Goshen.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.73334800,41.58483800),"
Hillside Amish School
62787 County Road 35
Goshen, IN 46528
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hillside Amish School",'Goshen=' + Goshen.length); Bristol[Bristol.length] = createMarker(new GPoint(-85.82750000,41.72050000),"
Kessington Christian School
19153 County Road 104
Bristol, IN 46507
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kessington Christian School",'Bristol=' + Bristol.length); Nappanee[Nappanee.length] = createMarker(new GPoint(-85.93242700,41.49369600),"
Meadow Valley School
24390 County Road 46
Nappanee, IN 46550
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Meadow Valley School",'Nappanee=' + Nappanee.length); Elkhart[Elkhart.length] = createMarker(new GPoint(-85.92412100,41.71664800),"
Michiana Christian Montessori School, Inc.
23830 County Road 106
Elkhart, IN 46514
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Michiana Christian Montessori School, Inc.",'Elkhart=' + Elkhart.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.79694200,41.56134900),"
Montessori Academy Of Goshen
2015 Lincolnway E
Goshen, IN 46526
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Academy Of Goshen",'Goshen=' + Goshen.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.79941600,41.55706700),"
Montessori Discovery House
2312 Eisenhower Dr
Goshen, IN 46526
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Discovery House",'Goshen=' + Goshen.length); Elkhart[Elkhart.length] = createMarker(new GPoint(-85.96998300,41.69343700),"
Montessori School Of Elkhart
1 Montessori Dr.
Elkhart, IN 46514
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori School Of Elkhart",'Elkhart=' + Elkhart.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.94123400,41.51571000),"
Morning Star School
24915 County Road 142
Goshen, IN 46526
Co-ed school, 1-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Morning Star School",'Goshen=' + Goshen.length); Granger[Granger.length] = createMarker(new GPoint(-86.04733300,41.72939100),"
New Creation Academy
30190 County Road 10
Granger, IN 46530
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Creation Academy",'Granger=' + Granger.length); Nappanee[Nappanee.length] = createMarker(new GPoint(-85.94375900,41.50607300),"
Old Brethren Christian School
68064 County Road 11
Nappanee, IN 46550
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Old Brethren Christian School",'Nappanee=' + Nappanee.length); Wakarusa[Wakarusa.length] = createMarker(new GPoint(-85.84690000,41.56810000),"
Old Order Mennonite Garden Spot School
29731 County Road 36
Wakarusa, IN 46573
Co-ed school, 1-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Old Order Mennonite Garden Spot School",'Wakarusa=' + Wakarusa.length); Middlebury[Middlebury.length] = createMarker(new GPoint(-85.76255000,41.63846300),"
Pine Creek Amish School
15512 County Road 20
Middlebury, IN 46540
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pine Creek Amish School",'Middlebury=' + Middlebury.length); Middlebury[Middlebury.length] = createMarker(new GPoint(-85.70060000,41.68630000),"
Plainview Amish School
11017 Cr 16
Middlebury, IN 46540
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Plainview Amish School",'Middlebury=' + Middlebury.length); Middlebury[Middlebury.length] = createMarker(new GPoint(-85.67852700,41.67613500),"
Plainview School
11017 County Road 16
Middlebury, IN 46540
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Plainview School",'Middlebury=' + Middlebury.length); Middlebury[Middlebury.length] = createMarker(new GPoint(-85.73476300,41.64414700),"
Pumpkin Vine School
58683 County Road 35
Middlebury, IN 46540
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pumpkin Vine School",'Middlebury=' + Middlebury.length); Elkhart[Elkhart.length] = createMarker(new GPoint(-85.97480000,41.71270000),"
Redeemer Community Christian School
24004 Old Us 20
Elkhart, IN 46516
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Redeemer Community Christian School",'Elkhart=' + Elkhart.length); Middlebury[Middlebury.length] = createMarker(new GPoint(-85.70060000,41.68630000),"
Rolling Acres School
54604 Cr 43
Middlebury, IN 46540
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rolling Acres School",'Middlebury=' + Middlebury.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.83479400,41.58133700),"
St. John The Evangelist
117 W Monroe Street
Goshen, IN 46526
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John The Evangelist",'Goshen=' + Goshen.length); Elkhart[Elkhart.length] = createMarker(new GPoint(-85.97652100,41.70126200),"
St. Thomas Elementary School
1331 N Main Street
Elkhart, IN 46514
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Thomas Elementary School",'Elkhart=' + Elkhart.length); Nappanee[Nappanee.length] = createMarker(new GPoint(-86.00121600,41.43534900),"
South Side Christian School
901 S Main Street
Nappanee, IN 46550
Co-ed school, 1-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Side Christian School",'Nappanee=' + Nappanee.length); Elkhart[Elkhart.length] = createMarker(new GPoint(-85.96499900,41.67762300),"
St Vincent De Paul Elementary School
1114 S Main Street
Elkhart, IN 46516
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Vincent De Paul Elementary School",'Elkhart=' + Elkhart.length); Millersburg[Millersburg.length] = createMarker(new GPoint(-85.65534600,41.54532900),"
Stoney Creek School
65491 East County Line Road
Millersburg, IN 46543
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Stoney Creek School",'Millersburg=' + Millersburg.length); Elkhart[Elkhart.length] = createMarker(new GPoint(-86.05985100,41.72433200),"
Trinity Lutheran School
30888 County Road 6
Elkhart, IN 46514
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Elkhart=' + Elkhart.length); Nappanee[Nappanee.length] = createMarker(new GPoint(-86.03099000,41.45706300),"
United Christian School
29522 County Road 52
Nappanee, IN 46550
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("United Christian School",'Nappanee=' + Nappanee.length); Wakarusa[Wakarusa.length] = createMarker(new GPoint(-86.03520000,41.53660000),"
Wabash School
66744 County Road 7
Wakarusa, IN 46573
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wabash School",'Wakarusa=' + Wakarusa.length); Nappanee[Nappanee.length] = createMarker(new GPoint(-86.04948800,41.45373600),"
Weldy Amish School
71772 County Road 100
Nappanee, IN 46550
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Weldy Amish School",'Nappanee=' + Nappanee.length); Nappanee[Nappanee.length] = createMarker(new GPoint(-85.94833900,41.45723800),"
West Union Center School
25230 County Road 52
Nappanee, IN 46550
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Union Center School",'Nappanee=' + Nappanee.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.84690000,41.56810000),"
Willow Spring School
65265 County Road 13
Goshen, IN 46526
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Willow Spring School",'Goshen=' + Goshen.length); Goshen[Goshen.length] = createMarker(new GPoint(-85.71667100,41.58157900),"
Woodlawn Christian School
13151 County Road 34
Goshen, IN 46528
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodlawn Christian School",'Goshen=' + Goshen.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,11); /* 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/////1/' + showArray); map.removeOverlays(Bristol); map.removeOverlays(Elkhart); map.removeOverlays(Goshen); map.removeOverlays(Granger); map.removeOverlays(Middlebury); map.removeOverlays(Millersburg); map.removeOverlays(Nappanee); map.removeOverlays(Wakarusa); 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(Goshen);map.removeOverlays(Bristol); map.removeOverlays(Elkhart); map.removeOverlays(Goshen); map.removeOverlays(Granger); map.removeOverlays(Middlebury); map.removeOverlays(Millersburg); map.removeOverlays(Nappanee); map.removeOverlays(Wakarusa); map.addOverlays(Bristol); centerByArray(Bristol, false, false); cntMarker += Bristol.length; map.addOverlays(Elkhart); centerByArray(Elkhart, false, false); cntMarker += Elkhart.length; map.addOverlays(Goshen); centerByArray(Goshen, false, false); cntMarker += Goshen.length; map.addOverlays(Granger); centerByArray(Granger, false, false); cntMarker += Granger.length; map.addOverlays(Middlebury); centerByArray(Middlebury, false, false); cntMarker += Middlebury.length; map.addOverlays(Millersburg); centerByArray(Millersburg, false, false); cntMarker += Millersburg.length; map.addOverlays(Nappanee); centerByArray(Nappanee, false, false); cntMarker += Nappanee.length; map.addOverlays(Wakarusa); centerByArray(Wakarusa, false, false); cntMarker += Wakarusa.length; centerByArray(Goshen,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'); //window.open('/map.php?type=1&schools=&school_level=1&radius=&zipcode=&school_type_search=&school_type_code='); } } function createMarker(point, label, icon) { var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }