function addMarkers() { mySelect = document.getElementById('selection'); Battle_Creek = [];Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.15518188,42.31310272),"
Alternative Community Educat
50 Spencer Street
Battle Creek, MI 49015

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alternative Community Educat",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19293976,42.32680511),"
Ann J. Kellogg School
306 Champion Street
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ann J. Kellogg School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21383667,42.30228806),"
Arbor Academy
55 Arbor Street
Battle Creek, MI 49015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arbor Academy",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.23368073,42.26076126),"
Battle Creek Area Learning Center
15 S. Arbor Street
Battle Creek, MI 49015

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Battle Creek Area Learning Center",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.18197632,42.32232666),"
Battle Creek Central High School
100 W. Van Buren Street
Battle Creek, MI 49017

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Battle Creek Central High School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.22512817,42.32233047),"
Battle Creek Math-sci Center
765 Upton Avenue
Battle Creek, MI 49015

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Battle Creek Math-sci Center",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13561249,42.27223587),"
Beadle Lake Elementary School
8175 C Drive North
Battle Creek, MI 49014

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Beadle Lake Elementary School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.17337799,42.33935165),"
Calhoun Area Technology Center
475 Roosevelt Avenue E.
Battle Creek, MI 49017

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calhoun Area Technology Center",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.20628357,42.31010056),"
Coburn School
39 Fairhome Avenue
Battle Creek, MI 49015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Coburn School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13535309,42.32294846),"
Doris Klaussen Dev. Center
408 Jameson Street
Battle Creek, MI 49014

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Doris Klaussen Dev. Center",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.20043945,42.33847809),"
Dudley School
308 Roosevelt Avenue W.
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dudley School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.17968750,42.32114410),"
Early Childhood Education Elementary School
77 Capital Ave Ne
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Early Childhood Education Elementary School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.23368073,42.26076126),"
Early Childhood-prep Elementary School
8587 Q Drive North
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Early Childhood-prep Elementary School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.17306519,42.30812073),"
Franklin School
20 Newark Avenue
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Franklin School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.17519379,42.32995224),"
Fremont School
115 E. Emmett Street
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fremont School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.15338898,42.26115036),"
Harper Creek High School
12677 Beadle Lake Road
Battle Creek, MI 49014

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harper Creek High School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.15039062,42.26116180),"
Harper Creek Junior High School
7454 B Drive North
Battle Creek, MI 49014

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Harper Creek Junior High School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21408844,42.30332184),"
Lakeview Alternative Educati High School
15 Arbor Street
Battle Creek, MI 49015

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lakeview Alternative Educati High School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.22858429,42.29565048),"
Lakeview High School
15060 S. Helmer Road
Battle Creek, MI 49015

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lakeview High School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21655273,42.30311203),"
Lakeview Junior High School
20 S. Woodrow Avenue
Battle Creek, MI 49015

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lakeview Junior High School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.24210358,42.34999847),"
Lamora Park School
65 N. Woodlawn Avenue
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lamora Park School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.20256042,42.32753754),"
Level Park School
3515 W. Michigan Avenue
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Level Park School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.16719818,42.32359314),"
Mckinley Elementary School
400 Capital Avenue Ne
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21391296,42.30377960),"
Michigan School Readiness Preschool
15 Arbor Street
Battle Creek, MI 49015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Michigan School Readiness Preschool",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21649933,42.39540100),"
Michigan Youth Challenge Academy
5500 Armstrong Building 13
Battle Creek, MI 49016

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Michigan Youth Challenge Academy",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19624329,42.27721024),"
Minges Brook School
435 Lincoln Hills Drive
Battle Creek, MI 49015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Minges Brook School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21002960,42.33895493),"
Northwestern Junior High School
176 Limit Street
Battle Creek, MI 49017

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Northwestern Junior High School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.20999908,42.33885193),"
Northwestern Middle School
176 Limit Street
Battle Creek, MI 49017

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Northwestern Middle School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.18093109,42.31734467),"
Operation Graduation High School
56 East Michigan
Battle Creek, MI 49017

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Operation Graduation High School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13050079,42.37013626),"
Pennfield Central School
8587 Q Drive North
Battle Creek, MI 49017

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pennfield Central School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13050079,42.37013626),"
Pennfield Dunlap Middle School
8587 Q Drive North
Battle Creek, MI 49017

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pennfield Dunlap Middle School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13050079,42.37013626),"
Pennfield North School
8587 Q Drive North
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pennfield North School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13050079,42.37013626),"
Pennfield Purdy School
8587 Q Drive North
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pennfield Purdy School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.13050079,42.37013626),"
Pennfield Senior High School
8587 Q Drive North
Battle Creek, MI 49017

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pennfield Senior High School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.15869141,42.30956268),"
Post Elementary School
340 Cliff Street
Battle Creek, MI 49014

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Post Elementary School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.20706177,42.30114746),"
Prairieview School
1675 Iroquois Avenue
Battle Creek, MI 49015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Prairieview School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.18932343,42.29049683),"
Riverside Elementary School
650 Riverside Drive
Battle Creek, MI 49015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverside Elementary School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19662476,42.30859375),"
Roosevelt School
485 Capital Avenue Sw
Battle Creek, MI 49015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19451904,42.23196411),"
Sonoma School
4640 B Drive South
Battle Creek, MI 49014

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sonoma School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.15511322,42.31313705),"
South Hill Academy
50 Spencer Street
Battle Creek, MI 49017

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Hill Academy",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19628143,42.31296158),"
Southwestern Academy
390 S. Washington Avenue
Battle Creek, MI 49015

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Southwestern Academy",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19609070,42.31278229),"
Southwestern Junior High School
388 S. Washington Avenue
Battle Creek, MI 49015

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Southwestern Junior High School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.21408844,42.30332184),"
Territorial School
15 Arbor Street
Battle Creek, MI 49015

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Territorial School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.23107147,42.34044266),"
Urbandale School
123 N. Bedford Road
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Urbandale School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.15560913,42.33179855),"
Verona School
825 Capital Ne
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Verona School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.18110657,42.32172775),"
W.k. Kellogg Junior High School
60 W. Van Buren Street
Battle Creek, MI 49017

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("W.k. Kellogg Junior High School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.18104553,42.32187653),"
W.k. Kellogg Middle School
60 W. Van Buren Street
Battle Creek, MI 49017

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("W.k. Kellogg Middle School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19021606,42.33886337),"
Washington Academy
450 N. Washington Avenue
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Academy",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.19036865,42.33864212),"
Washington School
450 N. Washington Avenue
Battle Creek, MI 49017

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.11116028,42.30719376),"
Wattles Park Elementary School
132 S. Wattles Road
Battle Creek, MI 49014

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wattles Park Elementary School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.22799683,42.28720856),"
Westlake Elementary School
1184 S. 24th Street
Battle Creek, MI 49015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westlake Elementary School",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.20240021,42.31713486),"
Wilson Academy
71 Blanche Street
Battle Creek, MI 49015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wilson Academy",'Battle_Creek=' + Battle_Creek.length); Battle_Creek[Battle_Creek.length] = createMarker(new GPoint(-85.22000122,42.30009842),"
Wilson School
71 Blanche Street
Battle Creek, MI 49015

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wilson School",'Battle_Creek=' + Battle_Creek.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(Battle_Creek); 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(Battle_Creek);map.removeOverlays(Battle_Creek); map.addOverlays(Battle_Creek); centerByArray(Battle_Creek, false, false); cntMarker += Battle_Creek.length; centerByArray(Battle_Creek,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'); } }