function addMarkers() { mySelect = document.getElementById('selection'); Glencoe = [];Hutchinson = [];Silver_Lake = [];Lester_Prairie = [];Stewart = [];Brownton = [];Winsted = [];mySelect.options[mySelect.options.length] = new Option("Brownton schools",'all=Brownton'); mySelect.options[mySelect.options.length] = new Option("Glencoe schools",'all=Glencoe'); mySelect.options[mySelect.options.length] = new Option("Hutchinson schools",'all=Hutchinson'); mySelect.options[mySelect.options.length] = new Option("Lester Prairie schools",'all=Lester_Prairie'); mySelect.options[mySelect.options.length] = new Option("Silver Lake schools",'all=Silver_Lake'); mySelect.options[mySelect.options.length] = new Option("Stewart schools",'all=Stewart'); mySelect.options[mySelect.options.length] = new Option("Winsted schools",'all=Winsted'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Glencoe[Glencoe.length] = createMarker(new GPoint(-94.15706635,44.77504349),"
Baker Elementary School
1621 E 16th Street
Glencoe, MN 55336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Baker Elementary School",'Glencoe=' + Glencoe.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.36922400,44.89056000),"
Crow River Area Learning Center
1200 Roberts Road
Hutchinson, MN 55350

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crow River Area Learning Center",'Hutchinson=' + Hutchinson.length); Glencoe[Glencoe.length] = createMarker(new GPoint(-94.14771271,44.77023697),"
Crow River Sp Ed Coop
1107 E. 11th St. Suite 100
Glencoe, MN 55336

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crow River Sp Ed Coop",'Glencoe=' + Glencoe.length); Glencoe[Glencoe.length] = createMarker(new GPoint(-94.15378900,44.77204000),"
Develop. Cognative Delays Program
1107 E 11th Street Suite 100
Glencoe, MN 55336

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Develop. Cognative Delays Program",'Glencoe=' + Glencoe.length); Glencoe[Glencoe.length] = createMarker(new GPoint(-94.15378900,44.77204000),"
Early Intervention Program
1107 E 11th Street Suite 100
Glencoe, MN 55336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Early Intervention Program",'Glencoe=' + Glencoe.length); Glencoe[Glencoe.length] = createMarker(new GPoint(-94.52136993,44.53380203),"
Early Intervention Program Elementary School
1107 E 11th Street Suite 100
Glencoe, MN 55336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Early Intervention Program Elementary School",'Glencoe=' + Glencoe.length); Glencoe[Glencoe.length] = createMarker(new GPoint(-94.15378900,44.77204000),"
Glencoe-silver Lake Alp
1107 E 11th Street
Glencoe, MN 55336

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Glencoe-silver Lake Alp",'Glencoe=' + Glencoe.length); Glencoe[Glencoe.length] = createMarker(new GPoint(-94.52136993,44.53380203),"
Glencoe-silver Lake Alp High School
1621 E 16th Street
Glencoe, MN 55336

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Glencoe-silver Lake Alp High School",'Glencoe=' + Glencoe.length); Glencoe[Glencoe.length] = createMarker(new GPoint(-94.13813019,44.77523422),"
Glencoe-silver Lake Sr.
1621 E. 16th St.
Glencoe, MN 55336

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Glencoe-silver Lake Sr.",'Glencoe=' + Glencoe.length); Glencoe[Glencoe.length] = createMarker(new GPoint(-94.52136993,44.53380203),"
Henry Hill Intermediate Elementary School
1103 E. 11th St.
Glencoe, MN 55336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Henry Hill Intermediate Elementary School",'Glencoe=' + Glencoe.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.39318848,44.87813568),"
Hutchinson Middle School
1365 S Grade Road
Hutchinson, MN 55350

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hutchinson Middle School",'Hutchinson=' + Hutchinson.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.36922400,44.89056000),"
Hutchinson Middle School A.l.c.
1365 South Grade Road
Hutchinson, MN 55350

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hutchinson Middle School A.l.c.",'Hutchinson=' + Hutchinson.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.37229156,44.89096451),"
Hutchinson Park Elementary School
100 Glen Street S
Hutchinson, MN 55350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hutchinson Park Elementary School",'Hutchinson=' + Hutchinson.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.39359283,44.88516235),"
Hutchinson Senior High School
1200 Roberts Road
Hutchinson, MN 55350

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hutchinson Senior High School",'Hutchinson=' + Hutchinson.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.37207400,44.89262300),"
Hutchinson Targeted Services
30 Glen Street Nw
Hutchinson, MN 55350

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hutchinson Targeted Services",'Hutchinson=' + Hutchinson.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.36922400,44.89056000),"
Hutchinson Transition Assistance Pg
145 Glen Street Sw
Hutchinson, MN 55350

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hutchinson Transition Assistance Pg",'Hutchinson=' + Hutchinson.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.39012909,44.90297318),"
Hutchinson West Elementary School
875 School Road
Hutchinson, MN 55350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hutchinson West Elementary School",'Hutchinson=' + Hutchinson.length); Silver_Lake[Silver_Lake.length] = createMarker(new GPoint(-94.19569397,44.90449524),"
Lakeside Elementary School
229 Lake Ave.
Silver Lake, MN 55381

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lakeside Elementary School",'Silver_Lake=' + Silver_Lake.length); Glencoe[Glencoe.length] = createMarker(new GPoint(-94.16829681,44.76829910),"
Lakeside Elementary School
1621 E 16th Street
Glencoe, MN 55336

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lakeside Elementary School",'Glencoe=' + Glencoe.length); Lester_Prairie[Lester_Prairie.length] = createMarker(new GPoint(-94.05590057,44.87749863),"
Lester Prairie Elementary School
Box 158
Lester Prairie, MN 55354

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lester Prairie Elementary School",'Lester_Prairie=' + Lester_Prairie.length); Lester_Prairie[Lester_Prairie.length] = createMarker(new GPoint(-94.05590057,44.87749863),"
Lester Prairie Secondary School
Box 158
Lester Prairie, MN 55354

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lester Prairie Secondary School",'Lester_Prairie=' + Lester_Prairie.length); Glencoe[Glencoe.length] = createMarker(new GPoint(-94.19547272,44.90499115),"
Lincoln Junior Middle School
1621 E 16th Street
Glencoe, MN 55336

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lincoln Junior Middle School",'Glencoe=' + Glencoe.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.39399719,44.89569855),"
Little Crow Tele-media Network
Two Century Ave.
Hutchinson, MN 55350

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Crow Tele-media Network",'Hutchinson=' + Hutchinson.length); Stewart[Stewart.length] = createMarker(new GPoint(-94.46330261,44.73109818),"
Mcleod West Elementary School
301 Main Street
Stewart, MN 55385

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mcleod West Elementary School",'Stewart=' + Stewart.length); Brownton[Brownton.length] = createMarker(new GPoint(-94.35114400,44.73208500),"
Mcleod West Junior High School
335 3rd Street S
Brownton, MN 55312

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mcleod West Junior High School",'Brownton=' + Brownton.length); Brownton[Brownton.length] = createMarker(new GPoint(-94.34359741,44.73899841),"
Mcleod West Senior High School
335 3rd Street S
Brownton, MN 55312

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mcleod West Senior High School",'Brownton=' + Brownton.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.38529968,44.89680099),"
New Century Charter School
Box 484
Hutchinson, MN 55350

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Century Charter School",'Hutchinson=' + Hutchinson.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.37166800,44.90691200),"
New Discoveries Montessori Academy
126 North High Drive Ne
Hutchinson, MN 55350

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Discoveries Montessori Academy",'Hutchinson=' + Hutchinson.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.37192535,44.89250565),"
Passages Alternative Program Elementary School
30 Glen St. N.
Hutchinson, MN 55350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Passages Alternative Program Elementary School",'Hutchinson=' + Hutchinson.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.37192535,44.89250565),"
Shelter Alternative Program
30 Glen St. N.
Hutchinson, MN 55350

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shelter Alternative Program",'Hutchinson=' + Hutchinson.length); Hutchinson[Hutchinson.length] = createMarker(new GPoint(-94.37190247,44.89058685),"
Special Ed. Crossroads Program
145 Glen Street Sw
Hutchinson, MN 55350

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Special Ed. Crossroads Program",'Hutchinson=' + Hutchinson.length); Glencoe[Glencoe.length] = createMarker(new GPoint(-94.52136993,44.53380203),"
Transitions Alternative Program
1107 E 11th Street Suite 100
Glencoe, MN 55336

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Transitions Alternative Program",'Glencoe=' + Glencoe.length); Winsted[Winsted.length] = createMarker(new GPoint(-94.05290222,44.95800018),"
Winsted Elementary School
Box 160
Winsted, MN 55395

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Winsted Elementary School",'Winsted=' + Winsted.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(Brownton); map.removeOverlays(Glencoe); map.removeOverlays(Hutchinson); map.removeOverlays(Lester_Prairie); map.removeOverlays(Silver_Lake); map.removeOverlays(Stewart); map.removeOverlays(Winsted); 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(Glencoe);map.removeOverlays(Brownton); map.removeOverlays(Glencoe); map.removeOverlays(Hutchinson); map.removeOverlays(Lester_Prairie); map.removeOverlays(Silver_Lake); map.removeOverlays(Stewart); map.removeOverlays(Winsted); map.addOverlays(Brownton); centerByArray(Brownton, false, false); cntMarker += Brownton.length; map.addOverlays(Glencoe); centerByArray(Glencoe, false, false); cntMarker += Glencoe.length; map.addOverlays(Hutchinson); centerByArray(Hutchinson, false, false); cntMarker += Hutchinson.length; map.addOverlays(Lester_Prairie); centerByArray(Lester_Prairie, false, false); cntMarker += Lester_Prairie.length; map.addOverlays(Silver_Lake); centerByArray(Silver_Lake, false, false); cntMarker += Silver_Lake.length; map.addOverlays(Stewart); centerByArray(Stewart, false, false); cntMarker += Stewart.length; map.addOverlays(Winsted); centerByArray(Winsted, false, false); cntMarker += Winsted.length; centerByArray(Glencoe,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'); } }