function addMarkers(){ mySelect = document.getElementById('selection'); New_Albany = [];Fort_Wayne = [];Crawfordsville = [];Indianapolis = [];Terre_Haute = [];Greenwood = [];Valparaiso = [];Oldenburg = [];Plainfield = [];Scottsburg = [];Seymour = [];South_Bend = [];mySelect.options[mySelect.options.length] = new Option("Crawfordsville schools",'all=Crawfordsville'); mySelect.options[mySelect.options.length] = new Option("Fort Wayne schools",'all=Fort_Wayne'); mySelect.options[mySelect.options.length] = new Option("Greenwood schools",'all=Greenwood'); mySelect.options[mySelect.options.length] = new Option("Indianapolis schools",'all=Indianapolis'); mySelect.options[mySelect.options.length] = new Option("New Albany schools",'all=New_Albany'); mySelect.options[mySelect.options.length] = new Option("Oldenburg schools",'all=Oldenburg'); mySelect.options[mySelect.options.length] = new Option("Plainfield schools",'all=Plainfield'); mySelect.options[mySelect.options.length] = new Option("Scottsburg schools",'all=Scottsburg'); mySelect.options[mySelect.options.length] = new Option("Seymour schools",'all=Seymour'); mySelect.options[mySelect.options.length] = new Option("South Bend schools",'all=South_Bend'); mySelect.options[mySelect.options.length] = new Option("Terre Haute schools",'all=Terre_Haute'); mySelect.options[mySelect.options.length] = new Option("Valparaiso schools",'all=Valparaiso'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); New_Albany[New_Albany.length] = createMarker(new GPoint(-85.82704200,38.32566700),"
Christian Academy of Indiana
1000 Academy Drive
New Albany, IN 47150
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Academy of Indiana",'New_Albany=' + New_Albany.length); Fort_Wayne[Fort_Wayne.length] = createMarker(new GPoint(-85.19021400,41.07287700),"
Cornerstone College Prep School
3815 W Jefferson Blvd
Fort Wayne, IN 46804
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone College Prep School",'Fort_Wayne=' + Fort_Wayne.length); Crawfordsville[Crawfordsville.length] = createMarker(new GPoint(-86.87508700,40.03543700),"
Fremont Street Bapt Academy
1908 East Fremont Street
Crawfordsville, IN 47933
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fremont Street Bapt Academy",'Crawfordsville=' + Crawfordsville.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.17467800,39.87635800),"
Hasten Hebrew Academy
6602 Hoover Road
Indianapolis, IN 46260
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hasten Hebrew Academy",'Indianapolis=' + Indianapolis.length); Terre_Haute[Terre_Haute.length] = createMarker(new GPoint(-87.39850000,39.39590000),"
Holy Cross School
6301 S Us Highway 41
Terre Haute, IN 47802
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Cross School",'Terre_Haute=' + Terre_Haute.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.16197700,39.84273700),"
International School Of Indiana
4330 N Michigan Road
Indianapolis, IN 46208
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("International School Of Indiana",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.06907400,39.81113700),"
Jewel Christian Academy
5750 E 30th Street
Indianapolis, IN 46218
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jewel Christian Academy",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.10008900,39.80685000),"
Jireh Academy
Po Box 18679
Indianapolis, IN 46218
Co-ed school, K-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jireh Academy",'Indianapolis=' + Indianapolis.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-86.13694000,39.62810000),"
Meridian Academy Of Arts
Fry Road
Greenwood, IN 46142
Co-ed school, -
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Meridian Academy Of Arts",'Greenwood=' + Greenwood.length); Valparaiso[Valparaiso.length] = createMarker(new GPoint(-87.02198800,41.47503300),"
Northstar Multiage Academy & Preparatory
3209 Cascade Drive Suite A
Valparaiso, IN 46383
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northstar Multiage Academy & Preparatory",'Valparaiso=' + Valparaiso.length); Oldenburg[Oldenburg.length] = createMarker(new GPoint(-85.22620000,39.37120000),"
Oldenburg Academy
Po Box 200
Oldenburg, IN 47036
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oldenburg Academy",'Oldenburg=' + Oldenburg.length); Plainfield[Plainfield.length] = createMarker(new GPoint(-86.39336400,39.70179800),"
Plainfield Christian School
550 Saint Luke Drive
Plainfield, IN 46168
Co-ed school, 1-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Plainfield Christian School",'Plainfield=' + Plainfield.length); Scottsburg[Scottsburg.length] = createMarker(new GPoint(-85.78089200,38.69391500),"
Scottsburg Academy
630 N Gardner Street
Scottsburg, IN 47170
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Scottsburg Academy",'Scottsburg=' + Scottsburg.length); Seymour[Seymour.length] = createMarker(new GPoint(-85.90620000,38.96370000),"
St Johns Lutheran School
1058 S 460 E
Seymour, IN 47274
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Johns Lutheran School",'Seymour=' + Seymour.length); South_Bend[South_Bend.length] = createMarker(new GPoint(-86.23498300,41.64226700),"
Stanley Clark School
3123 Miami Street
South Bend, IN 46614
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Stanley Clark School",'South_Bend=' + South_Bend.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.11783800,39.91260100),"
The Summit Academy
2720 E. 86th Street
Indianapolis, IN 46240
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Summit Academy",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.19114400,39.87194300),"
Sycamore School
1750 W 64th Street
Indianapolis, IN 46260
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sycamore School",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.04970000,39.83780000),"
Witness For Christ Christian School
5324 E 42th Street
Indianapolis, IN 46226
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Witness For Christ Christian School",'Indianapolis=' + Indianapolis.length); map.removeOverlays(Crawfordsville); map.removeOverlays(Fort_Wayne); map.removeOverlays(Greenwood); map.removeOverlays(Indianapolis); map.removeOverlays(New_Albany); map.removeOverlays(Oldenburg); map.removeOverlays(Plainfield); map.removeOverlays(Scottsburg); map.removeOverlays(Seymour); map.removeOverlays(South_Bend); map.removeOverlays(Terre_Haute); map.removeOverlays(Valparaiso); setTimeout(function(){map.addOverlays(Crawfordsville)},1000); setTimeout(function(){map.addOverlays(Fort_Wayne)},1000); setTimeout(function(){map.addOverlays(Greenwood)},1000); setTimeout(function(){map.addOverlays(Indianapolis)},1000); setTimeout(function(){map.addOverlays(New_Albany)},1000); setTimeout(function(){map.addOverlays(Oldenburg)},1000); setTimeout(function(){map.addOverlays(Plainfield)},1000); setTimeout(function(){map.addOverlays(Scottsburg)},1000); setTimeout(function(){map.addOverlays(Seymour)},1000); setTimeout(function(){map.addOverlays(South_Bend)},1000); setTimeout(function(){map.addOverlays(Terre_Haute)},1000); setTimeout(function(){map.addOverlays(Valparaiso)},1000); maxLng = -85.19021400; maxLat = 41.64226700; minLng = -87.39850000; minLat = 38.32566700; reCenterMap(); } // 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,11); /* 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(Crawfordsville); map.removeOverlays(Fort_Wayne); map.removeOverlays(Greenwood); map.removeOverlays(Indianapolis); map.removeOverlays(New_Albany); map.removeOverlays(Oldenburg); map.removeOverlays(Plainfield); map.removeOverlays(Scottsburg); map.removeOverlays(Seymour); map.removeOverlays(South_Bend); map.removeOverlays(Terre_Haute); 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(New_Albany);map.removeOverlays(Crawfordsville); map.removeOverlays(Fort_Wayne); map.removeOverlays(Greenwood); map.removeOverlays(Indianapolis); map.removeOverlays(New_Albany); map.removeOverlays(Oldenburg); map.removeOverlays(Plainfield); map.removeOverlays(Scottsburg); map.removeOverlays(Seymour); map.removeOverlays(South_Bend); map.removeOverlays(Terre_Haute); map.removeOverlays(Valparaiso); map.addOverlays(Crawfordsville); centerByArray(Crawfordsville, false, false); cntMarker += Crawfordsville.length; map.addOverlays(Fort_Wayne); centerByArray(Fort_Wayne, false, false); cntMarker += Fort_Wayne.length; map.addOverlays(Greenwood); centerByArray(Greenwood, false, false); cntMarker += Greenwood.length; map.addOverlays(Indianapolis); centerByArray(Indianapolis, false, false); cntMarker += Indianapolis.length; map.addOverlays(New_Albany); centerByArray(New_Albany, false, false); cntMarker += New_Albany.length; map.addOverlays(Oldenburg); centerByArray(Oldenburg, false, false); cntMarker += Oldenburg.length; map.addOverlays(Plainfield); centerByArray(Plainfield, false, false); cntMarker += Plainfield.length; map.addOverlays(Scottsburg); centerByArray(Scottsburg, false, false); cntMarker += Scottsburg.length; map.addOverlays(Seymour); centerByArray(Seymour, false, false); cntMarker += Seymour.length; map.addOverlays(South_Bend); centerByArray(South_Bend, false, false); cntMarker += South_Bend.length; map.addOverlays(Terre_Haute); centerByArray(Terre_Haute, false, false); cntMarker += Terre_Haute.length; map.addOverlays(Valparaiso); centerByArray(Valparaiso, false, false); cntMarker += Valparaiso.length; centerByArray(New_Albany,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///10037,35396,10106,33875,10464,10052,10207,10231,10037,35396,10160,10066,10106,10112,31289,33875,10464,10527,10052,10231,10278,10354,10446,10040,10200,/all'); //window.open('/map.php?type=2&schools=10037,35396,10106,33875,10464,10052,10207,10231,10037,35396,10160,10066,10106,10112,31289,33875,10464,10527,10052,10231,10278,10354,10446,10040,10200,&school_level=&radius=&zipcode=&school_type_search=&school_type_code='); } } function createMarker(point, label, icon) { var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }