function addMarkers(){ mySelect = document.getElementById('selection'); Wisconsin_Rapids = [];Beloit = [];Pewaukee = [];Milwaukee = [];Pembine = [];Cedarburg = [];Wauwatosa = [];Jackson = [];Sheboygan = [];Waukesha = [];Crandon = [];Neenah = [];Green_Bay = [];Delavan = [];Mayville = [];Menasha = [];Mosinee = [];Greenleaf = [];mySelect.options[mySelect.options.length] = new Option("Beloit schools",'all=Beloit'); mySelect.options[mySelect.options.length] = new Option("Cedarburg schools",'all=Cedarburg'); mySelect.options[mySelect.options.length] = new Option("Crandon schools",'all=Crandon'); mySelect.options[mySelect.options.length] = new Option("Delavan schools",'all=Delavan'); mySelect.options[mySelect.options.length] = new Option("Green Bay schools",'all=Green_Bay'); mySelect.options[mySelect.options.length] = new Option("Greenleaf schools",'all=Greenleaf'); mySelect.options[mySelect.options.length] = new Option("Jackson schools",'all=Jackson'); mySelect.options[mySelect.options.length] = new Option("Mayville schools",'all=Mayville'); mySelect.options[mySelect.options.length] = new Option("Menasha schools",'all=Menasha'); mySelect.options[mySelect.options.length] = new Option("Milwaukee schools",'all=Milwaukee'); mySelect.options[mySelect.options.length] = new Option("Mosinee schools",'all=Mosinee'); mySelect.options[mySelect.options.length] = new Option("Neenah schools",'all=Neenah'); mySelect.options[mySelect.options.length] = new Option("Pembine schools",'all=Pembine'); mySelect.options[mySelect.options.length] = new Option("Pewaukee schools",'all=Pewaukee'); mySelect.options[mySelect.options.length] = new Option("Sheboygan schools",'all=Sheboygan'); mySelect.options[mySelect.options.length] = new Option("Waukesha schools",'all=Waukesha'); mySelect.options[mySelect.options.length] = new Option("Wauwatosa schools",'all=Wauwatosa'); mySelect.options[mySelect.options.length] = new Option("Wisconsin Rapids schools",'all=Wisconsin_Rapids'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Wisconsin_Rapids[Wisconsin_Rapids.length] = createMarker(new GPoint(-89.82544400,44.38469200),"
Assumption Middle School
440 Mead Street
Wisconsin Rapids, WI 54494
Co-ed school, 7-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Assumption Middle School",'Wisconsin_Rapids=' + Wisconsin_Rapids.length); Beloit[Beloit.length] = createMarker(new GPoint(-89.05128800,42.50389500),"
Brother Dutton School
717 Hackett Street
Beloit, WI 53511
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brother Dutton School",'Beloit=' + Beloit.length); Pewaukee[Pewaukee.length] = createMarker(new GPoint(-88.17235000,43.08588100),"
Children's Learning Center, Inc.
21005 Gumina Road
Pewaukee, WI 53072
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Children's Learning Center, Inc.",'Pewaukee=' + Pewaukee.length); Milwaukee[Milwaukee.length] = createMarker(new GPoint(-87.97006600,43.09624000),"
Christian Faith Academy
4340 N 46th Street
Milwaukee, WI 53216
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Faith Academy",'Milwaukee=' + Milwaukee.length); Pembine[Pembine.length] = createMarker(new GPoint(-87.99689300,45.58014000),"
Faith Baptist School
N17112 Us Highway 141
Pembine, WI 54156
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Baptist School",'Pembine=' + Pembine.length); Cedarburg[Cedarburg.length] = createMarker(new GPoint(-88.00140000,43.30290000),"
First Immanuel Lutheran School
W67n622 Evergreen Blvd
Cedarburg, WI 53012
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Immanuel Lutheran School",'Cedarburg=' + Cedarburg.length); Milwaukee[Milwaukee.length] = createMarker(new GPoint(-87.95657400,43.11280200),"
Imani Academy
5249 N 35th Street
Milwaukee, WI 53209
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Imani Academy",'Milwaukee=' + Milwaukee.length); Wauwatosa[Wauwatosa.length] = createMarker(new GPoint(-88.00932400,43.04671000),"
Kradwell School
1220 Dewey Avenue
Wauwatosa, WI 53213
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kradwell School",'Wauwatosa=' + Wauwatosa.length); Jackson[Jackson.length] = createMarker(new GPoint(-88.16626900,43.32266600),"
Living Word Lutheran High School
2230 Living Word Lane
Jackson, WI 53037
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Living Word Lutheran High School",'Jackson=' + Jackson.length); Sheboygan[Sheboygan.length] = createMarker(new GPoint(-87.73245500,43.76591800),"
Montessori Childrens House
1907 N 20th Street
Sheboygan, WI 53081
All-girls school, PK-K
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Montessori Childrens House",'Sheboygan=' + Sheboygan.length); Waukesha[Waukesha.length] = createMarker(new GPoint(-88.26768000,43.02153600),"
Montessori School Of Waukesha
2600 Summit Avenue
Waukesha, WI 53188
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori School Of Waukesha",'Waukesha=' + Waukesha.length); Crandon[Crandon.length] = createMarker(new GPoint(-88.88729900,45.57448900),"
New Hope Christian School
601 N Summit Drive
Crandon, WI 54520
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Hope Christian School",'Crandon=' + Crandon.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); Green_Bay[Green_Bay.length] = createMarker(new GPoint(-87.95353600,44.47720200),"
Northeastern Wisconsin Lutheran High School
1311 S Robinson Avenue
Green Bay, WI 54311
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northeastern Wisconsin Lutheran High School",'Green_Bay=' + Green_Bay.length); Delavan[Delavan.length] = createMarker(new GPoint(-88.65708100,42.62761700),"
Our Redeemer Lutheran School
416 W Geneva Street
Delavan, WI 53115
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Redeemer Lutheran School",'Delavan=' + Delavan.length); Green_Bay[Green_Bay.length] = createMarker(new GPoint(-88.06893400,44.50908600),"
Pilgrim Lutheran School
1731 Saint Agnes Drive
Green Bay, WI 54304
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pilgrim Lutheran School",'Green_Bay=' + Green_Bay.length); Milwaukee[Milwaukee.length] = createMarker(new GPoint(-87.94481100,43.01991700),"
Prince Of Peace School
1114 S 25th Street
Milwaukee, WI 53204
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Prince Of Peace School",'Milwaukee=' + Milwaukee.length); Sheboygan[Sheboygan.length] = createMarker(new GPoint(-87.73408900,43.76732000),"
St. Dominic Elementary School
2108 N 21st Street
Sheboygan, WI 53081
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Dominic Elementary School",'Sheboygan=' + Sheboygan.length); Mayville[Mayville.length] = createMarker(new GPoint(-88.54013400,43.49393700),"
St. Mary Elementary School
28 Naber Street
Mayville, WI 53050
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary Elementary School",'Mayville=' + Mayville.length); Milwaukee[Milwaukee.length] = createMarker(new GPoint(-88.02274400,43.08588300),"
St. Rose Youth & Family Center School
3801 North 88th Street
Milwaukee, WI 53222
All-girls school, 8-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("St. Rose Youth & Family Center School",'Milwaukee=' + Milwaukee.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); Neenah[Neenah.length] = createMarker(new GPoint(-88.48144500,44.18638100),"
St Gabriel Elementary School
900 Geiger Street
Neenah, WI 54956
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Gabriel Elementary School",'Neenah=' + Neenah.length); Milwaukee[Milwaukee.length] = createMarker(new GPoint(-87.90978700,43.05936200),"
St Marcus Lutheran School
2215 N Palmer Street
Milwaukee, WI 53212
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Marcus Lutheran School",'Milwaukee=' + Milwaukee.length); Milwaukee[Milwaukee.length] = createMarker(new GPoint(-87.91115100,43.15799200),"
Wisconsin Center For Gifted Learners
217 W Dunwood Rd
Milwaukee, WI 53217
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wisconsin Center For Gifted Learners",'Milwaukee=' + Milwaukee.length); Milwaukee[Milwaukee.length] = createMarker(new GPoint(-87.87206000,43.07728700),"
Wisconsin Institute For Torah Study
3288 North Lake Drive
Milwaukee, WI 53211
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Wisconsin Institute For Torah Study",'Milwaukee=' + Milwaukee.length); Mosinee[Mosinee.length] = createMarker(new GPoint(-89.68328300,44.81126500),"
Wisconsin Valley Lutheran High School
601 Maple Ridge Road
Mosinee, WI 54455
Co-ed school, 9-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wisconsin Valley Lutheran High School",'Mosinee=' + Mosinee.length); Greenleaf[Greenleaf.length] = createMarker(new GPoint(-88.03880000,44.28830000),"
Zion Lutheran School Of Wayside
8374 County Road W
Greenleaf, WI 54126
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zion Lutheran School Of Wayside",'Greenleaf=' + Greenleaf.length); map.removeOverlays(Beloit); map.removeOverlays(Cedarburg); map.removeOverlays(Crandon); map.removeOverlays(Delavan); map.removeOverlays(Green_Bay); map.removeOverlays(Greenleaf); map.removeOverlays(Jackson); map.removeOverlays(Mayville); map.removeOverlays(Menasha); map.removeOverlays(Milwaukee); map.removeOverlays(Mosinee); map.removeOverlays(Neenah); map.removeOverlays(Pembine); map.removeOverlays(Pewaukee); map.removeOverlays(Sheboygan); map.removeOverlays(Waukesha); map.removeOverlays(Wauwatosa); map.removeOverlays(Wisconsin_Rapids); setTimeout(function(){map.addOverlays(Beloit)},1000); setTimeout(function(){map.addOverlays(Cedarburg)},1000); setTimeout(function(){map.addOverlays(Crandon)},1000); setTimeout(function(){map.addOverlays(Delavan)},1000); setTimeout(function(){map.addOverlays(Green_Bay)},1000); setTimeout(function(){map.addOverlays(Greenleaf)},1000); setTimeout(function(){map.addOverlays(Jackson)},1000); setTimeout(function(){map.addOverlays(Mayville)},1000); setTimeout(function(){map.addOverlays(Menasha)},1000); setTimeout(function(){map.addOverlays(Milwaukee)},1000); setTimeout(function(){map.addOverlays(Mosinee)},1000); setTimeout(function(){map.addOverlays(Neenah)},1000); setTimeout(function(){map.addOverlays(Pembine)},1000); setTimeout(function(){map.addOverlays(Pewaukee)},1000); setTimeout(function(){map.addOverlays(Sheboygan)},1000); setTimeout(function(){map.addOverlays(Waukesha)},1000); setTimeout(function(){map.addOverlays(Wauwatosa)},1000); setTimeout(function(){map.addOverlays(Wisconsin_Rapids)},1000); maxLng = -87.73245500; maxLat = 45.58014000; minLng = -89.82544400; minLat = 42.50389500; reCenterMap(); } // 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//////' + showArray); map.removeOverlays(Beloit); map.removeOverlays(Cedarburg); map.removeOverlays(Crandon); map.removeOverlays(Delavan); map.removeOverlays(Green_Bay); map.removeOverlays(Greenleaf); map.removeOverlays(Jackson); map.removeOverlays(Mayville); map.removeOverlays(Menasha); map.removeOverlays(Milwaukee); map.removeOverlays(Mosinee); map.removeOverlays(Neenah); map.removeOverlays(Pembine); map.removeOverlays(Pewaukee); map.removeOverlays(Sheboygan); map.removeOverlays(Waukesha); map.removeOverlays(Wauwatosa); map.removeOverlays(Wisconsin_Rapids); 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(Wisconsin_Rapids);map.removeOverlays(Beloit); map.removeOverlays(Cedarburg); map.removeOverlays(Crandon); map.removeOverlays(Delavan); map.removeOverlays(Green_Bay); map.removeOverlays(Greenleaf); map.removeOverlays(Jackson); map.removeOverlays(Mayville); map.removeOverlays(Menasha); map.removeOverlays(Milwaukee); map.removeOverlays(Mosinee); map.removeOverlays(Neenah); map.removeOverlays(Pembine); map.removeOverlays(Pewaukee); map.removeOverlays(Sheboygan); map.removeOverlays(Waukesha); map.removeOverlays(Wauwatosa); map.removeOverlays(Wisconsin_Rapids); map.addOverlays(Beloit); centerByArray(Beloit, false, false); cntMarker += Beloit.length; map.addOverlays(Cedarburg); centerByArray(Cedarburg, false, false); cntMarker += Cedarburg.length; map.addOverlays(Crandon); centerByArray(Crandon, false, false); cntMarker += Crandon.length; map.addOverlays(Delavan); centerByArray(Delavan, false, false); cntMarker += Delavan.length; map.addOverlays(Green_Bay); centerByArray(Green_Bay, false, false); cntMarker += Green_Bay.length; map.addOverlays(Greenleaf); centerByArray(Greenleaf, false, false); cntMarker += Greenleaf.length; map.addOverlays(Jackson); centerByArray(Jackson, false, false); cntMarker += Jackson.length; map.addOverlays(Mayville); centerByArray(Mayville, false, false); cntMarker += Mayville.length; map.addOverlays(Menasha); centerByArray(Menasha, false, false); cntMarker += Menasha.length; map.addOverlays(Milwaukee); centerByArray(Milwaukee, false, false); cntMarker += Milwaukee.length; map.addOverlays(Mosinee); centerByArray(Mosinee, false, false); cntMarker += Mosinee.length; map.addOverlays(Neenah); centerByArray(Neenah, false, false); cntMarker += Neenah.length; map.addOverlays(Pembine); centerByArray(Pembine, false, false); cntMarker += Pembine.length; map.addOverlays(Pewaukee); centerByArray(Pewaukee, false, false); cntMarker += Pewaukee.length; map.addOverlays(Sheboygan); centerByArray(Sheboygan, false, false); cntMarker += Sheboygan.length; map.addOverlays(Waukesha); centerByArray(Waukesha, false, false); cntMarker += Waukesha.length; map.addOverlays(Wauwatosa); centerByArray(Wauwatosa, false, false); cntMarker += Wauwatosa.length; map.addOverlays(Wisconsin_Rapids); centerByArray(Wisconsin_Rapids, false, false); cntMarker += Wisconsin_Rapids.length; centerByArray(Wisconsin_Rapids,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///29737,29732,35745,30222,30301,35536,29528,29655,29401,29434,29548,29737,29779,29799,30321,30070,29871,35533,35781,29813,30058,30295,29739,29957,29528,30327,35535,29935,29716,29655,/all'); //window.open('/map.php?type=2&schools=29737,29732,35745,30222,30301,35536,29528,29655,29401,29434,29548,29737,29779,29799,30321,30070,29871,35533,35781,29813,30058,30295,29739,29957,29528,30327,35535,29935,29716,29655,&school_level=&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; }