function addMarkers(){ mySelect = document.getElementById('selection'); Lakeville = [];Eagan = [];Inver_Grove_Heights = [];Burnsville = [];Rosemount = [];Farmington = [];Saint_Paul = [];West_Saint_Paul = [];Apple_Valley = [];South_Saint_Paul = [];South_St_Paul = [];West_St_Paul = [];Hastings = [];Hampton = [];Vermillion = [];mySelect.options[mySelect.options.length] = new Option("Apple Valley schools",'all=Apple_Valley'); mySelect.options[mySelect.options.length] = new Option("Burnsville schools",'all=Burnsville'); mySelect.options[mySelect.options.length] = new Option("Eagan schools",'all=Eagan'); mySelect.options[mySelect.options.length] = new Option("Farmington schools",'all=Farmington'); mySelect.options[mySelect.options.length] = new Option("Hampton schools",'all=Hampton'); mySelect.options[mySelect.options.length] = new Option("Hastings schools",'all=Hastings'); mySelect.options[mySelect.options.length] = new Option("Inver Grove Heights schools",'all=Inver_Grove_Heights'); mySelect.options[mySelect.options.length] = new Option("Lakeville schools",'all=Lakeville'); mySelect.options[mySelect.options.length] = new Option("Rosemount schools",'all=Rosemount'); mySelect.options[mySelect.options.length] = new Option("Saint Paul schools",'all=Saint_Paul'); mySelect.options[mySelect.options.length] = new Option("South Saint Paul schools",'all=South_Saint_Paul'); mySelect.options[mySelect.options.length] = new Option("South St Paul schools",'all=South_St_Paul'); mySelect.options[mySelect.options.length] = new Option("Vermillion schools",'all=Vermillion'); mySelect.options[mySelect.options.length] = new Option("West Saint Paul schools",'all=West_Saint_Paul'); mySelect.options[mySelect.options.length] = new Option("West St Paul schools",'all=West_St_Paul'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Lakeville[Lakeville.length] = createMarker(new GPoint(-93.24281400,44.66229900),"
All Saints Catholic School
19795 Holyoke Avenue
Lakeville, MN 55044
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("All Saints Catholic School",'Lakeville=' + Lakeville.length); Eagan[Eagan.length] = createMarker(new GPoint(-93.20669400,44.80479600),"
Becks Montessori
1985 Diffley Road
Eagan, MN 55122
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Becks Montessori",'Eagan=' + Eagan.length); Inver_Grove_Heights[Inver_Grove_Heights.length] = createMarker(new GPoint(-93.09072600,44.81441700),"
Berea Lutheran School
9308 Rich Valley Boulevard
Inver Grove Heights, MN 55077
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Berea Lutheran School",'Inver_Grove_Heights=' + Inver_Grove_Heights.length); Burnsville[Burnsville.length] = createMarker(new GPoint(-93.27248400,44.74104600),"
Berean Education Center
309 County Road 42 E
Burnsville, MN 55306
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Berean Education Center",'Burnsville=' + Burnsville.length); Rosemount[Rosemount.length] = createMarker(new GPoint(-93.21706000,44.69853800),"
Christian Heritage Academy
17297 Glacier Way
Rosemount, MN 55068
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Heritage Academy",'Rosemount=' + Rosemount.length); Farmington[Farmington.length] = createMarker(new GPoint(-93.19305900,44.64156400),"
Christian Life School
6300 212th St West
Farmington, MN 55024
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Life School",'Farmington=' + Farmington.length); Saint_Paul[Saint_Paul.length] = createMarker(new GPoint(-93.13190900,44.86685200),"
Convent Of The Visitation School
2455 Visitation Drive
Saint Paul, MN 55120
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Convent Of The Visitation School",'Saint_Paul=' + Saint_Paul.length); West_Saint_Paul[West_Saint_Paul.length] = createMarker(new GPoint(-93.08860800,44.88733700),"
Crown Of Life Lutheran School
115 Crusader Avenue W
West Saint Paul, MN 55118
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crown Of Life Lutheran School",'West_Saint_Paul=' + West_Saint_Paul.length); Eagan[Eagan.length] = createMarker(new GPoint(-93.13679200,44.83435900),"
Faithful Shepherd Catholic
3355 Columbia Dr
Eagan, MN 55121
Co-ed school, KG-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faithful Shepherd Catholic",'Eagan=' + Eagan.length); Rosemount[Rosemount.length] = createMarker(new GPoint(-93.15621300,44.74155900),"
First Baptist Schools
Po Box 89 14400 Diamond Path W
Rosemount, MN 55068
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Baptist Schools",'Rosemount=' + Rosemount.length); Lakeville[Lakeville.length] = createMarker(new GPoint(-93.26791800,44.70399500),"
Glory Academy
9995 170th Street W
Lakeville, MN 55044
Co-ed school, K-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Glory Academy",'Lakeville=' + Lakeville.length); Burnsville[Burnsville.length] = createMarker(new GPoint(-93.27451900,44.74196200),"
Good Shepherd Lutheran School
151 County Road 42 E
Burnsville, MN 55306
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Good Shepherd Lutheran School",'Burnsville=' + Burnsville.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.18699800,44.75479100),"
Heritage Lutheran School
13401 Johnny Cake Ridge Road
Apple Valley, MN 55124
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Lutheran School",'Apple_Valley=' + Apple_Valley.length); South_Saint_Paul[South_Saint_Paul.length] = createMarker(new GPoint(-93.04100500,44.87907000),"
Holy Trinity Elementary School
745 6th Avenue S
South Saint Paul, MN 55075
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Trinity Elementary School",'South_Saint_Paul=' + South_Saint_Paul.length); South_St_Paul[South_St_Paul.length] = createMarker(new GPoint(-93.06000500,44.89020200),"
Jefferson Christian School
125 21st Av S
South St Paul, MN 55075
Co-ed school, KG-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jefferson Christian School",'South_St_Paul=' + South_St_Paul.length); Eagan[Eagan.length] = createMarker(new GPoint(-93.21771100,44.80105900),"
Living Word Academy
4300 Nicols Road
Eagan, MN 55122
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Living Word Academy",'Eagan=' + Eagan.length); West_St_Paul[West_St_Paul.length] = createMarker(new GPoint(-93.09612900,44.89866300),"
Mississippi Valley Montessori
1575 Charlton Avenue
West St Paul, MN 55118
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mississippi Valley Montessori",'West_St_Paul=' + West_St_Paul.length); Burnsville[Burnsville.length] = createMarker(new GPoint(-93.23132900,44.80171200),"
River Hills Early Childhood Ct
11100 River Hills Drive
Burnsville, MN 55337
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("River Hills Early Childhood Ct",'Burnsville=' + Burnsville.length); West_Saint_Paul[West_Saint_Paul.length] = createMarker(new GPoint(-93.07536900,44.90959900),"
St. Croix Lutheran High School
1200 Oakdale Ave
West Saint Paul, MN 55118
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Croix Lutheran High School",'West_Saint_Paul=' + West_Saint_Paul.length); Hastings[Hastings.length] = createMarker(new GPoint(-92.84880800,44.74015200),"
St. Elizabeth Ann Seton School
600 Tyler Street
Hastings, MN 55033
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Elizabeth Ann Seton School",'Hastings=' + Hastings.length); South_Saint_Paul[South_Saint_Paul.length] = createMarker(new GPoint(-93.05671500,44.90496300),"
St. John Vianney School
1815 Bromley Avenue
South Saint Paul, MN 55075
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John Vianney School",'South_Saint_Paul=' + South_Saint_Paul.length); Rosemount[Rosemount.length] = createMarker(new GPoint(-93.12655100,44.74101900),"
St. Joseph Catholic School
14355 S Robert Trail
Rosemount, MN 55068
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph Catholic School",'Rosemount=' + Rosemount.length); West_Saint_Paul[West_Saint_Paul.length] = createMarker(new GPoint(-93.09950500,44.91189800),"
St. Joseph Elementary School
1138 Seminole Avenue
West Saint Paul, MN 55118
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph Elementary School",'West_Saint_Paul=' + West_Saint_Paul.length); Hampton[Hampton.length] = createMarker(new GPoint(-93.00174500,44.61089000),"
St. Mathias School
23335 Northfield Blvd
Hampton, MN 55031
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mathias School",'Hampton=' + Hampton.length); West_Saint_Paul[West_Saint_Paul.length] = createMarker(new GPoint(-93.07229600,44.91879000),"
St. Michael Elementary School
335 Hurley Avenue East
West Saint Paul, MN 55118
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Michael Elementary School",'West_Saint_Paul=' + West_Saint_Paul.length); Burnsville[Burnsville.length] = createMarker(new GPoint(-93.29815200,44.72617800),"
Southview Christian School
15304 Cty Rd 5
Burnsville, MN 55306
Co-ed school, K-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southview Christian School",'Burnsville=' + Burnsville.length); Vermillion[Vermillion.length] = createMarker(new GPoint(-92.96621400,44.67346300),"
St John The Baptist School
Po Box 50 111 Main St W
Vermillion, MN 55085
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John The Baptist School",'Vermillion=' + Vermillion.length); Hampton[Hampton.length] = createMarker(new GPoint(-92.93662300,44.60227400),"
St Mary Elementary School
8433 239th Street E
Hampton, MN 55031
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mary Elementary School",'Hampton=' + Hampton.length); Burnsville[Burnsville.length] = createMarker(new GPoint(-93.24075700,44.79096700),"
Sunrise Montessori School
2521 Horizon Dr.
Burnsville, MN 55337
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sunrise Montessori School",'Burnsville=' + Burnsville.length); Eagan[Eagan.length] = createMarker(new GPoint(-93.21620600,44.81906400),"
Tesseract School
3800 Tesseract Place
Eagan, MN 55122
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tesseract School",'Eagan=' + Eagan.length); Eagan[Eagan.length] = createMarker(new GPoint(-93.12769100,44.84973300),"
Trinity Lone Oak Lutheran School
2950 Highway 55
Eagan, MN 55121
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lone Oak Lutheran School",'Eagan=' + Eagan.length); Eagan[Eagan.length] = createMarker(new GPoint(-93.18036900,44.84804000),"
Trinity School at River Ridge
601 River Ridge Parkway
Eagan, MN 55121
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity School at River Ridge",'Eagan=' + Eagan.length); Burnsville[Burnsville.length] = createMarker(new GPoint(-93.24914400,44.73220200),"
Woodpark Montessori
1080 E 146th Street
Burnsville, MN 55337
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodpark Montessori",'Burnsville=' + Burnsville.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(Apple_Valley); map.removeOverlays(Burnsville); map.removeOverlays(Eagan); map.removeOverlays(Farmington); map.removeOverlays(Hampton); map.removeOverlays(Hastings); map.removeOverlays(Inver_Grove_Heights); map.removeOverlays(Lakeville); map.removeOverlays(Rosemount); map.removeOverlays(Saint_Paul); map.removeOverlays(South_Saint_Paul); map.removeOverlays(South_St_Paul); map.removeOverlays(Vermillion); map.removeOverlays(West_Saint_Paul); map.removeOverlays(West_St_Paul); 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(Lakeville);map.removeOverlays(Apple_Valley); map.removeOverlays(Burnsville); map.removeOverlays(Eagan); map.removeOverlays(Farmington); map.removeOverlays(Hampton); map.removeOverlays(Hastings); map.removeOverlays(Inver_Grove_Heights); map.removeOverlays(Lakeville); map.removeOverlays(Rosemount); map.removeOverlays(Saint_Paul); map.removeOverlays(South_Saint_Paul); map.removeOverlays(South_St_Paul); map.removeOverlays(Vermillion); map.removeOverlays(West_Saint_Paul); map.removeOverlays(West_St_Paul); map.addOverlays(Apple_Valley); centerByArray(Apple_Valley, false, false); cntMarker += Apple_Valley.length; map.addOverlays(Burnsville); centerByArray(Burnsville, false, false); cntMarker += Burnsville.length; map.addOverlays(Eagan); centerByArray(Eagan, false, false); cntMarker += Eagan.length; map.addOverlays(Farmington); centerByArray(Farmington, false, false); cntMarker += Farmington.length; map.addOverlays(Hampton); centerByArray(Hampton, false, false); cntMarker += Hampton.length; map.addOverlays(Hastings); centerByArray(Hastings, false, false); cntMarker += Hastings.length; map.addOverlays(Inver_Grove_Heights); centerByArray(Inver_Grove_Heights, false, false); cntMarker += Inver_Grove_Heights.length; map.addOverlays(Lakeville); centerByArray(Lakeville, false, false); cntMarker += Lakeville.length; map.addOverlays(Rosemount); centerByArray(Rosemount, false, false); cntMarker += Rosemount.length; map.addOverlays(Saint_Paul); centerByArray(Saint_Paul, false, false); cntMarker += Saint_Paul.length; map.addOverlays(South_Saint_Paul); centerByArray(South_Saint_Paul, false, false); cntMarker += South_Saint_Paul.length; map.addOverlays(South_St_Paul); centerByArray(South_St_Paul, false, false); cntMarker += South_St_Paul.length; map.addOverlays(Vermillion); centerByArray(Vermillion, false, false); cntMarker += Vermillion.length; map.addOverlays(West_Saint_Paul); centerByArray(West_Saint_Paul, false, false); cntMarker += West_Saint_Paul.length; map.addOverlays(West_St_Paul); centerByArray(West_St_Paul, false, false); cntMarker += West_St_Paul.length; centerByArray(Lakeville,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; }