function addMarkers() { mySelect = document.getElementById('selection'); Sterling_Heights = [];Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.01108551,42.58605194),"
Adlai Stevenson High School
39701 Dodge Park Road
Sterling Heights, MI 48313

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Adlai Stevenson High School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.07530975,42.53981781),"
Angus Elementary School
3180 Hein Drive
Sterling Heights, MI 48310

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Angus Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.00371552,42.61004257),"
Bemis Junior High School
12500 19 Mile Road
Sterling Heights, MI 48313

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bemis Junior High School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-82.98348999,42.54367828),"
Black Elementary School
14100 Heritage Road
Sterling Heights, MI 48312

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Black Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.00646210,42.55596161),"
Bozymowski Center
11870 Eldorado Drive
Sterling Heights, MI 48312

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bozymowski Center",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.00646210,42.55596161),"
Bozymowski Center Middle School
11870 Eldorado Drive
Sterling Heights, MI 48312

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bozymowski Center Middle School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.00444794,42.61002731),"
Browning Elementary School
12400 19 Mile Road
Sterling Heights, MI 48313

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Browning Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-82.99710083,42.56337357),"
Bruce Collins Elementary School
12900 Grand Haven Drive
Sterling Heights, MI 48312

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bruce Collins Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.07073975,42.59701157),"
Burr Elementary School
41460 Ryan Road
Sterling Heights, MI 48314

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Burr Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.00350952,42.55181885),"
Career Preparation Center
12200 15 Mile Road
Sterling Heights, MI 48312

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Career Preparation Center",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.02056885,42.55134583),"
Carleton Middle School
8900 15 Mile Road
Sterling Heights, MI 48312

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Carleton Middle School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.01497650,42.57892609),"
Davis Junior High School
11311 Plumbrook Road
Sterling Heights, MI 48312

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Davis Junior High School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.00688171,42.58375168),"
Dekeyser Elementary School
39600 Atkinson Drive
Sterling Heights, MI 48313

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dekeyser Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.01512909,42.61293793),"
Dresden Elementary School
11400 Delvin Drive
Sterling Heights, MI 48314

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dresden Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.02197266,42.54608917),"
Fillmore Elementary School
8655 Irving Road
Sterling Heights, MI 48312

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fillmore Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.08010101,42.57122421),"
Flynn Middle School
2899 Fox Hill Drive
Sterling Heights, MI 48310

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Flynn Middle School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.07955170,42.58958817),"
Frank Jeannette Junior High School
40400 Gulliver Drive
Sterling Heights, MI 48310

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Frank Jeannette Junior High School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.05566406,42.53605652),"
Fuhrmann Middle School
5155 E. 14 Mile Road
Sterling Heights, MI 48310

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fuhrmann Middle School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-82.98228455,42.60311890),"
Graebner Elementary School
41875 Saal Road
Sterling Heights, MI 48313

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Graebner Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.06973267,42.55505753),"
Grissom Middle School
35701 Ryan Road
Sterling Heights, MI 48310

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Grissom Middle School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.05911255,42.53986359),"
Harwood Elementary School
4900 Southlawn Drive
Sterling Heights, MI 48310

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Harwood Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.05508423,42.55121231),"
Hatherly Elementary School
35201 Davison Street
Sterling Heights, MI 48310

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hatherly Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-82.99212646,42.60212326),"
Havel Elementary School
41855 Schoenherr Road
Sterling Heights, MI 48313

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Havel Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.01072693,42.60216141),"
Henry Ford Ii High School
11911 Clinton River Road
Sterling Heights, MI 48313

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Henry Ford Ii High School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.01016998,42.56941223),"
Heritage Junior High School
37400 Dodge Park Road
Sterling Heights, MI 48312

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Heritage Junior High School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.08158875,42.56871033),"
Holden Elementary School
37565 Calka Drive
Sterling Heights, MI 48310

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holden Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.01436615,42.56654739),"
Huron Academy
11401 Metro Parkway
Sterling Heights, MI 48312

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Huron Academy",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-82.99880219,42.60110092),"
Jack Harvey Elementary School
41700 Montroy Drive
Sterling Heights, MI 48313

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jack Harvey Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.06558228,42.57034683),"
Jefferson Elementary School
37555 Carol Drive
Sterling Heights, MI 48310

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.00269318,42.62402344),"
Magahay Elementary School
44700 Oleander Drive
Sterling Heights, MI 48313

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Magahay Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.01271057,42.54823685),"
Maple Lane School
34600 Dryden Drive
Sterling Heights, MI 48312

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Maple Lane School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.02169037,42.57710266),"
Messmore Elementary School
8742 Dill Drive
Sterling Heights, MI 48312

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Messmore Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.01536560,42.56264496),"
Naomi Gibbing Elementary School
11303 Greendale Drive
Sterling Heights, MI 48312

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Naomi Gibbing Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.00577545,42.57046127),"
Oakbrook Elementary School
12060 Greenway Drive
Sterling Heights, MI 48312

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oakbrook Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.02140808,42.58436203),"
Plumbrook Elementary School
39660 Spalding Drive
Sterling Heights, MI 48313

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Plumbrook Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-82.99726105,42.57889557),"
Rose Kidd Elementary School
38397 Gladstone Drive
Sterling Heights, MI 48312

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rose Kidd Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.08161163,42.58276367),"
Schuchard Elementary School
2900 Holly Drive
Sterling Heights, MI 48310

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Schuchard Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.02571106,42.59173584),"
Schwarzkoff Elementary School
8401 Constitution Boulevard
Sterling Heights, MI 48313

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Schwarzkoff Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-82.99798584,42.55214310),"
Sterling Heights Senior High School
12901 15 Mile Road
Sterling Heights, MI 48312

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sterling Heights Senior High School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.07528687,42.56017303),"
Thorpe Elementary School
36095 English Drive
Sterling Heights, MI 48310

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thorpe Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-82.99690247,42.64294052),"
Utica Learning Academy
7600 18 Mile Road
Sterling Heights, MI 48314

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Utica Learning Academy",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.01088715,42.58023071),"
Walsh Elementary School
38901 Dodge Park Road
Sterling Heights, MI 48312

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Walsh Elementary School",'Sterling_Heights=' + Sterling_Heights.length); Sterling_Heights[Sterling_Heights.length] = createMarker(new GPoint(-83.01880646,42.55573654),"
Willow Woods Elementary School
11001 Daniel Drive
Sterling Heights, MI 48312

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