function addMarkers(){ mySelect = document.getElementById('selection'); Richfield = [];Minnetonka = [];Minneapolis = [];Saint_Louis_Park = [];Bloomington = [];Hopkins = [];Plymouth = [];Maple_Grove = [];Wayzata = [];Eden_Prairie = [];Brooklyn_Park = [];Crystal = [];Edina = [];mySelect.options[mySelect.options.length] = new Option("Bloomington schools",'all=Bloomington'); mySelect.options[mySelect.options.length] = new Option("Brooklyn Park schools",'all=Brooklyn_Park'); mySelect.options[mySelect.options.length] = new Option("Crystal schools",'all=Crystal'); mySelect.options[mySelect.options.length] = new Option("Eden Prairie schools",'all=Eden_Prairie'); mySelect.options[mySelect.options.length] = new Option("Edina schools",'all=Edina'); mySelect.options[mySelect.options.length] = new Option("Hopkins schools",'all=Hopkins'); mySelect.options[mySelect.options.length] = new Option("Maple Grove schools",'all=Maple_Grove'); mySelect.options[mySelect.options.length] = new Option("Minneapolis schools",'all=Minneapolis'); mySelect.options[mySelect.options.length] = new Option("Minnetonka schools",'all=Minnetonka'); mySelect.options[mySelect.options.length] = new Option("Plymouth schools",'all=Plymouth'); mySelect.options[mySelect.options.length] = new Option("Richfield schools",'all=Richfield'); mySelect.options[mySelect.options.length] = new Option("Saint Louis Park schools",'all=Saint_Louis_Park'); mySelect.options[mySelect.options.length] = new Option("Wayzata schools",'all=Wayzata'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Richfield[Richfield.length] = createMarker(new GPoint(-93.27836900,44.88325500),"
Academy Of Holy Angels
6600 Nicollet Avenue
Richfield, MN 55423
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Academy Of Holy Angels",'Richfield=' + Richfield.length); Minnetonka[Minnetonka.length] = createMarker(new GPoint(-93.48331400,44.91924600),"
Accell Academy
4626 Linnea Lane
Minnetonka, MN 55345
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Accell Academy",'Minnetonka=' + Minnetonka.length); Minneapolis[Minneapolis.length] = createMarker(new GPoint(-93.33306600,44.94966300),"
Bais Yaakov High School
4221 Sunset Blvd
Minneapolis, MN 55416
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bais Yaakov High School",'Minneapolis=' + Minneapolis.length); Saint_Louis_Park[Saint_Louis_Park.length] = createMarker(new GPoint(-93.34564700,44.95819900),"
Benilde-St. Margaret's School
2501 Highway 100 S
Saint Louis Park, MN 55416
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Benilde-St. Margaret's School",'Saint_Louis_Park=' + Saint_Louis_Park.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-93.33527200,44.82561000),"
Bethany Academy
4300 W 98th St
Bloomington, MN 55437
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethany Academy",'Bloomington=' + Bloomington.length); Hopkins[Hopkins.length] = createMarker(new GPoint(-93.38602500,44.92397800),"
The Blake School/Main Campus
110 Blake Road S
Hopkins, MN 55343
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Blake School/Main Campus",'Hopkins=' + Hopkins.length); Minneapolis[Minneapolis.length] = createMarker(new GPoint(-93.29320500,44.96971600),"
The Blake School/Upper School
511 Kenwood Parkway
Minneapolis, MN 55403
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Blake School/Upper School",'Minneapolis=' + Minneapolis.length); Minneapolis[Minneapolis.length] = createMarker(new GPoint(-93.34140900,44.98088500),"
Breck School
123 Ottawa Ave N
Minneapolis, MN 55422
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Breck School",'Minneapolis=' + Minneapolis.length); Minnetonka[Minnetonka.length] = createMarker(new GPoint(-93.47851600,44.92047800),"
Brice Academy
15612 Highway 7 331
Minnetonka, MN 55345
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brice Academy",'Minnetonka=' + Minnetonka.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-93.26550500,44.85534400),"
Concordia Academy-bloomington
8201 Park Avenue S
Bloomington, MN 55420
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Concordia Academy-bloomington",'Bloomington=' + Bloomington.length); Minneapolis[Minneapolis.length] = createMarker(new GPoint(-93.26166400,44.98655500),"
Dela Salle High School
1 De La Salle Drive
Minneapolis, MN 55401
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dela Salle High School",'Minneapolis=' + Minneapolis.length); Plymouth[Plymouth.length] = createMarker(new GPoint(-93.42910400,44.98636700),"
Fourth Baptist Christian School
900 Forestview Lane North
Plymouth, MN 55441
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fourth Baptist Christian School",'Plymouth=' + Plymouth.length); Saint_Louis_Park[Saint_Louis_Park.length] = createMarker(new GPoint(-93.34886800,44.94757000),"
Groves Academy
3200 Highway 100 S
Saint Louis Park, MN 55416
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Groves Academy",'Saint_Louis_Park=' + Saint_Louis_Park.length); Maple_Grove[Maple_Grove.length] = createMarker(new GPoint(-93.47766600,45.08103000),"
Heritage Christian Acadamy
15655 Bass Lake Road
Maple Grove, MN 55311
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian Acadamy",'Maple_Grove=' + Maple_Grove.length); Maple_Grove[Maple_Grove.length] = createMarker(new GPoint(-93.47766600,45.08103000),"
Heritage Christian Academy
15655 Bass Lake Road
Maple Grove, MN 55311
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian Academy",'Maple_Grove=' + Maple_Grove.length); Maple_Grove[Maple_Grove.length] = createMarker(new GPoint(-93.47766600,45.08103000),"
Heritage Christian Academy
15655 Bass Lake Road
Maple Grove, MN 55311
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian Academy",'Maple_Grove=' + Maple_Grove.length); Wayzata[Wayzata.length] = createMarker(new GPoint(-93.57742600,44.95306800),"
Hill School
2180 North Shore Drive
Wayzata, MN 55391
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hill School",'Wayzata=' + Wayzata.length); Eden_Prairie[Eden_Prairie.length] = createMarker(new GPoint(-93.44197200,44.88835300),"
The International School of Minnesota
6385 Beach Rd
Eden Prairie, MN 55344
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The International School of Minnesota",'Eden_Prairie=' + Eden_Prairie.length); Minneapolis[Minneapolis.length] = createMarker(new GPoint(-93.28290500,44.93491600),"
Lake Country School
3755 Pleasant Avenue
Minneapolis, MN 55409
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lake Country School",'Minneapolis=' + Minneapolis.length); Minneapolis[Minneapolis.length] = createMarker(new GPoint(-93.27760500,44.96352900),"
Loring Nicollet Alternative School
1925 Nicollet Ave
Minneapolis, MN 55403
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Loring Nicollet Alternative School",'Minneapolis=' + Minneapolis.length); Brooklyn_Park[Brooklyn_Park.length] = createMarker(new GPoint(-93.39610800,45.08991600),"
Maranatha Christian Academy
9201 75th Ave N
Brooklyn Park, MN 55428
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Maranatha Christian Academy",'Brooklyn_Park=' + Brooklyn_Park.length); Minnetonka[Minnetonka.length] = createMarker(new GPoint(-93.46800400,44.93921500),"
Minnetonka Christian Academy
3500 Williston Rd
Minnetonka, MN 55345
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Minnetonka Christian Academy",'Minnetonka=' + Minnetonka.length); Minneapolis[Minneapolis.length] = createMarker(new GPoint(-93.22515700,44.91596300),"
North Star Academy
3225 East Minnehaha Parkway
Minneapolis, MN 55417
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Star Academy",'Minneapolis=' + Minneapolis.length); Minneapolis[Minneapolis.length] = createMarker(new GPoint(-93.25864600,44.90455100),"
Our Lady Of Peace
5435 11th Avenue S
Minneapolis, MN 55417
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Peace",'Minneapolis=' + Minneapolis.length); Plymouth[Plymouth.length] = createMarker(new GPoint(-93.47013700,45.04330400),"
Providence Academy
15100 Schmidt Lake Road
Plymouth, MN 55446
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Providence Academy",'Plymouth=' + Plymouth.length); Crystal[Crystal.length] = createMarker(new GPoint(-93.37416800,45.05463500),"
St. Raphael School
7301 Bass Lake Road
Crystal, MN 55428
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Raphael School",'Crystal=' + Crystal.length); Minneapolis[Minneapolis.length] = createMarker(new GPoint(-93.23884500,44.98059300),"
Second Foundation School
1219 University Ave Se
Minneapolis, MN 55414
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Second Foundation School",'Minneapolis=' + Minneapolis.length); Edina[Edina.length] = createMarker(new GPoint(-93.35615000,44.87088900),"
Sobriety High School
5250 W 73rd St Ste A
Edina, MN 55439
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sobriety High School",'Edina=' + Edina.length); Minneapolis[Minneapolis.length] = createMarker(new GPoint(-93.25950000,44.96330000),"
Watershed High School
2344 Nicollet Avenue, 2nd Floor
Minneapolis, MN 55404
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Watershed High School",'Minneapolis=' + Minneapolis.length); Plymouth[Plymouth.length] = createMarker(new GPoint(-93.46377200,45.01741900),"
West Lutheran High School
3350 Harbor Lane N
Plymouth, MN 55447
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Lutheran High School",'Plymouth=' + Plymouth.length); Plymouth[Plymouth.length] = createMarker(new GPoint(-93.43813300,44.99551600),"
The Whole Learning School
12325 State Hwy 55
Plymouth, MN 55441
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Whole Learning School",'Plymouth=' + Plymouth.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/////2/' + showArray); map.removeOverlays(Bloomington); map.removeOverlays(Brooklyn_Park); map.removeOverlays(Crystal); map.removeOverlays(Eden_Prairie); map.removeOverlays(Edina); map.removeOverlays(Hopkins); map.removeOverlays(Maple_Grove); map.removeOverlays(Minneapolis); map.removeOverlays(Minnetonka); map.removeOverlays(Plymouth); map.removeOverlays(Richfield); map.removeOverlays(Saint_Louis_Park); map.removeOverlays(Wayzata); 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(Richfield);map.removeOverlays(Bloomington); map.removeOverlays(Brooklyn_Park); map.removeOverlays(Crystal); map.removeOverlays(Eden_Prairie); map.removeOverlays(Edina); map.removeOverlays(Hopkins); map.removeOverlays(Maple_Grove); map.removeOverlays(Minneapolis); map.removeOverlays(Minnetonka); map.removeOverlays(Plymouth); map.removeOverlays(Richfield); map.removeOverlays(Saint_Louis_Park); map.removeOverlays(Wayzata); map.addOverlays(Bloomington); centerByArray(Bloomington, false, false); cntMarker += Bloomington.length; map.addOverlays(Brooklyn_Park); centerByArray(Brooklyn_Park, false, false); cntMarker += Brooklyn_Park.length; map.addOverlays(Crystal); centerByArray(Crystal, false, false); cntMarker += Crystal.length; map.addOverlays(Eden_Prairie); centerByArray(Eden_Prairie, false, false); cntMarker += Eden_Prairie.length; map.addOverlays(Edina); centerByArray(Edina, false, false); cntMarker += Edina.length; map.addOverlays(Hopkins); centerByArray(Hopkins, false, false); cntMarker += Hopkins.length; map.addOverlays(Maple_Grove); centerByArray(Maple_Grove, false, false); cntMarker += Maple_Grove.length; map.addOverlays(Minneapolis); centerByArray(Minneapolis, false, false); cntMarker += Minneapolis.length; map.addOverlays(Minnetonka); centerByArray(Minnetonka, false, false); cntMarker += Minnetonka.length; map.addOverlays(Plymouth); centerByArray(Plymouth, false, false); cntMarker += Plymouth.length; map.addOverlays(Richfield); centerByArray(Richfield, false, false); cntMarker += Richfield.length; map.addOverlays(Saint_Louis_Park); centerByArray(Saint_Louis_Park, false, false); cntMarker += Saint_Louis_Park.length; map.addOverlays(Wayzata); centerByArray(Wayzata, false, false); cntMarker += Wayzata.length; centerByArray(Richfield,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=2&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; }