function addMarkers() { mySelect = document.getElementById('selection'); Michigan_City = [];Laporte = [];Kingsford_Heights = [];Lacrosse = [];New_Carlisle = [];Rolling_Prairie = [];Union_Mills = [];Wanatah = [];Westville = [];mySelect.options[mySelect.options.length] = new Option("Kingsford Heights schools",'all=Kingsford_Heights'); mySelect.options[mySelect.options.length] = new Option("Lacrosse schools",'all=Lacrosse'); mySelect.options[mySelect.options.length] = new Option("Laporte schools",'all=Laporte'); mySelect.options[mySelect.options.length] = new Option("Michigan City schools",'all=Michigan_City'); mySelect.options[mySelect.options.length] = new Option("New Carlisle schools",'all=New_Carlisle'); mySelect.options[mySelect.options.length] = new Option("Rolling Prairie schools",'all=Rolling_Prairie'); mySelect.options[mySelect.options.length] = new Option("Union Mills schools",'all=Union_Mills'); mySelect.options[mySelect.options.length] = new Option("Wanatah schools",'all=Wanatah'); mySelect.options[mySelect.options.length] = new Option("Westville schools",'all=Westville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.90492249,41.69696045),"
A K Smith Area Career Center
817 Lafayette St
Michigan City, IN 46360

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("A K Smith Area Career Center",'Michigan_City=' + Michigan_City.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.88725281,41.68736267),"
Barker Middle School
319 E Barker Rd
Michigan City, IN 46360

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Barker Middle School",'Michigan_City=' + Michigan_City.length); Laporte[Laporte.length] = createMarker(new GPoint(-86.71003723,41.59725952),"
Camp Summit
2407 N 500 W
Laporte, IN 46350

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Camp Summit",'Laporte=' + Laporte.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.87668610,41.65140533),"
Coolspring Elementary School
9121 W 300 N
Michigan City, IN 46360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Coolspring Elementary School",'Michigan_City=' + Michigan_City.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.88568115,41.69145584),"
Edgewood Elementary School
502 Boyd Cir
Michigan City, IN 46360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edgewood Elementary School",'Michigan_City=' + Michigan_City.length); Laporte[Laporte.length] = createMarker(new GPoint(-86.76289368,41.64226151),"
F Willard Crichfield Elementary School
336 W Johnson Rd
Laporte, IN 46350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("F Willard Crichfield Elementary School",'Laporte=' + Laporte.length); Laporte[Laporte.length] = createMarker(new GPoint(-86.70199585,41.61023712),"
Hailmann Elementary School
1001 E Ohio St
Laporte, IN 46350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hailmann Elementary School",'Laporte=' + Laporte.length); Laporte[Laporte.length] = createMarker(new GPoint(-86.72332001,41.59844208),"
Handley Elementary School
408 10th St
Laporte, IN 46350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Handley Elementary School",'Laporte=' + Laporte.length); Laporte[Laporte.length] = createMarker(new GPoint(-86.72280121,41.60729980),"
Indian Trail Elementary School
3214 S Sr 104
Laporte, IN 46350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Indian Trail Elementary School",'Laporte=' + Laporte.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.87341309,41.69483566),"
Joy Elementary School
1600 E Coolspring
Michigan City, IN 46360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Joy Elementary School",'Michigan_City=' + Michigan_City.length); Laporte[Laporte.length] = createMarker(new GPoint(-86.71701050,41.59126282),"
Kesling Middle School
306 E 18th St
Laporte, IN 46350

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kesling Middle School",'Laporte=' + Laporte.length); Laporte[Laporte.length] = createMarker(new GPoint(-86.71628571,41.54688263),"
Kingsbury Elementary School
0802 W 400 S
Laporte, IN 46350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kingsbury Elementary School",'Laporte=' + Laporte.length); Kingsford_Heights[Kingsford_Heights.length] = createMarker(new GPoint(-86.69635773,41.48203659),"
Kingsford Heights Elementary School
460 Evanston Rd Box 370
Kingsford Heights, IN 46346

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kingsford Heights Elementary School",'Kingsford_Heights=' + Kingsford_Heights.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.90615845,41.69621277),"
Knapp Elementary School
321 Bolka Ave
Michigan City, IN 46360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Knapp Elementary School",'Michigan_City=' + Michigan_City.length); Lacrosse[Lacrosse.length] = createMarker(new GPoint(-86.89019775,41.31875992),"
La Crosse Elementary & High School
11 N Michigan Po Box 360
Lacrosse, IN 46348

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("La Crosse Elementary & High School",'Lacrosse=' + Lacrosse.length); Lacrosse[Lacrosse.length] = createMarker(new GPoint(-86.89019775,41.31875992),"
La Crosse High School
11 N Michigan Po Box 360
Lacrosse, IN 46348

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("La Crosse High School",'Lacrosse=' + Lacrosse.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.90492249,41.69696045),"
Lakeside Correctional Facility High School
201 Woodlawn Ave
Michigan City, IN 46361

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lakeside Correctional Facility High School",'Michigan_City=' + Michigan_City.length); Laporte[Laporte.length] = createMarker(new GPoint(-86.72558594,41.60194778),"
Laporte High School
602 ''f'' St
Laporte, IN 46350

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Laporte High School",'Laporte=' + Laporte.length); Laporte[Laporte.length] = createMarker(new GPoint(-86.71665192,41.61030197),"
Lincoln Elementary School
402 Harrison St
Laporte, IN 46350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Laporte=' + Laporte.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.89201355,41.70763779),"
Marsh Elementary School
400 E Homer St
Michigan City, IN 46360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Marsh Elementary School",'Michigan_City=' + Michigan_City.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.85507965,41.71673584),"
Martin T Krueger Middle School
2001 Springland Ave
Michigan City, IN 46360

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Martin T Krueger Middle School",'Michigan_City=' + Michigan_City.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.88478851,41.71233749),"
Michigan City Alternative High School
1201 E Michigan Blvd
Michigan City, IN 46360

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Michigan City Alternative High School",'Michigan_City=' + Michigan_City.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.86526489,41.68006134),"
Michigan City High School
8466 W Pahs Rd
Michigan City, IN 46360

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Michigan City High School",'Michigan_City=' + Michigan_City.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.89470673,41.71066284),"
Michigan City Junior High School
317 Detroit St
Michigan City, IN 46360

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Michigan City Junior High School",'Michigan_City=' + Michigan_City.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.88446045,41.72769547),"
Mullen Elementary School
100 Manny Ct
Michigan City, IN 46360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mullen Elementary School",'Michigan_City=' + Michigan_City.length); New_Carlisle[New_Carlisle.length] = createMarker(new GPoint(-86.56441498,41.68761444),"
New Prairie High School
5333 N Cougar Rd
New Carlisle, IN 46552

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Prairie High School",'New_Carlisle=' + New_Carlisle.length); New_Carlisle[New_Carlisle.length] = createMarker(new GPoint(-86.56441498,41.68755341),"
New Prairie Junior High School
5331 N Cougar Rd
New Carlisle, IN 46552

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("New Prairie Junior High School",'New_Carlisle=' + New_Carlisle.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.84056854,41.72317505),"
Niemann Elementary School
811 Royal Rd
Michigan City, IN 46360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Niemann Elementary School",'Michigan_City=' + Michigan_City.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.91617584,41.71193314),"
Park Elementary School
222 Mcclelland Ave
Michigan City, IN 46360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Park Elementary School",'Michigan_City=' + Michigan_City.length); Laporte[Laporte.length] = createMarker(new GPoint(-86.72280121,41.60729980),"
Park School
602 1st St
Laporte, IN 46350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Park School",'Laporte=' + Laporte.length); Laporte[Laporte.length] = createMarker(new GPoint(-86.72336578,41.60681152),"
Paul F Boston Middle School
1000 Harrison St
Laporte, IN 46350

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Paul F Boston Middle School",'Laporte=' + Laporte.length); Rolling_Prairie[Rolling_Prairie.length] = createMarker(new GPoint(-86.56983948,41.70959854),"
Prairie View Elementary School
6434 E 700 N
Rolling Prairie, IN 46371

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Prairie View Elementary School",'Rolling_Prairie=' + Rolling_Prairie.length); Laporte[Laporte.length] = createMarker(new GPoint(-86.73466492,41.61412430),"
Riley Elementary School
516 Weller Ave
Laporte, IN 46350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riley Elementary School",'Laporte=' + Laporte.length); Rolling_Prairie[Rolling_Prairie.length] = createMarker(new GPoint(-86.61103058,41.67598343),"
Rolling Prairie Elementary School
605 E Michigan St
Rolling Prairie, IN 46371

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rolling Prairie Elementary School",'Rolling_Prairie=' + Rolling_Prairie.length); Union_Mills[Union_Mills.length] = createMarker(new GPoint(-86.81503296,41.46455002),"
South Central Elementary School
9808 S 600 W
Union Mills, IN 46382

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Central Elementary School",'Union_Mills=' + Union_Mills.length); Union_Mills[Union_Mills.length] = createMarker(new GPoint(-86.81503296,41.46455002),"
South Central Junior Senior High School
9808 S 600 W
Union Mills, IN 46382

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Central Junior Senior High School",'Union_Mills=' + Union_Mills.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.75931549,41.72247696),"
Springfield Elementary School
3054 W 800 N
Michigan City, IN 46360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Springfield Elementary School",'Michigan_City=' + Michigan_City.length); Wanatah[Wanatah.length] = createMarker(new GPoint(-86.89182281,41.42755890),"
Wanatah Public School
309 School Dr Po Box 249
Wanatah, IN 46390

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wanatah Public School",'Wanatah=' + Wanatah.length); Westville[Westville.length] = createMarker(new GPoint(-86.89450836,41.54093552),"
Westville Elementary School
207 Valparaiso St
Westville, IN 46391

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westville Elementary School",'Westville=' + Westville.length); Westville[Westville.length] = createMarker(new GPoint(-86.91149902,41.55820084),"
Westville High School
207 Valparaiso St
Westville, IN 46391

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westville High School",'Westville=' + Westville.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(Kingsford_Heights); map.removeOverlays(Lacrosse); map.removeOverlays(Laporte); map.removeOverlays(Michigan_City); map.removeOverlays(New_Carlisle); map.removeOverlays(Rolling_Prairie); map.removeOverlays(Union_Mills); map.removeOverlays(Wanatah); map.removeOverlays(Westville); 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(Michigan_City);map.removeOverlays(Kingsford_Heights); map.removeOverlays(Lacrosse); map.removeOverlays(Laporte); map.removeOverlays(Michigan_City); map.removeOverlays(New_Carlisle); map.removeOverlays(Rolling_Prairie); map.removeOverlays(Union_Mills); map.removeOverlays(Wanatah); map.removeOverlays(Westville); map.addOverlays(Kingsford_Heights); centerByArray(Kingsford_Heights, false, false); cntMarker += Kingsford_Heights.length; map.addOverlays(Lacrosse); centerByArray(Lacrosse, false, false); cntMarker += Lacrosse.length; map.addOverlays(Laporte); centerByArray(Laporte, false, false); cntMarker += Laporte.length; map.addOverlays(Michigan_City); centerByArray(Michigan_City, false, false); cntMarker += Michigan_City.length; map.addOverlays(New_Carlisle); centerByArray(New_Carlisle, false, false); cntMarker += New_Carlisle.length; map.addOverlays(Rolling_Prairie); centerByArray(Rolling_Prairie, false, false); cntMarker += Rolling_Prairie.length; map.addOverlays(Union_Mills); centerByArray(Union_Mills, false, false); cntMarker += Union_Mills.length; map.addOverlays(Wanatah); centerByArray(Wanatah, false, false); cntMarker += Wanatah.length; map.addOverlays(Westville); centerByArray(Westville, false, false); cntMarker += Westville.length; centerByArray(Michigan_City,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'); } }