function addMarkers(){ mySelect = document.getElementById('selection'); Oakdale = [];Mahtomedi = [];Woodbury = [];Forest_Lake = [];Saint_Paul_Park = [];Cottage_Grove = [];Hastings = [];Stillwater = [];Saint_Paul = [];mySelect.options[mySelect.options.length] = new Option("Cottage Grove schools",'all=Cottage_Grove'); mySelect.options[mySelect.options.length] = new Option("Forest Lake schools",'all=Forest_Lake'); mySelect.options[mySelect.options.length] = new Option("Hastings schools",'all=Hastings'); mySelect.options[mySelect.options.length] = new Option("Mahtomedi schools",'all=Mahtomedi'); mySelect.options[mySelect.options.length] = new Option("Oakdale schools",'all=Oakdale'); mySelect.options[mySelect.options.length] = new Option("Saint Paul schools",'all=Saint_Paul'); mySelect.options[mySelect.options.length] = new Option("Saint Paul Park schools",'all=Saint_Paul_Park'); mySelect.options[mySelect.options.length] = new Option("Stillwater schools",'all=Stillwater'); mySelect.options[mySelect.options.length] = new Option("Woodbury schools",'all=Woodbury'); 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); Mahtomedi[Mahtomedi.length] = createMarker(new GPoint(-92.94877500,45.07186300),"
Countryview Montessori School
328 Maple Street
Mahtomedi, MN 55115
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Countryview Montessori School",'Mahtomedi=' + Mahtomedi.length); Oakdale[Oakdale.length] = createMarker(new GPoint(-92.98460500,44.96222500),"
Daidea Child Development Center
949 Geneva Avenue N
Oakdale, MN 55128
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Daidea Child Development Center",'Oakdale=' + Oakdale.length); Woodbury[Woodbury.length] = createMarker(new GPoint(-92.92185300,44.93917100),"
Footprints Academy
9025 Tamarack Road
Woodbury, MN 55125
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Footprints Academy",'Woodbury=' + Woodbury.length); Forest_Lake[Forest_Lake.length] = createMarker(new GPoint(-92.97451300,45.26076700),"
Forest Lake Montessori School
807 Highway 97 Se Box 425
Forest Lake, MN 55025
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Forest Lake Montessori School",'Forest_Lake=' + Forest_Lake.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); Cottage_Grove[Cottage_Grove.length] = createMarker(new GPoint(-92.93533100,44.81737400),"
Kinder Care Learning Center
8453 E Pt Douglas Road S
Cottage Grove, MN 55016
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kinder Care Learning Center",'Cottage_Grove=' + Cottage_Grove.length); Oakdale[Oakdale.length] = createMarker(new GPoint(-92.95155900,44.96341000),"
Miniapple International Montessori
780 Helmo Avenue North
Oakdale, MN 55128
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Miniapple International Montessori",'Oakdale=' + Oakdale.length); Cottage_Grove[Cottage_Grove.length] = createMarker(new GPoint(-92.92715100,44.84101800),"
Montessori Day
7483 Isleton Ave S
Cottage Grove, MN 55016
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Day",'Cottage_Grove=' + Cottage_Grove.length); Woodbury[Woodbury.length] = createMarker(new GPoint(-92.97039800,44.89096000),"
New Life Academy
6758 Bailey Road
Woodbury, MN 55125
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Life Academy",'Woodbury=' + Woodbury.length); Hastings[Hastings.length] = createMarker(new GPoint(-92.81275900,44.72801000),"
Pine Harbor Christian Academy
11125 Point Douglas Dr S P O Box 54
Hastings, MN 55033
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pine Harbor Christian Academy",'Hastings=' + Hastings.length); Woodbury[Woodbury.length] = createMarker(new GPoint(-92.90311500,44.88898900),"
St. Ambrose Of Woodbury Catholic School
4125 Woodbury Drive
Woodbury, MN 55129
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Ambrose Of Woodbury Catholic School",'Woodbury=' + Woodbury.length); Saint_Paul_Park[Saint_Paul_Park.length] = createMarker(new GPoint(-92.98865400,44.84017900),"
St. Andrew Lutheran School
1001 Holley Avenue
Saint Paul Park, MN 55071
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Andrew Lutheran School",'Saint_Paul_Park=' + Saint_Paul_Park.length); Stillwater[Stillwater.length] = createMarker(new GPoint(-92.80647100,45.05097800),"
St. Croix Catholic School
621 South Third Strreet
Stillwater, MN 55082
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Croix Catholic School",'Stillwater=' + Stillwater.length); Stillwater[Stillwater.length] = createMarker(new GPoint(-92.84260200,44.95137600),"
St. Croix Montessori
177 Neal Ave N
Stillwater, MN 55082
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Croix Montessori",'Stillwater=' + Stillwater.length); Saint_Paul[Saint_Paul.length] = createMarker(new GPoint(-92.95786900,45.06321500),"
St. Jude Of The Lake School
600 Mahtomedi Avenue
Saint Paul, MN 55115
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Jude Of The Lake School",'Saint_Paul=' + Saint_Paul.length); Forest_Lake[Forest_Lake.length] = createMarker(new GPoint(-92.97349400,45.26574000),"
St. Peter Elementary School
1250 S Shore Drive
Forest Lake, MN 55025
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Peter Elementary School",'Forest_Lake=' + Forest_Lake.length); Stillwater[Stillwater.length] = createMarker(new GPoint(-92.80395100,45.03933700),"
Salem Lutheran School
14940 62nd Street N
Stillwater, MN 55082
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Salem Lutheran School",'Stillwater=' + Stillwater.length); Mahtomedi[Mahtomedi.length] = createMarker(new GPoint(-92.94732400,45.05725600),"
St Andrews Academy
900 Stillwater Road
Mahtomedi, MN 55115
Co-ed school, K-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Andrews Academy",'Mahtomedi=' + Mahtomedi.length); Oakdale[Oakdale.length] = createMarker(new GPoint(-87.69418400,41.97335100),"
Transfiguration Elementary School
6135 15th Street N
Oakdale, MN 55128
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Transfiguration Elementary School",'Oakdale=' + Oakdale.length); Woodbury[Woodbury.length] = createMarker(new GPoint(-92.95638200,44.92349500),"
Woodbury Lutheran Preschool And Kindergarten
7380 Afton Road
Woodbury, MN 55125
school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodbury Lutheran Preschool And Kindergarten",'Woodbury=' + Woodbury.length); Woodbury[Woodbury.length] = createMarker(new GPoint(-92.97952900,44.93893200),"
Woodview Terrace Montessori
6255 Upper Afton Road
Woodbury, MN 55125
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodview Terrace Montessori",'Woodbury=' + Woodbury.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/////3/' + showArray); map.removeOverlays(Cottage_Grove); map.removeOverlays(Forest_Lake); map.removeOverlays(Hastings); map.removeOverlays(Mahtomedi); map.removeOverlays(Oakdale); map.removeOverlays(Saint_Paul); map.removeOverlays(Saint_Paul_Park); map.removeOverlays(Stillwater); map.removeOverlays(Woodbury); 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(Cottage_Grove); map.removeOverlays(Forest_Lake); map.removeOverlays(Hastings); map.removeOverlays(Mahtomedi); map.removeOverlays(Oakdale); map.removeOverlays(Saint_Paul); map.removeOverlays(Saint_Paul_Park); map.removeOverlays(Stillwater); map.removeOverlays(Woodbury); map.addOverlays(Cottage_Grove); centerByArray(Cottage_Grove, false, false); cntMarker += Cottage_Grove.length; map.addOverlays(Forest_Lake); centerByArray(Forest_Lake, false, false); cntMarker += Forest_Lake.length; map.addOverlays(Hastings); centerByArray(Hastings, false, false); cntMarker += Hastings.length; map.addOverlays(Mahtomedi); centerByArray(Mahtomedi, false, false); cntMarker += Mahtomedi.length; map.addOverlays(Oakdale); centerByArray(Oakdale, false, false); cntMarker += Oakdale.length; map.addOverlays(Saint_Paul); centerByArray(Saint_Paul, false, false); cntMarker += Saint_Paul.length; map.addOverlays(Saint_Paul_Park); centerByArray(Saint_Paul_Park, false, false); cntMarker += Saint_Paul_Park.length; map.addOverlays(Stillwater); centerByArray(Stillwater, false, false); cntMarker += Stillwater.length; map.addOverlays(Woodbury); centerByArray(Woodbury, false, false); cntMarker += Woodbury.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////all'); //window.open('/map.php?type=1&schools=&school_level=3&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; }