function addMarkers(){ mySelect = document.getElementById('selection'); Menasha = [];Neenah = [];Oshkosh = [];mySelect.options[mySelect.options.length] = new Option("Menasha schools",'all=Menasha'); mySelect.options[mySelect.options.length] = new Option("Neenah schools",'all=Neenah'); mySelect.options[mySelect.options.length] = new Option("Oshkosh schools",'all=Oshkosh'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Menasha[Menasha.length] = createMarker(new GPoint(-88.43408200,44.21408400),"
Bethel Lutheran School
829 Appleton Road
Menasha, WI 54952
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethel Lutheran School",'Menasha=' + Menasha.length); Neenah[Neenah.length] = createMarker(new GPoint(-88.46195400,44.18609500),"
Fox Valley Christian Academy
Po Box 799
Neenah, WI 54957
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fox Valley Christian Academy",'Neenah=' + Neenah.length); Neenah[Neenah.length] = createMarker(new GPoint(-88.48532800,44.18551900),"
Fox Valley Sda School
265 S Green Bay Road
Neenah, WI 54956
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fox Valley Sda School",'Neenah=' + Neenah.length); Oshkosh[Oshkosh.length] = createMarker(new GPoint(-88.54057400,44.01020100),"
Grace Lutheran School
913 Nebraska St
Oshkosh, WI 54902
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Lutheran School",'Oshkosh=' + Oshkosh.length); Oshkosh[Oshkosh.length] = createMarker(new GPoint(-88.55855000,44.03572700),"
Martin Luther Lutheran School
1526 Algoma Blvd
Oshkosh, WI 54901
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Martin Luther Lutheran School",'Oshkosh=' + Oshkosh.length); Neenah[Neenah.length] = createMarker(new GPoint(-88.47566100,44.18333700),"
Martin Luther Lutheran School
807 Adams Street
Neenah, WI 54956
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Martin Luther Lutheran School",'Neenah=' + Neenah.length); Neenah[Neenah.length] = createMarker(new GPoint(-88.47029700,44.22578500),"
New Hope Christian School
1850 American Drive
Neenah, WI 54956
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Hope Christian School",'Neenah=' + Neenah.length); Oshkosh[Oshkosh.length] = createMarker(new GPoint(-88.55288000,44.06403200),"
Oshkosh Christian School/Valley Christian High School
3450 Vinland Rd.
Oshkosh, WI 54901
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oshkosh Christian School/Valley Christian High School",'Oshkosh=' + Oshkosh.length); Menasha[Menasha.length] = createMarker(new GPoint(-88.44216800,44.20743700),"
St. John The Baptist School
628 Fifth Street
Menasha, WI 54952
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John The Baptist School",'Menasha=' + Menasha.length); Menasha[Menasha.length] = createMarker(new GPoint(-88.45395400,44.19377900),"
Seton Catholic Middle School
312 Nicolet Blvd
Menasha, WI 54952
Co-ed school, 6-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Seton Catholic Middle School",'Menasha=' + Menasha.length); Oshkosh[Oshkosh.length] = createMarker(new GPoint(-88.54269000,44.00731100),"
St Elizabeth Ann Seton School
1207 Oregon Street
Oshkosh, WI 54902
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Elizabeth Ann Seton School",'Oshkosh=' + Oshkosh.length); Oshkosh[Oshkosh.length] = createMarker(new GPoint(-88.52955100,44.01956300),"
St Frances Cabrini Elementary School
619 Merritt Avenue
Oshkosh, WI 54901
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Frances Cabrini Elementary School",'Oshkosh=' + Oshkosh.length); Neenah[Neenah.length] = createMarker(new GPoint(-88.45709400,44.17845300),"
St Margaret Mary School
610 Division Street
Neenah, WI 54956
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Margaret Mary School",'Neenah=' + Neenah.length); Menasha[Menasha.length] = createMarker(new GPoint(-88.44490900,44.20393700),"
St Mary Elementary School
540 2nd Street
Menasha, WI 54952
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mary Elementary School",'Menasha=' + Menasha.length); Menasha[Menasha.length] = createMarker(new GPoint(-88.45300800,44.20223700),"
Trinity Lutheran School
300 Broad Street
Menasha, WI 54952
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Menasha=' + Menasha.length); Neenah[Neenah.length] = createMarker(new GPoint(-88.45927600,44.18206400),"
Trinity Lutheran School
410 Oak Street
Neenah, WI 54956
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Neenah=' + Neenah.length); Oshkosh[Oshkosh.length] = createMarker(new GPoint(-88.52711000,44.01609100),"
Trinity Lutheran School
819 School Avenue
Oshkosh, WI 54901
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Oshkosh=' + Oshkosh.length); Oshkosh[Oshkosh.length] = createMarker(new GPoint(-88.58289000,44.01492100),"
Wee Wisdom Day Care Center
333 S Washburn Street
Oshkosh, WI 54904
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wee Wisdom Day Care Center",'Oshkosh=' + Oshkosh.length); Oshkosh[Oshkosh.length] = createMarker(new GPoint(-88.60959500,44.01840000),"
Wyldewood Christian School
3030 Witzel Avenue
Oshkosh, WI 54904
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wyldewood Christian School",'Oshkosh=' + Oshkosh.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(Menasha); map.removeOverlays(Neenah); map.removeOverlays(Oshkosh); 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(Menasha);map.removeOverlays(Menasha); map.removeOverlays(Neenah); map.removeOverlays(Oshkosh); map.addOverlays(Menasha); centerByArray(Menasha, false, false); cntMarker += Menasha.length; map.addOverlays(Neenah); centerByArray(Neenah, false, false); cntMarker += Neenah.length; map.addOverlays(Oshkosh); centerByArray(Oshkosh, false, false); cntMarker += Oshkosh.length; centerByArray(Menasha,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; }