function addMarkers() { mySelect = document.getElementById('selection'); Benton_Harbor = [];Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.46509552,42.10985184),"
Benton Harbor Charter School
455 Riverview Drive
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Benton Harbor Charter School",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.45628357,42.10231781),"
Benton Harbor High School
870 Colfax Avenue
Benton Harbor, MI 49022

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Benton Harbor High School",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.41721344,42.10856247),"
Boynton Montessori Program
1700 E. Britain Avenue
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Boynton Montessori Program",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.45352100,42.10894500),"
Calvin Britain Elementary School
209 E. Britain Avenue
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Calvin Britain Elementary School",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.44068146,42.10587692),"
Career/technical Center
653 Valley Drive
Benton Harbor, MI 49022

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Career/technical Center",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.32800400,42.07943600),"
Countryside Academy-elementary
4800 Meadowbrook Road
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Countryside Academy-elementary",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.34186554,42.07936478),"
Countryside Charter School
4800 Meadowbrook Road
Benton Harbor, MI 49022

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Countryside Charter School",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.45601654,42.13027191),"
Creative Arts Academy
885 N. Shore Drive
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Creative Arts Academy",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.44141388,42.08089447),"
Creative Arts/gifted & Talented Academy
1995 Union Street
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Creative Arts/gifted & Talented Academy",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.44121552,42.08088303),"
Fair Plain East Elementary S
1995 Union Street
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fair Plain East Elementary S",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.45539856,42.08696365),"
Fair Plain Middle School
120 E. Napier Avenue
Benton Harbor, MI 49022

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fair Plain Middle School",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.44870100,42.09254000),"
Fair Plain Northeast Elementary School
400 Donald Adkins Dr.
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fair Plain Northeast Elementary School",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.41719818,42.10969925),"
Fair Plain West Elementary S
1901 Fair Plain Avenue
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fair Plain West Elementary S",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.46554565,42.08334732),"
Fair Plain West Elementary School
1901 Fairplain Avenue
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fair Plain West Elementary School",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.46348572,42.09218979),"
Gifted And Talented Academy
1452 Learning Lane
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gifted And Talented Academy",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.41674805,42.12290192),"
Hull Middle School
1716 Territorial Road
Benton Harbor, MI 49022

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hull Middle School",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.44031525,42.10876465),"
King Elementary School
750 E. Britain Avenue
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("King Elementary School",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.40608215,42.13593674),"
Martindale Elementary School
2199 Laurel Drive
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Martindale Elementary School",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.44031525,42.10963058),"
Mccord Renaissance Center
465 S. Mccord St.
Benton Harbor, MI 49022

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mccord Renaissance Center",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.43690800,42.11267900),"
Mildred C. Wells Preparatory Academy
281 South Fair Avenue
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mildred C. Wells Preparatory Academy",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.44049072,42.10889435),"
Mlk Elementary School
750 E. Britain Avenue
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mlk Elementary School",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.44601440,42.11895370),"
Morton Elementary School
267 N. Hull Avenue
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Morton Elementary School",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.41719818,42.10969925),"
Pipestone Pre-school Center
636 Pipestone Road
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pipestone Pre-school Center",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.42649078,42.09235382),"
Sorter Elementary School
1421 Pipestone Road
Benton Harbor, MI 49022

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sorter Elementary School",'Benton_Harbor=' + Benton_Harbor.length); Benton_Harbor[Benton_Harbor.length] = createMarker(new GPoint(-86.44871521,42.09738541),"
Sterne Brunson Elementary School
1651 Nickerson Rd.
Benton Harbor, MI 49022

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