function addMarkers() { mySelect = document.getElementById('selection'); Howell = [];Howell[Howell.length] = createMarker(new GPoint(-83.95146179,42.61271286),"
Adult Transition Building
1425 W. Grand River Ave.
Howell, MI 48843

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Adult Transition Building",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.71720123,42.64089966),"
Alternative Education
9525 E. Highland Rd.
Howell, MI 48843

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alternative Education",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-84.07357025,42.66736984),"
Challenger Elementary School
1066 W. Grand River
Howell, MI 48843

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Challenger Elementary School",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.75928497,42.63270569),"
Charyl Stockwell Academy
9758 E. Highland Road
Howell, MI 48843

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Charyl Stockwell Academy",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.92490900,42.60544000),"
Highlander Way Middle School
511 N. Highlander Way
Howell, MI 48843

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Highlander Way Middle School",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.95256100,42.61382800),"
Howell Community Education
1400 W. Grand River
Howell, MI 48843

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Howell Community Education",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-84.07357025,42.66736984),"
Howell High School
1200 W. Grand River
Howell, MI 48843

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Howell High School",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.88140106,42.58694839),"
Kensington Woods High School
3750 Cleary Drive
Howell, MI 48843

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kensington Woods High School",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.87409973,42.58205032),"
Latson Road Elementary School
1201 South Latson Road
Howell, MI 48843

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Latson Road Elementary School",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-84.07357025,42.66736984),"
Mcpherson Middle School
1400 W. Grand River
Howell, MI 48843

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mcpherson Middle School",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.93162537,42.61827850),"
Northwest Elementary School
1233 Bower Street
Howell, MI 48843

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northwest Elementary School",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.95204926,42.61284637),"
Pathway School
1429 W. Grand River Avenue
Howell, MI 48843

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pathway School",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.95169067,42.61275864),"
Renaissance Alternative School
1413 W. Grand River Avenue
Howell, MI 48843

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Renaissance Alternative School",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.88540649,42.63096619),"
Ruahmah J. Hutchings Elementary School
3503 Bigelow Road
Howell, MI 48855

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ruahmah J. Hutchings Elementary School",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.91959381,42.60247421),"
Southeast Elementary School
861 E. Sibley Street
Howell, MI 48843

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southeast Elementary School",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.94092560,42.60742188),"
Southwest Elementary School
915 Gay Street
Howell, MI 48843

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southwest Elementary School",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.87047577,42.55625153),"
Three Fires Middle School
4125 Crooked Lake Road
Howell, MI 48843

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Three Fires Middle School",'Howell=' + Howell.length); Howell[Howell.length] = createMarker(new GPoint(-83.94158173,42.62155151),"
Voyager Elementary School
1450 Byron Road
Howell, MI 48843

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