function addMarkers() { mySelect = document.getElementById('selection'); Chesterton = [];Valparaiso = [];Boone_Grove = [];Portage = [];Hebron = [];Kouts = [];Porter = [];Michigan_City = [];mySelect.options[mySelect.options.length] = new Option("Boone Grove schools",'all=Boone_Grove'); mySelect.options[mySelect.options.length] = new Option("Chesterton schools",'all=Chesterton'); mySelect.options[mySelect.options.length] = new Option("Hebron schools",'all=Hebron'); mySelect.options[mySelect.options.length] = new Option("Kouts schools",'all=Kouts'); mySelect.options[mySelect.options.length] = new Option("Michigan City schools",'all=Michigan_City'); mySelect.options[mySelect.options.length] = new Option("Portage schools",'all=Portage'); mySelect.options[mySelect.options.length] = new Option("Porter schools",'all=Porter'); mySelect.options[mySelect.options.length] = new Option("Valparaiso schools",'all=Valparaiso'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Chesterton[Chesterton.length] = createMarker(new GPoint(-87.05767059,41.60335541),"
Bailly Elementary School
800 S 5th St
Chesterton, IN 46304

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bailly Elementary School",'Chesterton=' + Chesterton.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.06571960,41.46229172),"
Benjamin Franklin Mid School
605 Campbell
Valparaiso, IN 46385

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Benjamin Franklin Mid School",'Valparaiso=' + Valparaiso.length); Boone_Grove[Boone_Grove.length] = createMarker(new GPoint(-87.07089996,41.45240021),"
Boone Grove Elementary School
325 W 550 S Po Box 91
Boone Grove, IN 46302

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Boone Grove Elementary School",'Boone_Grove=' + Boone_Grove.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.16194916,41.39664078),"
Boone Grove High School
260 S 500 W
Valparaiso, IN 46383

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Boone Grove High School",'Valparaiso=' + Valparaiso.length); Boone_Grove[Boone_Grove.length] = createMarker(new GPoint(-87.07089996,41.45240021),"
Boone Grove Middle School
325 W 550 S
Boone Grove, IN 46302

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Boone Grove Middle School",'Boone_Grove=' + Boone_Grove.length); Chesterton[Chesterton.length] = createMarker(new GPoint(-87.01904297,41.61692810),"
Brummitt Elementary School
2500 Indian Boundary
Chesterton, IN 46304

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brummitt Elementary School",'Chesterton=' + Chesterton.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.00392151,41.45621872),"
Central Elementary School
305 Franklin St
Valparaiso, IN 46383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Valparaiso=' + Valparaiso.length); Portage[Portage.length] = createMarker(new GPoint(-87.18931580,41.56996155),"
Central Elementary School
2825 Russell St
Portage, IN 46368

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Portage=' + Portage.length); Chesterton[Chesterton.length] = createMarker(new GPoint(-87.06069946,41.60926437),"
Chesterton Middle School
651 W Morgan Ave
Chesterton, IN 46304

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Chesterton Middle School",'Chesterton=' + Chesterton.length); Chesterton[Chesterton.length] = createMarker(new GPoint(-87.06089783,41.61230087),"
Chesterton Senior High School
2125 S 11th St
Chesterton, IN 46304

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chesterton Senior High School",'Chesterton=' + Chesterton.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.06465149,41.50013733),"
Cooks Corners Elementary School
358 Bullseye Lake Rd
Valparaiso, IN 46383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cooks Corners Elementary School",'Valparaiso=' + Valparaiso.length); Portage[Portage.length] = createMarker(new GPoint(-87.17742157,41.59389877),"
Crisman Elementary School
6161 Old Porter Rd
Portage, IN 46368

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Crisman Elementary School",'Portage=' + Portage.length); Portage[Portage.length] = createMarker(new GPoint(-87.14408112,41.58302689),"
Ethel R Jones Elementary School
2374 Mc Cool Rd
Portage, IN 46368

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ethel R Jones Elementary School",'Portage=' + Portage.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.03862762,41.50540161),"
Flint Lake Elementary School
4106 N Calumet Ave
Valparaiso, IN 46383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Flint Lake Elementary School",'Valparaiso=' + Valparaiso.length); Portage[Portage.length] = createMarker(new GPoint(-87.20248413,41.56336212),"
George L Myers Elementary School
3100 Willowdale
Portage, IN 46368

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George L Myers Elementary School",'Portage=' + Portage.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.09471893,41.46219635),"
Hayes-leonard Elementary School
653 Hayes Leonard Rd
Valparaiso, IN 46385

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hayes-leonard Elementary School",'Valparaiso=' + Valparaiso.length); Hebron[Hebron.length] = createMarker(new GPoint(-87.19979095,41.31635284),"
Hebron Elementary School
307 S Main St
Hebron, IN 46341

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hebron Elementary School",'Hebron=' + Hebron.length); Hebron[Hebron.length] = createMarker(new GPoint(-87.19979095,41.31635284),"
Hebron Junior Senior High School
307 S Main St
Hebron, IN 46341

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hebron Junior Senior High School",'Hebron=' + Hebron.length); Hebron[Hebron.length] = createMarker(new GPoint(-87.19555900,41.31846000),"
Hebron Middle School
307 S Main St
Hebron, IN 46341

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hebron Middle School",'Hebron=' + Hebron.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-86.98591614,41.55064011),"
Jackson Elementary School
811 N 400 E
Valparaiso, IN 46383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jackson Elementary School",'Valparaiso=' + Valparaiso.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.14270700,41.50721900),"
John Simatovich Elementary School
424 W 500 N
Valparaiso, IN 46385

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John Simatovich Elementary School",'Valparaiso=' + Valparaiso.length); Kouts[Kouts.length] = createMarker(new GPoint(-87.02249146,41.31457520),"
Kouts Elementary School
302 E College St Box 699
Kouts, IN 46347

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kouts Elementary School",'Kouts=' + Kouts.length); Kouts[Kouts.length] = createMarker(new GPoint(-87.02249146,41.31457520),"
Kouts Middle/high School
302 E College St Box 699
Kouts, IN 46347

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kouts Middle/high School",'Kouts=' + Kouts.length); Chesterton[Chesterton.length] = createMarker(new GPoint(-87.07627869,41.56463623),"
Liberty Elementary School
50-1 W 900 N
Chesterton, IN 46304

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liberty Elementary School",'Chesterton=' + Chesterton.length); Chesterton[Chesterton.length] = createMarker(new GPoint(-87.07627869,41.56436157),"
Liberty Intermediate School
50 W 900 N
Chesterton, IN 46304

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Liberty Intermediate School",'Chesterton=' + Chesterton.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.07394409,41.47383881),"
Memorial Elementary School
1052 Park Ave
Valparaiso, IN 46383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Memorial Elementary School",'Valparaiso=' + Valparaiso.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.06060028,41.47349167),"
Morgan Township Elementary School
299 S Sr 49
Valparaiso, IN 46383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Morgan Township Elementary School",'Valparaiso=' + Valparaiso.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.06060028,41.47349167),"
Morgan Township Middle/high School
299 S Sr 49
Valparaiso, IN 46383

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Morgan Township Middle/high School",'Valparaiso=' + Valparaiso.length); Porter[Porter.length] = createMarker(new GPoint(-87.07689667,41.61683655),"
Newton Yost Elementary School
100 W Beam St
Porter, IN 46304

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Newton Yost Elementary School",'Porter=' + Porter.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.06420135,41.48316193),"
Northview Elementary School
257 Northview Dr
Valparaiso, IN 46383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northview Elementary School",'Valparaiso=' + Valparaiso.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.04408264,41.47103882),"
Parkview Elementary School
1405 Wood St
Valparaiso, IN 46383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Parkview Elementary School",'Valparaiso=' + Valparaiso.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.12939453,41.54203415),"
Paul Saylor Elementary School
331 Midway
Valparaiso, IN 46383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Paul Saylor Elementary School",'Valparaiso=' + Valparaiso.length); Michigan_City[Michigan_City.length] = createMarker(new GPoint(-86.97188568,41.66313934),"
Pine Elementary School
1594 N 500 E
Michigan City, IN 46360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pine Elementary School",'Michigan_City=' + Michigan_City.length); Portage[Portage.length] = createMarker(new GPoint(-87.16551208,41.55073547),"
Portage High School
6450 Us Hwy 6
Portage, IN 46368

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Portage High School",'Portage=' + Portage.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.00392151,41.45621872),"
Porter County Career Center
1005 N Franklin
Valparaiso, IN 46383

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Porter County Career Center",'Valparaiso=' + Valparaiso.length); Hebron[Hebron.length] = createMarker(new GPoint(-87.20538330,41.40633774),"
Porter Lakes Elementary School
208 S 725 W
Hebron, IN 46341

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Porter Lakes Elementary School",'Hebron=' + Hebron.length); Portage[Portage.length] = createMarker(new GPoint(-87.16831970,41.57335281),"
Rowena Kyle Elementary School
2701 Hamstrom Rd
Portage, IN 46368

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rowena Kyle Elementary School",'Portage=' + Portage.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.14171600,41.54316711),"
South Haven Elementary School
395 W Midway Dr
Valparaiso, IN 46383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Haven Elementary School",'Valparaiso=' + Valparaiso.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.00392151,41.45621872),"
Special Education Division
750 Ransom Rd
Valparaiso, IN 46385

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Special Education Division",'Valparaiso=' + Valparaiso.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.04637909,41.48386002),"
Thomas Jefferson Elementary School
1700 Roosevelt Rd
Valparaiso, IN 46383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thomas Jefferson Elementary School",'Valparaiso=' + Valparaiso.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.04634857,41.48304749),"
Thomas Jefferson Middle School
1600 Roosevelt Rd
Valparaiso, IN 46383

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Thomas Jefferson Middle School",'Valparaiso=' + Valparaiso.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.18157959,41.47607422),"
Union Center Elementary School
272 N 600 W
Valparaiso, IN 46385

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Union Center Elementary School",'Valparaiso=' + Valparaiso.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.18131256,41.47823715),"
Union Township Middle School
599 W 300 N
Valparaiso, IN 46383

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Union Township Middle School",'Valparaiso=' + Valparaiso.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.06618500,41.49284744),"
Valparaiso High School
2727 N Campbell St
Valparaiso, IN 46385

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valparaiso High School",'Valparaiso=' + Valparaiso.length); Portage[Portage.length] = createMarker(new GPoint(-87.18651581,41.57603836),"
Wallace Aylesworth Elementary School
5910 Central Ave
Portage, IN 46368

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wallace Aylesworth Elementary School",'Portage=' + Portage.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.06060028,41.47349167),"
Washington Township Elementary School
383 E Sr 2
Valparaiso, IN 46383

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Township Elementary School",'Valparaiso=' + Valparaiso.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.03330231,41.48070145),"
Washington Twp Middle/high School
381 E Sr 2
Valparaiso, IN 46383

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Washington Twp Middle/high School",'Valparaiso=' + Valparaiso.length); Chesterton[Chesterton.length] = createMarker(new GPoint(-87.06069946,41.60926437),"
Westchester Intermediate School
1050 S 5th St
Chesterton, IN 46304

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Westchester Intermediate School",'Chesterton=' + Chesterton.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.17894900,41.47810700),"
Wheeler High School
587 W 300 N
Valparaiso, IN 46385

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wheeler High School",'Valparaiso=' + Valparaiso.length); Portage[Portage.length] = createMarker(new GPoint(-87.20674896,41.56523514),"
William Fegely Middle School
5384 Stone Ave
Portage, IN 46368

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("William Fegely Middle School",'Portage=' + Portage.length); Portage[Portage.length] = createMarker(new GPoint(-87.18462372,41.57593536),"
Willowcreek Middle School
5962 Central Ave
Portage, IN 46368

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Willowcreek Middle School",'Portage=' + Portage.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(Boone_Grove); map.removeOverlays(Chesterton); map.removeOverlays(Hebron); map.removeOverlays(Kouts); map.removeOverlays(Michigan_City); map.removeOverlays(Portage); map.removeOverlays(Porter); map.removeOverlays(Valparaiso); 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(Chesterton);map.removeOverlays(Boone_Grove); map.removeOverlays(Chesterton); map.removeOverlays(Hebron); map.removeOverlays(Kouts); map.removeOverlays(Michigan_City); map.removeOverlays(Portage); map.removeOverlays(Porter); map.removeOverlays(Valparaiso); map.addOverlays(Boone_Grove); centerByArray(Boone_Grove, false, false); cntMarker += Boone_Grove.length; map.addOverlays(Chesterton); centerByArray(Chesterton, false, false); cntMarker += Chesterton.length; map.addOverlays(Hebron); centerByArray(Hebron, false, false); cntMarker += Hebron.length; map.addOverlays(Kouts); centerByArray(Kouts, false, false); cntMarker += Kouts.length; map.addOverlays(Michigan_City); centerByArray(Michigan_City, false, false); cntMarker += Michigan_City.length; map.addOverlays(Portage); centerByArray(Portage, false, false); cntMarker += Portage.length; map.addOverlays(Porter); centerByArray(Porter, false, false); cntMarker += Porter.length; map.addOverlays(Valparaiso); centerByArray(Valparaiso, false, false); cntMarker += Valparaiso.length; centerByArray(Chesterton,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'); } }