function addMarkers() { mySelect = document.getElementById('selection'); New_Whiteland = [];Greenwood = [];Franklin = [];Whiteland = [];Edinburgh = [];Trafalgar = [];Bargersville = [];mySelect.options[mySelect.options.length] = new Option("Bargersville schools",'all=Bargersville'); mySelect.options[mySelect.options.length] = new Option("Edinburgh schools",'all=Edinburgh'); mySelect.options[mySelect.options.length] = new Option("Franklin schools",'all=Franklin'); mySelect.options[mySelect.options.length] = new Option("Greenwood schools",'all=Greenwood'); mySelect.options[mySelect.options.length] = new Option("New Whiteland schools",'all=New_Whiteland'); mySelect.options[mySelect.options.length] = new Option("Trafalgar schools",'all=Trafalgar'); mySelect.options[mySelect.options.length] = new Option("Whiteland schools",'all=Whiteland'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); New_Whiteland[New_Whiteland.length] = createMarker(new GPoint(-86.10187531,39.56270981),"
Break-o-day Elementary School
900 Sawmill Rd
New Whiteland, IN 46184

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Break-o-day Elementary School",'New_Whiteland=' + New_Whiteland.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.19682312,39.57981873),"
Center Grove Elementary School
2455 S Morgantown Rd
Greenwood, IN 46143

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Center Grove Elementary School",'Greenwood=' + Greenwood.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.19682312,39.57659531),"
Center Grove High School
2717 S Morgantown Rd
Greenwood, IN 46143

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Center Grove High School",'Greenwood=' + Greenwood.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.19538879,39.57733536),"
Center Grove Middle School
4900 Stones Crossing
Greenwood, IN 46143

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Center Grove Middle School",'Greenwood=' + Greenwood.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.20349884,39.61851883),"
Center Grove Middle School North
202 N Morgantown Rd
Greenwood, IN 46142

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Center Grove Middle School North",'Greenwood=' + Greenwood.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.20349884,39.61851883),"
Central Nine Career Center
1999 Us 31 S
Greenwood, IN 46143

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Nine Career Center",'Greenwood=' + Greenwood.length); Franklin[Franklin.length] = createMarker(new GPoint(-85.99549103,39.58230972),"
Clark Elementary School
5764 E 700 N
Franklin, IN 46131

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clark Elementary School",'Franklin=' + Franklin.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.07826500,39.58634100),"
Clark Pleasant Intermediate School
2111 Sheek Rd
Greenwood, IN 46143

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Clark Pleasant Intermediate School",'Greenwood=' + Greenwood.length); Whiteland[Whiteland.length] = createMarker(new GPoint(-86.08780670,39.55519104),"
Clark Pleasant Middle School
222 Tracy St
Whiteland, IN 46184

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Clark Pleasant Middle School",'Whiteland=' + Whiteland.length); Franklin[Franklin.length] = createMarker(new GPoint(-86.05519867,39.48154068),"
Creekside Elementary School
700 E Sr 44
Franklin, IN 46131

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Creekside Elementary School",'Franklin=' + Franklin.length); Franklin[Franklin.length] = createMarker(new GPoint(-86.05519867,39.48154068),"
Custer Baker Middle School
101 W Sr 44
Franklin, IN 46131

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Custer Baker Middle School",'Franklin=' + Franklin.length); Edinburgh[Edinburgh.length] = createMarker(new GPoint(-85.95541382,39.35466003),"
East Side Elementary School
810 E Main Cross St
Edinburgh, IN 46124

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Side Elementary School",'Edinburgh=' + Edinburgh.length); Edinburgh[Edinburgh.length] = createMarker(new GPoint(-85.96987915,39.35216141),"
Edinburgh Community High School
300 S Keeley St
Edinburgh, IN 46124

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Edinburgh Community High School",'Edinburgh=' + Edinburgh.length); Edinburgh[Edinburgh.length] = createMarker(new GPoint(-85.96987915,39.35216141),"
Edinburgh Community Middle School
300 S Keeley St
Edinburgh, IN 46124

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Edinburgh Community Middle School",'Edinburgh=' + Edinburgh.length); Franklin[Franklin.length] = createMarker(new GPoint(-86.06372070,39.48545837),"
Franklin Community High School
625 Grizzly Cub Dr
Franklin, IN 46131

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Franklin Community High School",'Franklin=' + Franklin.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.11751556,39.60606384),"
Greenwood Community High School
615 W Smith Valley Rd
Greenwood, IN 46142

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greenwood Community High School",'Greenwood=' + Greenwood.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.10758209,39.60805130),"
Greenwood Middle School
523 S Madison Ave
Greenwood, IN 46142

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Greenwood Middle School",'Greenwood=' + Greenwood.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.09882355,39.62723923),"
Greenwood Northeast Elementary School
99 Crestview Dr
Greenwood, IN 46143

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greenwood Northeast Elementary School",'Greenwood=' + Greenwood.length); Trafalgar[Trafalgar.length] = createMarker(new GPoint(-86.15361023,39.41610336),"
Indian Creek Elementary School
200 W Pearl St
Trafalgar, IN 46181

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Indian Creek Elementary School",'Trafalgar=' + Trafalgar.length); Trafalgar[Trafalgar.length] = createMarker(new GPoint(-86.19396973,39.43139648),"
Indian Creek Intermediate School
1000 S Indian Crk Dr
Trafalgar, IN 46181

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Indian Creek Intermediate School",'Trafalgar=' + Trafalgar.length); Trafalgar[Trafalgar.length] = createMarker(new GPoint(-86.13925934,39.37139893),"
Indian Creek Middle School
801 W Indian Creek Dr
Trafalgar, IN 46181

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Indian Creek Middle School",'Trafalgar=' + Trafalgar.length); Trafalgar[Trafalgar.length] = createMarker(new GPoint(-86.13925934,39.37139893),"
Indian Creek Senior High School
803 W Indian Creek Dr
Trafalgar, IN 46181

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Indian Creek Senior High School",'Trafalgar=' + Trafalgar.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.19672394,39.57251740),"
Maple Grove Elementary School
2911 S Morgantown Rd
Greenwood, IN 46143

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Maple Grove Elementary School",'Greenwood=' + Greenwood.length); Franklin[Franklin.length] = createMarker(new GPoint(-86.04075623,39.49015045),"
Needham Elementary School
1399 Upper Shelbyville Rd
Franklin, IN 46131

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Needham Elementary School",'Franklin=' + Franklin.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.16263580,39.62053680),"
North Grove Elementary School
3280 W Fairview Rd
Greenwood, IN 46142

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Grove Elementary School",'Greenwood=' + Greenwood.length); Franklin[Franklin.length] = createMarker(new GPoint(-86.06372070,39.48998642),"
Northwood Elementary School
965 Grizzly Cub Dr
Franklin, IN 46131

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northwood Elementary School",'Franklin=' + Franklin.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.20233154,39.61960602),"
Pleasant Grove Elementary School
5199 W Fairview Rd
Greenwood, IN 46142

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Grove Elementary School",'Greenwood=' + Greenwood.length); New_Whiteland[New_Whiteland.length] = createMarker(new GPoint(-86.10187531,39.55834198),"
Sawmill Woods Elementary School
700 Sawmill Rd
New Whiteland, IN 46184

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sawmill Woods Elementary School",'New_Whiteland=' + New_Whiteland.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.11757660,39.60606384),"
Southwest Elementary School
619 W Smith Valley
Greenwood, IN 46142

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southwest Elementary School",'Greenwood=' + Greenwood.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.18022919,39.60539627),"
Sugar Grove Elementary School
4135 W Smith Valley Rd
Greenwood, IN 46142

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sugar Grove Elementary School",'Greenwood=' + Greenwood.length); Bargersville[Bargersville.length] = createMarker(new GPoint(-86.17630005,39.47653580),"
Union Elementary School
3990 W Division Rd
Bargersville, IN 46106

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Union Elementary School",'Bargersville=' + Bargersville.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.10551453,39.61578751),"
V O Isom Central Elementary School
50 E Broadway
Greenwood, IN 46143

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("V O Isom Central Elementary School",'Greenwood=' + Greenwood.length); Franklin[Franklin.length] = createMarker(new GPoint(-86.03437805,39.48606491),"
Webb Elementary School
1400 Webb Ct
Franklin, IN 46131

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Webb Elementary School",'Franklin=' + Franklin.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.21187592,39.60503769),"
West Grove Elementary School
5800 W Smith Valley Rd
Greenwood, IN 46142

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Grove Elementary School",'Greenwood=' + Greenwood.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.13693237,39.60002518),"
Westwood Elementary School
899 Honey Creek Rd
Greenwood, IN 46143

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westwood Elementary School",'Greenwood=' + Greenwood.length); Whiteland[Whiteland.length] = createMarker(new GPoint(-86.08213043,39.55013657),"
Whiteland Community High School
300 Main St
Whiteland, IN 46184

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Whiteland Community High School",'Whiteland=' + Whiteland.length); Whiteland[Whiteland.length] = createMarker(new GPoint(-86.08029938,39.55200577),"
Whiteland Elementary School
120 Center St
Whiteland, IN 46184

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