function addMarkers(){ mySelect = document.getElementById('selection'); Oakdale = [];Benson = [];Wykoff = [];Cloquet = [];Nashwauk = [];Coon_Rapids = [];Emily = [];Remer = [];Owatonna = [];Hinckley = [];Park_Rapids = [];Grand_Rapids = [];Saint_Paul_Park = [];Becker = [];North_Mankato = [];New_Ulm = [];Prior_Lake = [];Grove_City = [];Rochester = [];Elk_River = [];Cologne = [];Westbrook = [];Le_Center = [];mySelect.options[mySelect.options.length] = new Option("Becker schools",'all=Becker'); mySelect.options[mySelect.options.length] = new Option("Benson schools",'all=Benson'); mySelect.options[mySelect.options.length] = new Option("Cloquet schools",'all=Cloquet'); mySelect.options[mySelect.options.length] = new Option("Cologne schools",'all=Cologne'); mySelect.options[mySelect.options.length] = new Option("Coon Rapids schools",'all=Coon_Rapids'); mySelect.options[mySelect.options.length] = new Option("Elk River schools",'all=Elk_River'); mySelect.options[mySelect.options.length] = new Option("Emily schools",'all=Emily'); mySelect.options[mySelect.options.length] = new Option("Grand Rapids schools",'all=Grand_Rapids'); mySelect.options[mySelect.options.length] = new Option("Grove City schools",'all=Grove_City'); mySelect.options[mySelect.options.length] = new Option("Hinckley schools",'all=Hinckley'); mySelect.options[mySelect.options.length] = new Option("Le Center schools",'all=Le_Center'); mySelect.options[mySelect.options.length] = new Option("Nashwauk schools",'all=Nashwauk'); mySelect.options[mySelect.options.length] = new Option("New Ulm schools",'all=New_Ulm'); mySelect.options[mySelect.options.length] = new Option("North Mankato schools",'all=North_Mankato'); mySelect.options[mySelect.options.length] = new Option("Oakdale schools",'all=Oakdale'); mySelect.options[mySelect.options.length] = new Option("Owatonna schools",'all=Owatonna'); mySelect.options[mySelect.options.length] = new Option("Park Rapids schools",'all=Park_Rapids'); mySelect.options[mySelect.options.length] = new Option("Prior Lake schools",'all=Prior_Lake'); mySelect.options[mySelect.options.length] = new Option("Remer schools",'all=Remer'); mySelect.options[mySelect.options.length] = new Option("Rochester schools",'all=Rochester'); mySelect.options[mySelect.options.length] = new Option("Saint Paul Park schools",'all=Saint_Paul_Park'); mySelect.options[mySelect.options.length] = new Option("Westbrook schools",'all=Westbrook'); mySelect.options[mySelect.options.length] = new Option("Wykoff schools",'all=Wykoff'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Oakdale[Oakdale.length] = createMarker(new GPoint(-92.96586500,44.94917500),"
ABI Christian Academy
6944 Hudson Blvd N
Oakdale, MN 55128
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("ABI Christian Academy",'Oakdale=' + Oakdale.length); Benson[Benson.length] = createMarker(new GPoint(-95.55600000,45.30600000),"
Benson Christian School
Po Box 195
Benson, MN 56215
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Benson Christian School",'Benson=' + Benson.length); Wykoff[Wykoff.length] = createMarker(new GPoint(-92.26660000,43.71780000),"
Christian Heritage High School
Po Box 157
Wykoff, MN 55990
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Heritage High School",'Wykoff=' + Wykoff.length); Cloquet[Cloquet.length] = createMarker(new GPoint(-92.44495300,46.70883700),"
Cloquet Christian Academy
1705 Wilson Avenue
Cloquet, MN 55720
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cloquet Christian Academy",'Cloquet=' + Cloquet.length); Nashwauk[Nashwauk.length] = createMarker(new GPoint(-93.21525800,47.42106300),"
Cloverdale Christian School
16867 Creek Road
Nashwauk, MN 55769
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cloverdale Christian School",'Nashwauk=' + Nashwauk.length); Coon_Rapids[Coon_Rapids.length] = createMarker(new GPoint(-93.31799400,45.17344400),"
Coon Rapids Christian School
11164 Hanson Blvd Nw
Coon Rapids, MN 55433
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Coon Rapids Christian School",'Coon_Rapids=' + Coon_Rapids.length); Emily[Emily.length] = createMarker(new GPoint(-93.93948700,46.75298400),"
Cornerstone Christian School
41536 Birchwood Drive
Emily, MN 56447
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone Christian School",'Emily=' + Emily.length); Remer[Remer.length] = createMarker(new GPoint(-93.96900000,47.04690000),"
Eagle Country Christian Academy
Box 99
Remer, MN 56672
Co-ed school, 3-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eagle Country Christian Academy",'Remer=' + Remer.length); Owatonna[Owatonna.length] = createMarker(new GPoint(-93.22640800,44.10846300),"
El Shaddai Private School
2429 N Cedar Avenue
Owatonna, MN 55060
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("El Shaddai Private School",'Owatonna=' + Owatonna.length); Hinckley[Hinckley.length] = createMarker(new GPoint(-92.84710000,46.01880000),"
Faith Baptist Academy
601 2nd St Se, Po Box 191
Hinckley, MN 55037
Co-ed school, 7-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Baptist Academy",'Hinckley=' + Hinckley.length); Park_Rapids[Park_Rapids.length] = createMarker(new GPoint(-95.06832100,46.91484100),"
First Baptist Christian School
909 8th Street W
Park Rapids, MN 56470
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Baptist Christian School",'Park_Rapids=' + Park_Rapids.length); Grand_Rapids[Grand_Rapids.length] = createMarker(new GPoint(-93.56585400,47.22117200),"
Grace Christian School
2452 County Road 76
Grand Rapids, MN 55744
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Christian School",'Grand_Rapids=' + Grand_Rapids.length); Saint_Paul_Park[Saint_Paul_Park.length] = createMarker(new GPoint(-92.98850100,44.84040300),"
Hope Christian Academy
Holley Avenue, Suite 2
Saint Paul Park, MN 55071
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hope Christian Academy",'Saint_Paul_Park=' + Saint_Paul_Park.length); Becker[Becker.length] = createMarker(new GPoint(-93.84070400,45.48534300),"
Jubilee Christian School
15455 59th Street
Becker, MN 55308
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jubilee Christian School",'Becker=' + Becker.length); North_Mankato[North_Mankato.length] = createMarker(new GPoint(-94.00788900,44.18239900),"
Maranatha Christian Academy - Mca
1124 N River Drive
North Mankato, MN 56003
Co-ed school, 4-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Maranatha Christian Academy - Mca",'North_Mankato=' + North_Mankato.length); New_Ulm[New_Ulm.length] = createMarker(new GPoint(-94.46411400,44.30605100),"
New Ulm Christian School
315 S Payne Street
New Ulm, MN 56073
Co-ed school, 2-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Ulm Christian School",'New_Ulm=' + New_Ulm.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.40572000,44.70535200),"
Prior Lake Christian School
5690 Credit River Road Se
Prior Lake, MN 55372
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Prior Lake Christian School",'Prior_Lake=' + Prior_Lake.length); Grove_City[Grove_City.length] = createMarker(new GPoint(-94.69683500,45.19984300),"
Riverview Christian School
32493 520th Avenue
Grove City, MN 56243
Co-ed school, 1-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Riverview Christian School",'Grove_City=' + Grove_City.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.40771600,44.01643700),"
Rochester Pentecostal School
3657 Sheffield Lane Se
Rochester, MN 55904
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rochester Pentecostal School",'Rochester=' + Rochester.length); Elk_River[Elk_River.length] = createMarker(new GPoint(-93.56696000,45.32707900),"
Solid Rock Christian Academy
11800 196th Avenue Nw
Elk River, MN 55330
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Solid Rock Christian Academy",'Elk_River=' + Elk_River.length); Cologne[Cologne.length] = createMarker(new GPoint(-93.78027400,44.77364500),"
St Bernard Elementary School
300 Church Street E
Cologne, MN 55322
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Bernard Elementary School",'Cologne=' + Cologne.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.40891300,44.01613600),"
Victory Christian Academy
606 36th Avenue Se
Rochester, MN 55904
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Victory Christian Academy",'Rochester=' + Rochester.length); Westbrook[Westbrook.length] = createMarker(new GPoint(-95.43669900,44.04196300),"
Westbrook Christian School
Po Box 247
Westbrook, MN 56183
Co-ed school, 9-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westbrook Christian School",'Westbrook=' + Westbrook.length); Le_Center[Le_Center.length] = createMarker(new GPoint(-93.71970000,44.38580000),"
Yeshua Christian Academy
Po Box 15
Le Center, MN 56057
Co-ed school, 3-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Yeshua Christian Academy",'Le_Center=' + Le_Center.length); map.removeOverlays(Becker); map.removeOverlays(Benson); map.removeOverlays(Cloquet); map.removeOverlays(Cologne); map.removeOverlays(Coon_Rapids); map.removeOverlays(Elk_River); map.removeOverlays(Emily); map.removeOverlays(Grand_Rapids); map.removeOverlays(Grove_City); map.removeOverlays(Hinckley); map.removeOverlays(Le_Center); map.removeOverlays(Nashwauk); map.removeOverlays(New_Ulm); map.removeOverlays(North_Mankato); map.removeOverlays(Oakdale); map.removeOverlays(Owatonna); map.removeOverlays(Park_Rapids); map.removeOverlays(Prior_Lake); map.removeOverlays(Remer); map.removeOverlays(Rochester); map.removeOverlays(Saint_Paul_Park); map.removeOverlays(Westbrook); map.removeOverlays(Wykoff); setTimeout(function(){map.addOverlays(Becker)},1000); setTimeout(function(){map.addOverlays(Benson)},1000); setTimeout(function(){map.addOverlays(Cloquet)},1000); setTimeout(function(){map.addOverlays(Cologne)},1000); setTimeout(function(){map.addOverlays(Coon_Rapids)},1000); setTimeout(function(){map.addOverlays(Elk_River)},1000); setTimeout(function(){map.addOverlays(Emily)},1000); setTimeout(function(){map.addOverlays(Grand_Rapids)},1000); setTimeout(function(){map.addOverlays(Grove_City)},1000); setTimeout(function(){map.addOverlays(Hinckley)},1000); setTimeout(function(){map.addOverlays(Le_Center)},1000); setTimeout(function(){map.addOverlays(Nashwauk)},1000); setTimeout(function(){map.addOverlays(New_Ulm)},1000); setTimeout(function(){map.addOverlays(North_Mankato)},1000); setTimeout(function(){map.addOverlays(Oakdale)},1000); setTimeout(function(){map.addOverlays(Owatonna)},1000); setTimeout(function(){map.addOverlays(Park_Rapids)},1000); setTimeout(function(){map.addOverlays(Prior_Lake)},1000); setTimeout(function(){map.addOverlays(Remer)},1000); setTimeout(function(){map.addOverlays(Rochester)},1000); setTimeout(function(){map.addOverlays(Saint_Paul_Park)},1000); setTimeout(function(){map.addOverlays(Westbrook)},1000); setTimeout(function(){map.addOverlays(Wykoff)},1000); maxLng = -92.26660000; maxLat = 47.42106300; minLng = -95.55600000; minLat = 43.71780000; 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(Becker); map.removeOverlays(Benson); map.removeOverlays(Cloquet); map.removeOverlays(Cologne); map.removeOverlays(Coon_Rapids); map.removeOverlays(Elk_River); map.removeOverlays(Emily); map.removeOverlays(Grand_Rapids); map.removeOverlays(Grove_City); map.removeOverlays(Hinckley); map.removeOverlays(Le_Center); map.removeOverlays(Nashwauk); map.removeOverlays(New_Ulm); map.removeOverlays(North_Mankato); map.removeOverlays(Oakdale); map.removeOverlays(Owatonna); map.removeOverlays(Park_Rapids); map.removeOverlays(Prior_Lake); map.removeOverlays(Remer); map.removeOverlays(Rochester); map.removeOverlays(Saint_Paul_Park); map.removeOverlays(Westbrook); map.removeOverlays(Wykoff); 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(Oakdale);map.removeOverlays(Becker); map.removeOverlays(Benson); map.removeOverlays(Cloquet); map.removeOverlays(Cologne); map.removeOverlays(Coon_Rapids); map.removeOverlays(Elk_River); map.removeOverlays(Emily); map.removeOverlays(Grand_Rapids); map.removeOverlays(Grove_City); map.removeOverlays(Hinckley); map.removeOverlays(Le_Center); map.removeOverlays(Nashwauk); map.removeOverlays(New_Ulm); map.removeOverlays(North_Mankato); map.removeOverlays(Oakdale); map.removeOverlays(Owatonna); map.removeOverlays(Park_Rapids); map.removeOverlays(Prior_Lake); map.removeOverlays(Remer); map.removeOverlays(Rochester); map.removeOverlays(Saint_Paul_Park); map.removeOverlays(Westbrook); map.removeOverlays(Wykoff); map.addOverlays(Becker); centerByArray(Becker, false, false); cntMarker += Becker.length; map.addOverlays(Benson); centerByArray(Benson, false, false); cntMarker += Benson.length; map.addOverlays(Cloquet); centerByArray(Cloquet, false, false); cntMarker += Cloquet.length; map.addOverlays(Cologne); centerByArray(Cologne, false, false); cntMarker += Cologne.length; map.addOverlays(Coon_Rapids); centerByArray(Coon_Rapids, false, false); cntMarker += Coon_Rapids.length; map.addOverlays(Elk_River); centerByArray(Elk_River, false, false); cntMarker += Elk_River.length; map.addOverlays(Emily); centerByArray(Emily, false, false); cntMarker += Emily.length; map.addOverlays(Grand_Rapids); centerByArray(Grand_Rapids, false, false); cntMarker += Grand_Rapids.length; map.addOverlays(Grove_City); centerByArray(Grove_City, false, false); cntMarker += Grove_City.length; map.addOverlays(Hinckley); centerByArray(Hinckley, false, false); cntMarker += Hinckley.length; map.addOverlays(Le_Center); centerByArray(Le_Center, false, false); cntMarker += Le_Center.length; map.addOverlays(Nashwauk); centerByArray(Nashwauk, false, false); cntMarker += Nashwauk.length; map.addOverlays(New_Ulm); centerByArray(New_Ulm, false, false); cntMarker += New_Ulm.length; map.addOverlays(North_Mankato); centerByArray(North_Mankato, false, false); cntMarker += North_Mankato.length; map.addOverlays(Oakdale); centerByArray(Oakdale, false, false); cntMarker += Oakdale.length; map.addOverlays(Owatonna); centerByArray(Owatonna, false, false); cntMarker += Owatonna.length; map.addOverlays(Park_Rapids); centerByArray(Park_Rapids, false, false); cntMarker += Park_Rapids.length; map.addOverlays(Prior_Lake); centerByArray(Prior_Lake, false, false); cntMarker += Prior_Lake.length; map.addOverlays(Remer); centerByArray(Remer, false, false); cntMarker += Remer.length; map.addOverlays(Rochester); centerByArray(Rochester, false, false); cntMarker += Rochester.length; map.addOverlays(Saint_Paul_Park); centerByArray(Saint_Paul_Park, false, false); cntMarker += Saint_Paul_Park.length; map.addOverlays(Westbrook); centerByArray(Westbrook, false, false); cntMarker += Westbrook.length; map.addOverlays(Wykoff); centerByArray(Wykoff, false, false); cntMarker += Wykoff.length; centerByArray(Oakdale,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///14973,15240,14865,15099,14912,15076,14888,15335,14857,33170,33169,14883,14897,15066,14878,15079,15322,7751,15326,14854,14973,14814,15240,15127,14865,15099,14866,14912,15076,15335,14857,15036,33170,33169,14883,14897,15066,14878,15079,15322,7751,/all'); //window.open('/map.php?type=2&schools=14973,15240,14865,15099,14912,15076,14888,15335,14857,33170,33169,14883,14897,15066,14878,15079,15322,7751,15326,14854,14973,14814,15240,15127,14865,15099,14866,14912,15076,15335,14857,15036,33170,33169,14883,14897,15066,14878,15079,15322,7751,&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; }