function addMarkers() { mySelect = document.getElementById('selection'); Albany = [];St_Cloud = [];Sauk_Centre = [];Brooten = [];Belgrade = [];Sartell = [];Cold_Spring = [];Holdingford = [];Kimball = [];Waite_Park = [];St_Joseph = [];Melrose = [];Paynesville = [];Richmond = [];Rockville = [];Saint_Cloud = [];mySelect.options[mySelect.options.length] = new Option("Albany schools",'all=Albany'); mySelect.options[mySelect.options.length] = new Option("Belgrade schools",'all=Belgrade'); mySelect.options[mySelect.options.length] = new Option("Brooten schools",'all=Brooten'); mySelect.options[mySelect.options.length] = new Option("Cold Spring schools",'all=Cold_Spring'); mySelect.options[mySelect.options.length] = new Option("Holdingford schools",'all=Holdingford'); mySelect.options[mySelect.options.length] = new Option("Kimball schools",'all=Kimball'); mySelect.options[mySelect.options.length] = new Option("Melrose schools",'all=Melrose'); mySelect.options[mySelect.options.length] = new Option("Paynesville schools",'all=Paynesville'); mySelect.options[mySelect.options.length] = new Option("Richmond schools",'all=Richmond'); mySelect.options[mySelect.options.length] = new Option("Rockville schools",'all=Rockville'); mySelect.options[mySelect.options.length] = new Option("Saint Cloud schools",'all=Saint_Cloud'); mySelect.options[mySelect.options.length] = new Option("Sartell schools",'all=Sartell'); mySelect.options[mySelect.options.length] = new Option("Sauk Centre schools",'all=Sauk_Centre'); mySelect.options[mySelect.options.length] = new Option("St Cloud schools",'all=St_Cloud'); mySelect.options[mySelect.options.length] = new Option("St Joseph schools",'all=St_Joseph'); mySelect.options[mySelect.options.length] = new Option("Waite Park schools",'all=Waite_Park'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Albany[Albany.length] = createMarker(new GPoint(-94.57109833,45.63539886),"
Albany Elementary School
Box 330
Albany, MN 56307

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Albany Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-94.57109833,45.63539886),"
Albany Junior Middle School
Box 330
Albany, MN 56307

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Albany Junior Middle School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-94.57109833,45.63539886),"
Albany Senior High School
Box 330
Albany, MN 56307

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Albany Senior High School",'Albany=' + Albany.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.21224976,45.56698227),"
Apollo Senior High School
1000 44th Avenue N
St. Cloud, MN 56303

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Apollo Senior High School",'St_Cloud=' + St_Cloud.length); Albany[Albany.length] = createMarker(new GPoint(-94.57109833,45.63539886),"
Avon Elementary School
Box 330
Albany, MN 56307

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Avon Elementary School",'Albany=' + Albany.length); Sauk_Centre[Sauk_Centre.length] = createMarker(new GPoint(-94.95195900,45.73778500),"
Beacon Program
903 State Road S
Sauk Centre, MN 56378

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beacon Program",'Sauk_Centre=' + Sauk_Centre.length); Sauk_Centre[Sauk_Centre.length] = createMarker(new GPoint(-94.95195900,45.73778500),"
Beacon Program W Central Ed. Dist.
903 State Road S
Sauk Centre, MN 56378

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Beacon Program W Central Ed. Dist.",'Sauk_Centre=' + Sauk_Centre.length); Brooten[Brooten.length] = createMarker(new GPoint(-95.10150146,45.51229858),"
Belgrade-brooten-elrosa Elementary School
Box 39
Brooten, MN 56316

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Belgrade-brooten-elrosa Elementary School",'Brooten=' + Brooten.length); Belgrade[Belgrade.length] = createMarker(new GPoint(-94.95770264,45.46269989),"
Belgrade-brooten-elrosa Secondary School
Box 339
Belgrade, MN 56312

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Belgrade-brooten-elrosa Secondary School",'Belgrade=' + Belgrade.length); Sartell[Sartell.length] = createMarker(new GPoint(-94.21640015,45.63069916),"
Benton-stearns Ed. District
Box 299
Sartell, MN 56377

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Benton-stearns Ed. District",'Sartell=' + Sartell.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.19751900,45.56586400),"
Central Minnesota Jt. Powers Dist.
809 12th Street N
St. Cloud, MN 56303

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Minnesota Jt. Powers Dist.",'St_Cloud=' + St_Cloud.length); Cold_Spring[Cold_Spring.length] = createMarker(new GPoint(-94.42990112,45.46348953),"
Central Mn Alc Cold Spring
534 5th Ave. N.
Cold Spring, MN 56320

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Mn Alc Cold Spring",'Cold_Spring=' + Cold_Spring.length); Holdingford[Holdingford.length] = createMarker(new GPoint(-94.45120239,45.75299835),"
Central Mn Alc Holdingford
Box 250
Holdingford, MN 56340

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Mn Alc Holdingford",'Holdingford=' + Holdingford.length); Sartell[Sartell.length] = createMarker(new GPoint(-94.21640015,45.63069916),"
Central Mn Alc Sartell High School
212 3rd Avenue N
Sartell, MN 56377

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Mn Alc Sartell High School",'Sartell=' + Sartell.length); Cold_Spring[Cold_Spring.length] = createMarker(new GPoint(-94.42990112,45.46348953),"
Central Mn T.s. Cold Spring
534 5th Avenue N
Cold Spring, MN 56320

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Mn T.s. Cold Spring",'Cold_Spring=' + Cold_Spring.length); Holdingford[Holdingford.length] = createMarker(new GPoint(-94.47142900,45.73128000),"
Central Mn T.s. Holdingford
Box 250
Holdingford, MN 56340

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Mn T.s. Holdingford",'Holdingford=' + Holdingford.length); Kimball[Kimball.length] = createMarker(new GPoint(-94.30319977,45.34469986),"
Central Mn T.s. Kimball
Box 368
Kimball, MN 55353

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Mn T.s. Kimball",'Kimball=' + Kimball.length); Sartell[Sartell.length] = createMarker(new GPoint(-94.21640015,45.63069916),"
Central Mn T.s. Sartell
Box 328
Sartell, MN 56377

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Mn T.s. Sartell",'Sartell=' + Sartell.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.18814087,45.54964066),"
Central Mn T.s. St Cloud
809 12th Street N
St. Cloud, MN 56303

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Mn T.s. St Cloud",'St_Cloud=' + St_Cloud.length); Kimball[Kimball.length] = createMarker(new GPoint(-94.30319977,45.34469986),"
Central Mn. Alc Kimball
Box 368
Kimball, MN 55353

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Mn. Alc Kimball",'Kimball=' + Kimball.length); Cold_Spring[Cold_Spring.length] = createMarker(new GPoint(-94.42621613,45.46310806),"
Cold Spring Elementary School
601 Red River Avenue N
Cold Spring, MN 56320

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cold Spring Elementary School",'Cold_Spring=' + Cold_Spring.length); Sauk_Centre[Sauk_Centre.length] = createMarker(new GPoint(-94.98449707,45.72510147),"
Correctional Facility-sauk Centre
Box C
Sauk Centre, MN 56378

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Correctional Facility-sauk Centre",'Sauk_Centre=' + Sauk_Centre.length); Waite_Park[Waite_Park.length] = createMarker(new GPoint(-94.22692871,45.54017258),"
Discovery Community Elementary School
700 S 7th Street
Waite Park, MN 56387

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Discovery Community Elementary School",'Waite_Park=' + Waite_Park.length); Waite_Park[Waite_Park.length] = createMarker(new GPoint(-94.21640015,45.63069916),"
Great River Education Center
400 Great Oak Drive Suite 10
Waite Park, MN 56387

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Great River Education Center",'Waite_Park=' + Waite_Park.length); Holdingford[Holdingford.length] = createMarker(new GPoint(-94.44329834,45.74459839),"
Holdingford Elementary School
Box 250
Holdingford, MN 56340

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holdingford Elementary School",'Holdingford=' + Holdingford.length); Holdingford[Holdingford.length] = createMarker(new GPoint(-94.44329834,45.74459839),"
Holdingford Secondary School
Box 250
Holdingford, MN 56340

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holdingford Secondary School",'Holdingford=' + Holdingford.length); St_Joseph[St_Joseph.length] = createMarker(new GPoint(-94.31794739,45.56473923),"
Kennedy Elementary School
S 1st Avenue
St. Joseph, MN 56374

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kennedy Elementary School",'St_Joseph=' + St_Joseph.length); Kimball[Kimball.length] = createMarker(new GPoint(-94.30319977,45.34469986),"
Kimball Elementary School
Box 368
Kimball, MN 55353

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kimball Elementary School",'Kimball=' + Kimball.length); Kimball[Kimball.length] = createMarker(new GPoint(-94.30319977,45.34469986),"
Kimball Secondary School
Box 368
Kimball, MN 55353

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kimball Secondary School",'Kimball=' + Kimball.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.19194031,45.56773758),"
Madison Elementary School
2805 9th Street N
St. Cloud, MN 56303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Madison Elementary School",'St_Cloud=' + St_Cloud.length); Waite_Park[Waite_Park.length] = createMarker(new GPoint(-94.22647858,45.55757904),"
Mckinley Elementary School
216 8th Ave. N.
Waite Park, MN 56387

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Waite_Park=' + Waite_Park.length); Melrose[Melrose.length] = createMarker(new GPoint(-94.80757141,45.68272018),"
Melrose Elementary School
566 N 5th Avenue E
Melrose, MN 56352

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Melrose Elementary School",'Melrose=' + Melrose.length); Melrose[Melrose.length] = createMarker(new GPoint(-94.81102900,45.67488000),"
Melrose Middle School
546 N 5th Avenue E
Melrose, MN 56352

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Melrose Middle School",'Melrose=' + Melrose.length); Melrose[Melrose.length] = createMarker(new GPoint(-94.80754852,45.68193817),"
Melrose Secondary School
546 N 5th Avenue E
Melrose, MN 56352

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Melrose Secondary School",'Melrose=' + Melrose.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.19270325,45.57330322),"
North Junior Middle School
1212 N. 29th Ave.
St. Cloud, MN 56303

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("North Junior Middle School",'St_Cloud=' + St_Cloud.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.19330597,45.53505325),"
Oak Hill Community Elementary School
2600 County Road 136
St Cloud, MN 56301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak Hill Community Elementary School",'St_Cloud=' + St_Cloud.length); Sartell[Sartell.length] = createMarker(new GPoint(-94.22108300,45.65543200),"
Oak Ridge Elementary School
1111 27th Street N
Sartell, MN 56377

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak Ridge Elementary School",'Sartell=' + Sartell.length); Paynesville[Paynesville.length] = createMarker(new GPoint(-94.71585083,45.37876129),"
Paynesville Elementary School
205 W Mill Street
Paynesville, MN 56362

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Paynesville Elementary School",'Paynesville=' + Paynesville.length); Paynesville[Paynesville.length] = createMarker(new GPoint(-94.72900391,45.37415314),"
Paynesville Middle School
801 W Highway 23
Paynesville, MN 56362

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Paynesville Middle School",'Paynesville=' + Paynesville.length); Paynesville[Paynesville.length] = createMarker(new GPoint(-94.72901154,45.37459564),"
Paynesville Senior High School
795 W Highway 23
Paynesville, MN 56362

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Paynesville Senior High School",'Paynesville=' + Paynesville.length); Sartell[Sartell.length] = createMarker(new GPoint(-94.22906494,45.62483597),"
Pine Meadow Elementary School
1029 5th Street N
Sartell, MN 56377

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pine Meadow Elementary School",'Sartell=' + Sartell.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.17026900,45.57492200),"
Recovery Plus
1406 6th Avenue N
St. Cloud, MN 56301

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Recovery Plus",'St_Cloud=' + St_Cloud.length); Richmond[Richmond.length] = createMarker(new GPoint(-94.51806641,45.45613861),"
Richmond Elementary School
34 2nd Street Ne
Richmond, MN 56368

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Richmond Elementary School",'Richmond=' + Richmond.length); Rockville[Rockville.length] = createMarker(new GPoint(-94.34049988,45.47190094),"
Rockville Elementary School
Box 37
Rockville, MN 56369

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rockville Elementary School",'Rockville=' + Rockville.length); Cold_Spring[Cold_Spring.length] = createMarker(new GPoint(-94.41789246,45.45657730),"
Rocori Middle School
533 Main Street
Cold Spring, MN 56320

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rocori Middle School",'Cold_Spring=' + Cold_Spring.length); Cold_Spring[Cold_Spring.length] = createMarker(new GPoint(-94.43022156,45.46344376),"
Rocori Senior High School
534 5th Avenue N
Cold Spring, MN 56320

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rocori Senior High School",'Cold_Spring=' + Cold_Spring.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.19464874,45.55873871),"
Roosevelt Elementary School
3015 3rd St. N.
St. Cloud, MN 56303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'St_Cloud=' + St_Cloud.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.15710449,45.54156876),"
Saint Cloud Children's Home
21726 7th Avenue S
St. Cloud, MN 56301

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Saint Cloud Children's Home",'St_Cloud=' + St_Cloud.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.17248100,45.54761400),"
Saint Cloud Group Home
1101 Washington Memorial Drive
St. Cloud, MN 56301

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Saint Cloud Group Home",'St_Cloud=' + St_Cloud.length); Sartell[Sartell.length] = createMarker(new GPoint(-94.20358276,45.61554718),"
Saint Stephen Elementary School
5 Second Ave. S.w.
Sartell, MN 56377

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Saint Stephen Elementary School",'Sartell=' + Sartell.length); Sartell[Sartell.length] = createMarker(new GPoint(-94.20822144,45.63166428),"
Sartell Middle School
627 Third Avenue N
Sartell, MN 56377

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sartell Middle School",'Sartell=' + Sartell.length); Sartell[Sartell.length] = createMarker(new GPoint(-94.21834564,45.62943649),"
Sartell Senior High School
748 Seventh Street N
Sartell, MN 56377

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sartell Senior High School",'Sartell=' + Sartell.length); Sauk_Centre[Sauk_Centre.length] = createMarker(new GPoint(-94.94461823,45.72854233),"
Sauk Centre Elementary School
903 State Road
Sauk Centre, MN 56378

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sauk Centre Elementary School",'Sauk_Centre=' + Sauk_Centre.length); Sauk_Centre[Sauk_Centre.length] = createMarker(new GPoint(-94.94461823,45.72854233),"
Sauk Centre Junior Middle School
903 State Road
Sauk Centre, MN 56378

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sauk Centre Junior Middle School",'Sauk_Centre=' + Sauk_Centre.length); Sauk_Centre[Sauk_Centre.length] = createMarker(new GPoint(-94.94461823,45.72854233),"
Sauk Centre Secondary School
903 State Road
Sauk Centre, MN 56378

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sauk Centre Secondary School",'Sauk_Centre=' + Sauk_Centre.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.16830444,45.54754639),"
South Junior Middle School
1120 15th Avenue S
St. Cloud, MN 56301

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("South Junior Middle School",'St_Cloud=' + St_Cloud.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.18814087,45.54964066),"
Special Ed. Facilities High School
628 Roosevelt Road
St. Cloud, MN 56301

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Special Ed. Facilities High School",'St_Cloud=' + St_Cloud.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.19751900,45.56586400),"
St Cloud Area Learning Center
809 N 12th Street
St Cloud, MN 56303

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Cloud Area Learning Center",'St_Cloud=' + St_Cloud.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.18814087,45.54964066),"
St Cloud Extended Day
628 Roosevelt Rd
St Cloud, MN 56301

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Cloud Extended Day",'St_Cloud=' + St_Cloud.length); Saint_Cloud[Saint_Cloud.length] = createMarker(new GPoint(-94.17479400,45.58200000),"
Stride Academy Charter School
1025 18th Street N
Saint Cloud, MN 56303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stride Academy Charter School",'Saint_Cloud=' + Saint_Cloud.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.16462708,45.55497360),"
Technical Senior High School
233 12th Avenue S
St. Cloud, MN 56301

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Technical Senior High School",'St_Cloud=' + St_Cloud.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.15859985,45.55121613),"
Washington-early Childhood Sp. Elementary School
3015 3rd Street N
St. Cloud, MN 56303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington-early Childhood Sp. Elementary School",'St_Cloud=' + St_Cloud.length); Sauk_Centre[Sauk_Centre.length] = createMarker(new GPoint(-94.94438171,45.72814941),"
West Central Alc High School
903 State Road S
Sauk Centre, MN 56378

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Central Alc High School",'Sauk_Centre=' + Sauk_Centre.length); Sauk_Centre[Sauk_Centre.length] = createMarker(new GPoint(-94.94438171,45.72814941),"
West Central Targeted Services
903 State Road S
Sauk Centre, MN 56378

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Central Targeted Services",'Sauk_Centre=' + Sauk_Centre.length); St_Cloud[St_Cloud.length] = createMarker(new GPoint(-94.23028564,45.57023621),"
Westwood Elementary School
5800 Ridgewood Road
St. Cloud, MN 56303

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westwood Elementary School",'St_Cloud=' + St_Cloud.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(Albany); map.removeOverlays(Belgrade); map.removeOverlays(Brooten); map.removeOverlays(Cold_Spring); map.removeOverlays(Holdingford); map.removeOverlays(Kimball); map.removeOverlays(Melrose); map.removeOverlays(Paynesville); map.removeOverlays(Richmond); map.removeOverlays(Rockville); map.removeOverlays(Saint_Cloud); map.removeOverlays(Sartell); map.removeOverlays(Sauk_Centre); map.removeOverlays(St_Cloud); map.removeOverlays(St_Joseph); map.removeOverlays(Waite_Park); 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(Albany);map.removeOverlays(Albany); map.removeOverlays(Belgrade); map.removeOverlays(Brooten); map.removeOverlays(Cold_Spring); map.removeOverlays(Holdingford); map.removeOverlays(Kimball); map.removeOverlays(Melrose); map.removeOverlays(Paynesville); map.removeOverlays(Richmond); map.removeOverlays(Rockville); map.removeOverlays(Saint_Cloud); map.removeOverlays(Sartell); map.removeOverlays(Sauk_Centre); map.removeOverlays(St_Cloud); map.removeOverlays(St_Joseph); map.removeOverlays(Waite_Park); map.addOverlays(Albany); centerByArray(Albany, false, false); cntMarker += Albany.length; map.addOverlays(Belgrade); centerByArray(Belgrade, false, false); cntMarker += Belgrade.length; map.addOverlays(Brooten); centerByArray(Brooten, false, false); cntMarker += Brooten.length; map.addOverlays(Cold_Spring); centerByArray(Cold_Spring, false, false); cntMarker += Cold_Spring.length; map.addOverlays(Holdingford); centerByArray(Holdingford, false, false); cntMarker += Holdingford.length; map.addOverlays(Kimball); centerByArray(Kimball, false, false); cntMarker += Kimball.length; map.addOverlays(Melrose); centerByArray(Melrose, false, false); cntMarker += Melrose.length; map.addOverlays(Paynesville); centerByArray(Paynesville, false, false); cntMarker += Paynesville.length; map.addOverlays(Richmond); centerByArray(Richmond, false, false); cntMarker += Richmond.length; map.addOverlays(Rockville); centerByArray(Rockville, false, false); cntMarker += Rockville.length; map.addOverlays(Saint_Cloud); centerByArray(Saint_Cloud, false, false); cntMarker += Saint_Cloud.length; map.addOverlays(Sartell); centerByArray(Sartell, false, false); cntMarker += Sartell.length; map.addOverlays(Sauk_Centre); centerByArray(Sauk_Centre, false, false); cntMarker += Sauk_Centre.length; map.addOverlays(St_Cloud); centerByArray(St_Cloud, false, false); cntMarker += St_Cloud.length; map.addOverlays(St_Joseph); centerByArray(St_Joseph, false, false); cntMarker += St_Joseph.length; map.addOverlays(Waite_Park); centerByArray(Waite_Park, false, false); cntMarker += Waite_Park.length; centerByArray(Albany,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'); } }