function addMarkers() { mySelect = document.getElementById('selection'); Rochester = [];Stewartville = [];Byron = [];Chatfield = [];Eyota = [];Dover = [];mySelect.options[mySelect.options.length] = new Option("Byron schools",'all=Byron'); mySelect.options[mySelect.options.length] = new Option("Chatfield schools",'all=Chatfield'); mySelect.options[mySelect.options.length] = new Option("Dover schools",'all=Dover'); mySelect.options[mySelect.options.length] = new Option("Eyota schools",'all=Eyota'); mySelect.options[mySelect.options.length] = new Option("Rochester schools",'all=Rochester'); mySelect.options[mySelect.options.length] = new Option("Stewartville schools",'all=Stewartville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Rochester[Rochester.length] = createMarker(new GPoint(-92.45796000,43.99988800),"
535 Online Campus
334 16th Street Se
Rochester, MN 55904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("535 Online Campus",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.46595300,44.02157000),"
Adam Abdulle Academy
Po Box 1052
Rochester, MN 55901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Adam Abdulle Academy",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.45730591,44.01586151),"
Adult Diploma Program High School
700 4th Avenue Se
Rochester, MN 55904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Adult Diploma Program High School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.47168700,44.01596300),"
After School Academy
615 7th Street Sw
Rochester, MN 55902

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("After School Academy",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.46063995,43.98983765),"
Alc-cec High School
2220 3rd Avenue Se
Rochester, MN 55904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alc-cec High School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.49903107,43.99279785),"
Bamber Valley Elementary School
2001 Bamber Valley Road Sw
Rochester, MN 55902

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bamber Valley Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.51898193,44.02873611),"
Bishop Elementary School
406 36th Avenue Nw
Rochester, MN 55901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bishop Elementary School",'Rochester=' + Rochester.length); Stewartville[Stewartville.length] = createMarker(new GPoint(-92.48081207,43.84994125),"
Bonner Elementary School
526 5th Avenue Se
Stewartville, MN 55976

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bonner Elementary School",'Stewartville=' + Stewartville.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.45977900,44.01925000),"
Bridge Area Learning Center
2220 3rd Avenue Se
Rochester, MN 55904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bridge Area Learning Center",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.37860870,43.96709061),"
Burr Oak
3800 50th Avenue Se
Rochester, MN 55904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Burr Oak",'Rochester=' + Rochester.length); Byron[Byron.length] = createMarker(new GPoint(-92.62842560,44.03345108),"
Byron Elementary School
501 10th Avenue Ne
Byron, MN 55920

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Byron Elementary School",'Byron=' + Byron.length); Byron[Byron.length] = createMarker(new GPoint(-92.65412903,44.03273773),"
Byron High School
601 4th Street Nw
Byron, MN 55920

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Byron High School",'Byron=' + Byron.length); Byron[Byron.length] = createMarker(new GPoint(-92.64670563,44.03556824),"
Byron Middle School
630 1st Avenue Nw
Byron, MN 55920

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Byron Middle School",'Byron=' + Byron.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.45977900,44.01925000),"
Campus School
2116 Campus Drive Se
Rochester, MN 55904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Campus School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.47177124,44.01603699),"
Care & Treatment
2116 Campus Drive Se
Rochester, MN 55904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Care & Treatment",'Rochester=' + Rochester.length); Stewartville[Stewartville.length] = createMarker(new GPoint(-92.49140167,43.85503769),"
Central Elementary School
301 2nd Street Sw
Stewartville, MN 55976

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Stewartville=' + Stewartville.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.42864227,44.04787064),"
Century Senior High School
2525 Viola Road Ne
Rochester, MN 55906

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Century Senior High School",'Rochester=' + Rochester.length); Chatfield[Chatfield.length] = createMarker(new GPoint(-92.19017029,43.85293579),"
Chosen Valley Secondary School
205 Union Street Ne
Chatfield, MN 55923

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chosen Valley Secondary School",'Chatfield=' + Chatfield.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.45011139,44.04577637),"
Churchill Elementary School
2240 7th Avenue Ne
Rochester, MN 55906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Churchill Elementary School",'Rochester=' + Rochester.length); Eyota[Eyota.length] = createMarker(new GPoint(-92.23255157,43.97737122),"
Dover-eyota Elementary School
27 Knowledge Road Sw
Eyota, MN 55934

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dover-eyota Elementary School",'Eyota=' + Eyota.length); Eyota[Eyota.length] = createMarker(new GPoint(-92.22876740,43.98254395),"
Dover-eyota Secondary School
615 South Avenue Sw
Eyota, MN 55934

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dover-eyota Secondary School",'Eyota=' + Eyota.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.47177124,44.01603699),"
Ec Assessment Elementary School
615 S.w. 7th St.
Rochester, MN 55902

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ec Assessment Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.48421478,44.04939270),"
Elton Hills Elementary School
1421 Elton Hills Drive Nw
Rochester, MN 55901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Elton Hills Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.45788574,43.99986267),"
Esc Alc High School
334 16th Street Se
Rochester, MN 55904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Esc Alc High School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.48538971,44.01693726),"
Folwell Elementary School
603 15th Avenue Sw
Rochester, MN 55902

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Folwell Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.44979095,43.99425507),"
Franklin Elementary School
1801 9th Avenue Se
Rochester, MN 55904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Franklin Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.46305847,44.00533676),"
Friedell Middle School
1200 Broadway S
Rochester, MN 55904

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Friedell Middle School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.48319244,44.06376266),"
Gage Elementary School
1300 40th Street Nw
Rochester, MN 55901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gage Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.47062683,44.04716110),"
Hoover Elementary School
369 Elton Hills Drive Nw
Rochester, MN 55901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hoover Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.45018768,44.03520584),"
Jefferson Elementary School
1201 10th Avenue Ne
Rochester, MN 55906

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.48512268,44.05606079),"
John Adams Middle School
1525 31st Street Nw
Rochester, MN 55901

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("John Adams Middle School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.48489380,44.03606415),"
John Marshall Senior High School
1510 14th Street Nw
Rochester, MN 55901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("John Marshall Senior High School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.45670319,44.04143524),"
Kellogg Middle School
503 17th Street Ne
Rochester, MN 55906

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kellogg Middle School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.45220947,44.00842285),"
Lincoln At Mann Elementary School
1122 8th Avenue Se
Rochester, MN 55904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln At Mann Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.47168700,44.01596300),"
Longfellow After School Academy
615 7th Street Sw
Rochester, MN 55902

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Longfellow After School Academy",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.43482208,44.00006866),"
Longfellow Elementary School
1615 S.e. Marion Rd.
Rochester, MN 55904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Longfellow Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.44815063,44.00321579),"
Mayo Senior High School
1420 11th Avenue Se
Rochester, MN 55904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mayo Senior High School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.44979095,43.99425507),"
Montessori At Franklin
1801 9th Avenue Se
Rochester, MN 55904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Montessori At Franklin",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.43931580,43.98913956),"
Pinewood Elementary School
1900 Pinewood Road Se
Rochester, MN 55904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pinewood Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.47177124,44.01603699),"
Pre School Hcp
615 7th Street Sw
Rochester, MN 55902

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pre School Hcp",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.46063995,43.98983765),"
Rams Middle School
2220 3rd Ave. S.e.
Rochester, MN 55904

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rams Middle School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.45600891,44.01742935),"
Riverside Central Elementary School
506 5th Avenue Se
Rochester, MN 55904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverside Central Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.42864227,44.04787064),"
Rochester Alc High School
2525 Viola Road Ne
Rochester, MN 55906

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rochester Alc High School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.47767639,44.02861786),"
Rochester Off-campus Charter High School
2364 Valleyhigh Drive Nw
Rochester, MN 55901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rochester Off-campus Charter High School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.46063995,43.98983765),"
Rochester Targeted Services
2220 3rd Avenue Se
Rochester, MN 55904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rochester Targeted Services",'Rochester=' + Rochester.length); Stewartville[Stewartville.length] = createMarker(new GPoint(-92.49539185,43.85246277),"
Stewartville Middle School
500 4th Street Sw
Stewartville, MN 55976

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Stewartville Middle School",'Stewartville=' + Stewartville.length); Stewartville[Stewartville.length] = createMarker(new GPoint(-92.49539185,43.85246277),"
Stewartville Senior High School
500 4th Street Sw
Stewartville, MN 55976

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Stewartville Senior High School",'Stewartville=' + Stewartville.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.46128845,44.03058243),"
Studio Academy Charter School
415 16th Street Sw
Rochester, MN 55902

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Studio Academy Charter School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.42864227,44.04787064),"
Summer Alc High School
2525 Viola Rd. N.e.
Rochester, MN 55906

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Summer Alc High School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.48319244,44.06376266),"
Summer Esol Elementary School
615 7th Street Sw
Rochester, MN 55901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Summer Esol Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.49285889,44.04048157),"
Sunset Terrace Elementary School
1707 19th Avenue Nw
Rochester, MN 55901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunset Terrace Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.46743774,43.99986267),"
Transition To Adult Program High School
334 16th Street Sw
Rochester, MN 55904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Transition To Adult Program High School",'Rochester=' + Rochester.length); Dover[Dover.length] = createMarker(new GPoint(-92.14096832,43.97463608),"
Valley View Alternative High School
217 W Center
Dover, MN 55959

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valley View Alternative High School",'Dover=' + Dover.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.47880554,44.03436279),"
Washington Elementary School
1200 11th Avenue Nw
Rochester, MN 55901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-92.45977900,44.01925000),"
Willow Creek Middle School
2425 11th Avenue Se
Rochester, MN 55904

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Willow Creek Middle School",'Rochester=' + Rochester.length); Byron[Byron.length] = createMarker(new GPoint(-92.65810394,44.02899933),"
Zumbro Ed. District Elementary School
801 Frontage Road Nw
Byron, MN 55920

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Zumbro Ed. District Elementary School",'Byron=' + Byron.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(Byron); map.removeOverlays(Chatfield); map.removeOverlays(Dover); map.removeOverlays(Eyota); map.removeOverlays(Rochester); map.removeOverlays(Stewartville); 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(Rochester);map.removeOverlays(Byron); map.removeOverlays(Chatfield); map.removeOverlays(Dover); map.removeOverlays(Eyota); map.removeOverlays(Rochester); map.removeOverlays(Stewartville); map.addOverlays(Byron); centerByArray(Byron, false, false); cntMarker += Byron.length; map.addOverlays(Chatfield); centerByArray(Chatfield, false, false); cntMarker += Chatfield.length; map.addOverlays(Dover); centerByArray(Dover, false, false); cntMarker += Dover.length; map.addOverlays(Eyota); centerByArray(Eyota, false, false); cntMarker += Eyota.length; map.addOverlays(Rochester); centerByArray(Rochester, false, false); cntMarker += Rochester.length; map.addOverlays(Stewartville); centerByArray(Stewartville, false, false); cntMarker += Stewartville.length; centerByArray(Rochester,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'); } }