function addMarkers() { mySelect = document.getElementById('selection'); Prior_Lake = [];Belle_Plaine = [];Shakopee = [];Savage = [];Jordan = [];New_Prague = [];mySelect.options[mySelect.options.length] = new Option("Belle Plaine schools",'all=Belle_Plaine'); mySelect.options[mySelect.options.length] = new Option("Jordan schools",'all=Jordan'); mySelect.options[mySelect.options.length] = new Option("New Prague schools",'all=New_Prague'); mySelect.options[mySelect.options.length] = new Option("Prior Lake schools",'all=Prior_Lake'); mySelect.options[mySelect.options.length] = new Option("Savage schools",'all=Savage'); mySelect.options[mySelect.options.length] = new Option("Shakopee schools",'all=Shakopee'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42030334,44.70930099),"
Anthony Louis Center
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Anthony Louis Center",'Prior_Lake=' + Prior_Lake.length); Belle_Plaine[Belle_Plaine.length] = createMarker(new GPoint(-93.77133942,44.62054443),"
Belle Plaine Elementary School
330 S Market Street
Belle Plaine, MN 56011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Belle Plaine Elementary School",'Belle_Plaine=' + Belle_Plaine.length); Belle_Plaine[Belle_Plaine.length] = createMarker(new GPoint(-93.76993561,44.62254715),"
Belle Plaine Junior Middle School
130 S Willow Street
Belle Plaine, MN 56011

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Belle Plaine Junior Middle School",'Belle_Plaine=' + Belle_Plaine.length); Belle_Plaine[Belle_Plaine.length] = createMarker(new GPoint(-93.77130127,44.62173080),"
Belle Plaine Senior High School
220 S Market Street
Belle Plaine, MN 56011

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Belle Plaine Senior High School",'Belle_Plaine=' + Belle_Plaine.length); Shakopee[Shakopee.length] = createMarker(new GPoint(-93.52545929,44.79434967),"
Central Family Center
505 S Holmes Street
Shakopee, MN 55379

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Family Center",'Shakopee=' + Shakopee.length); Savage[Savage.length] = createMarker(new GPoint(-93.33380890,44.75046158),"
Eagle Ridge Junior Middle School
13955 Glendale Road
Savage, MN 55378

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Eagle Ridge Junior Middle School",'Savage=' + Savage.length); Belle_Plaine[Belle_Plaine.length] = createMarker(new GPoint(-93.77149200,44.61811066),"
Early Childhood
330 S. Market
Belle Plaine, MN 56011

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Early Childhood",'Belle_Plaine=' + Belle_Plaine.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42009735,44.71089935),"
Five Hawks Elementary School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Five Hawks Elementary School",'Prior_Lake=' + Prior_Lake.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42009735,44.71089935),"
Glendale Elementary School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glendale Elementary School",'Prior_Lake=' + Prior_Lake.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42009735,44.71089935),"
Grainwood Elementary School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Grainwood Elementary School",'Prior_Lake=' + Prior_Lake.length); Savage[Savage.length] = createMarker(new GPoint(-93.98782800,38.70281900),"
Harriet Bishop Elementary School
14400 O''connell Road
Savage, MN 55378

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Harriet Bishop Elementary School",'Savage=' + Savage.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42009735,44.71089935),"
Hidden Oaks Junior Middle School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hidden Oaks Junior Middle School",'Prior_Lake=' + Prior_Lake.length); Savage[Savage.length] = createMarker(new GPoint(-93.33437347,44.75197983),"
Hidden Valley Elementary School
13875 Glendale Avenue
Savage, MN 55378

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hidden Valley Elementary School",'Savage=' + Savage.length); Jordan[Jordan.length] = createMarker(new GPoint(-93.64340973,44.65906143),"
Jordan Elementary School
815 Sunset Drive
Jordan, MN 55352

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jordan Elementary School",'Jordan=' + Jordan.length); Jordan[Jordan.length] = createMarker(new GPoint(-93.63982400,44.65934400),"
Jordan Middle School
500 Sunset Drive
Jordan, MN 55352

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Jordan Middle School",'Jordan=' + Jordan.length); Jordan[Jordan.length] = createMarker(new GPoint(-93.63877106,44.66079330),"
Jordan Secondary School
600 Sunset Drive
Jordan, MN 55352

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jordan Secondary School",'Jordan=' + Jordan.length); Savage[Savage.length] = createMarker(new GPoint(-93.35179901,44.77439117),"
M.w. Savage Elementary School
4819 W 126th Street
Savage, MN 55378

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("M.w. Savage Elementary School",'Savage=' + Savage.length); Shakopee[Shakopee.length] = createMarker(new GPoint(-93.53874000,44.79177600),"
Mcf-shakopee
1010 W 6th Avenue
Shakopee, MN 55379

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mcf-shakopee",'Shakopee=' + Shakopee.length); Jordan[Jordan.length] = createMarker(new GPoint(-93.63642120,44.65936279),"
Minnesota River Valley Sp. Ed. Coop Elementary School
100 Hope Avenue
Jordan, MN 55352

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Minnesota River Valley Sp. Ed. Coop Elementary School",'Jordan=' + Jordan.length); Belle_Plaine[Belle_Plaine.length] = createMarker(new GPoint(-93.77549744,44.61270142),"
Mrvsec/belle Plaine Elementary School
220 Market Street S
Belle Plaine, MN 56011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mrvsec/belle Plaine Elementary School",'Belle_Plaine=' + Belle_Plaine.length); New_Prague[New_Prague.length] = createMarker(new GPoint(-93.58448792,44.54733276),"
Mrvsec/ed Center
415 4th Avenue Nw
New Prague, MN 56071

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mrvsec/ed Center",'New_Prague=' + New_Prague.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42009735,44.71089935),"
Mrvsec/five Hawks Elementary School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mrvsec/five Hawks Elementary School",'Prior_Lake=' + Prior_Lake.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42009735,44.71089935),"
Mrvsec/glendale Elementary School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mrvsec/glendale Elementary School",'Prior_Lake=' + Prior_Lake.length); Jordan[Jordan.length] = createMarker(new GPoint(-93.42009735,44.71089935),"
Mrvsec/grainwood Elementary School
100 Hope Avenue
Jordan, MN 55352

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mrvsec/grainwood Elementary School",'Jordan=' + Jordan.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42009735,44.71089935),"
Mrvsec/hidden Oaks Middle School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mrvsec/hidden Oaks Middle School",'Prior_Lake=' + Prior_Lake.length); Jordan[Jordan.length] = createMarker(new GPoint(-93.63877106,44.66079330),"
Mrvsec/jordan Elementary School
815 Sunset Drive
Jordan, MN 55352

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mrvsec/jordan Elementary School",'Jordan=' + Jordan.length); Jordan[Jordan.length] = createMarker(new GPoint(-93.63898468,44.66035843),"
Mrvsec/jordan High School
600 Sunset Drive
Jordan, MN 55352

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mrvsec/jordan High School",'Jordan=' + Jordan.length); Jordan[Jordan.length] = createMarker(new GPoint(-93.62673400,44.66627500),"
Mrvsec/jordan Mid Special Ed.
500 Sunset Drive
Jordan, MN 55352

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mrvsec/jordan Mid Special Ed.",'Jordan=' + Jordan.length); Shakopee[Shakopee.length] = createMarker(new GPoint(-93.46964264,44.79284668),"
Mrvsec/lifeskills High School
1150 Shakopee Town Square Mall
Shakopee, MN 55379

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mrvsec/lifeskills High School",'Shakopee=' + Shakopee.length); New_Prague[New_Prague.length] = createMarker(new GPoint(-93.58448792,44.54733276),"
Mrvsec/new Prague Ed Center
415 4th Ave Nw
New Prague, MN 56071

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mrvsec/new Prague Ed Center",'New_Prague=' + New_Prague.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42604900,44.71523500),"
Mrvsec/oakridge Elementary School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mrvsec/oakridge Elementary School",'Prior_Lake=' + Prior_Lake.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42604900,44.71523500),"
Mrvsec/ponds Edge
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mrvsec/ponds Edge",'Prior_Lake=' + Prior_Lake.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42009735,44.71089935),"
Mrvsec/prior Lake Hisg School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mrvsec/prior Lake Hisg School",'Prior_Lake=' + Prior_Lake.length); Jordan[Jordan.length] = createMarker(new GPoint(-93.63642120,44.65936279),"
Mrvsec/river Valley Ed Center
100 Hope Avenue
Jordan, MN 55352

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mrvsec/river Valley Ed Center",'Jordan=' + Jordan.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42009735,44.71089935),"
Mrvsec/westwood Elementary School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mrvsec/westwood Elementary School",'Prior_Lake=' + Prior_Lake.length); New_Prague[New_Prague.length] = createMarker(new GPoint(-93.57912445,44.54718399),"
New Prague Intermediate Elementary School
405 N.w. 1st Ave.
New Prague, MN 56071

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Prague Intermediate Elementary School",'New_Prague=' + New_Prague.length); New_Prague[New_Prague.length] = createMarker(new GPoint(-93.57746887,44.55009079),"
New Prague Middle School
721 Central Ave. N.
New Prague, MN 56071

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("New Prague Middle School",'New_Prague=' + New_Prague.length); New_Prague[New_Prague.length] = createMarker(new GPoint(-93.57429504,44.55683517),"
New Prague Primary Elementary School
1200 Columbus Ave. N.
New Prague, MN 56071

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Prague Primary Elementary School",'New_Prague=' + New_Prague.length); New_Prague[New_Prague.length] = createMarker(new GPoint(-93.57535553,44.55803680),"
New Prague Senior High School
221 12th St. N.e.
New Prague, MN 56071

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Prague Senior High School",'New_Prague=' + New_Prague.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.41336060,44.71619797),"
Northgate Elementary School
15875 Franklin Trail
Prior Lake, MN 55372

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northgate Elementary School",'Prior_Lake=' + Prior_Lake.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42030334,44.70930099),"
Oakridge Elementary School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakridge Elementary School",'Prior_Lake=' + Prior_Lake.length); Shakopee[Shakopee.length] = createMarker(new GPoint(-93.51410675,44.78969955),"
Pearson Elementary School
917 Dakota Street S
Shakopee, MN 55379

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pearson Elementary School",'Shakopee=' + Shakopee.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42009735,44.71089935),"
Pond Edge Elementary School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pond Edge Elementary School",'Prior_Lake=' + Prior_Lake.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42009735,44.71089935),"
Prior Lake Senior High School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Prior Lake Senior High School",'Prior_Lake=' + Prior_Lake.length); Shakopee[Shakopee.length] = createMarker(new GPoint(-93.41963959,44.77473450),"
Red Oak Elementary School
7700 Old Carriage Court
Shakopee, MN 55379

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Red Oak Elementary School",'Shakopee=' + Shakopee.length); Shakopee[Shakopee.length] = createMarker(new GPoint(-93.50510406,44.78557587),"
Shakopee Junior Middle School
1137 Marschall Road S
Shakopee, MN 55379

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Shakopee Junior Middle School",'Shakopee=' + Shakopee.length); Shakopee[Shakopee.length] = createMarker(new GPoint(-93.52290344,44.78816223),"
Shakopee Senior High School
200 10th Avenue E
Shakopee, MN 55379

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shakopee Senior High School",'Shakopee=' + Shakopee.length); Shakopee[Shakopee.length] = createMarker(new GPoint(-93.49312592,44.77357864),"
Sun Path Elementary School
2250 17th Avenue E
Shakopee, MN 55379

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sun Path Elementary School",'Shakopee=' + Shakopee.length); Shakopee[Shakopee.length] = createMarker(new GPoint(-93.54080963,44.78814316),"
Sweeney Elementary School
1001 Adams Street S
Shakopee, MN 55379

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sweeney Elementary School",'Shakopee=' + Shakopee.length); Prior_Lake[Prior_Lake.length] = createMarker(new GPoint(-93.42009735,44.71089935),"
Westwood Elementary School
Box 539
Prior Lake, MN 55372

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westwood Elementary School",'Prior_Lake=' + Prior_Lake.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,10); /* 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(Belle_Plaine); map.removeOverlays(Jordan); map.removeOverlays(New_Prague); map.removeOverlays(Prior_Lake); map.removeOverlays(Savage); map.removeOverlays(Shakopee); 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(Prior_Lake);map.removeOverlays(Belle_Plaine); map.removeOverlays(Jordan); map.removeOverlays(New_Prague); map.removeOverlays(Prior_Lake); map.removeOverlays(Savage); map.removeOverlays(Shakopee); map.addOverlays(Belle_Plaine); centerByArray(Belle_Plaine, false, false); cntMarker += Belle_Plaine.length; map.addOverlays(Jordan); centerByArray(Jordan, false, false); cntMarker += Jordan.length; map.addOverlays(New_Prague); centerByArray(New_Prague, false, false); cntMarker += New_Prague.length; map.addOverlays(Prior_Lake); centerByArray(Prior_Lake, false, false); cntMarker += Prior_Lake.length; map.addOverlays(Savage); centerByArray(Savage, false, false); cntMarker += Savage.length; map.addOverlays(Shakopee); centerByArray(Shakopee, false, false); cntMarker += Shakopee.length; centerByArray(Prior_Lake,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'); } }