function addMarkers(){ mySelect = document.getElementById('selection'); University_Park = [];Woodward = [];Aaronsburg = [];Bellefonte = [];State_College = [];Madisonburg = [];Philipsburg = [];Howard = [];Rebersburg = [];Lemont = [];Spring_Mills = [];mySelect.options[mySelect.options.length] = new Option("Aaronsburg schools",'all=Aaronsburg'); mySelect.options[mySelect.options.length] = new Option("Bellefonte schools",'all=Bellefonte'); mySelect.options[mySelect.options.length] = new Option("Howard schools",'all=Howard'); mySelect.options[mySelect.options.length] = new Option("Lemont schools",'all=Lemont'); mySelect.options[mySelect.options.length] = new Option("Madisonburg schools",'all=Madisonburg'); mySelect.options[mySelect.options.length] = new Option("Philipsburg schools",'all=Philipsburg'); mySelect.options[mySelect.options.length] = new Option("Rebersburg schools",'all=Rebersburg'); mySelect.options[mySelect.options.length] = new Option("Spring Mills schools",'all=Spring_Mills'); mySelect.options[mySelect.options.length] = new Option("State College schools",'all=State_College'); mySelect.options[mySelect.options.length] = new Option("University Park schools",'all=University_Park'); mySelect.options[mySelect.options.length] = new Option("Woodward schools",'all=Woodward'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); University_Park[University_Park.length] = createMarker(new GPoint(-77.86019800,40.80534300),"
Bennett Family Center
123 Bennett Family Center
University Park, PA 16802
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bennett Family Center",'University_Park=' + University_Park.length); University_Park[University_Park.length] = createMarker(new GPoint(-77.86019800,40.80534300),"
Bennett Family Child Care Center
123 Bennett Family Childcare Center - Penn State
University Park, PA 16802
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bennett Family Child Care Center",'University_Park=' + University_Park.length); Woodward[Woodward.length] = createMarker(new GPoint(-77.39330000,40.89110000),"
Bower Hollow Parochial School
Bower Hollow Road
Woodward, PA 16882
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bower Hollow Parochial School",'Woodward=' + Woodward.length); Aaronsburg[Aaronsburg.length] = createMarker(new GPoint(-77.42390000,40.90510000),"
Bower Hollow School
Hc 1 Box 33
Aaronsburg, PA 16820
school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bower Hollow School",'Aaronsburg=' + Aaronsburg.length); Bellefonte[Bellefonte.length] = createMarker(new GPoint(-77.76882000,40.90751500),"
Centre County Christian Academy
100 Hertzler Drive
Bellefonte, PA 16823
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Centre County Christian Academy",'Bellefonte=' + Bellefonte.length); State_College[State_College.length] = createMarker(new GPoint(-77.86683600,40.78836200),"
Children's House Montessori School
632 W Beaver Ave
State College, PA 16801
Co-ed school, NS-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Children's House Montessori School",'State_College=' + State_College.length); Madisonburg[Madisonburg.length] = createMarker(new GPoint(-77.50921200,40.93244600),"
Elk Creek School
142 Elk Creek Road
Madisonburg, PA 16852
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elk Creek School",'Madisonburg=' + Madisonburg.length); Philipsburg[Philipsburg.length] = createMarker(new GPoint(-78.17518200,40.90117500),"
Faith Christian Academy
2608 Black Moshannon Road
Philipsburg, PA 16866
Co-ed school, 4-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Christian Academy",'Philipsburg=' + Philipsburg.length); State_College[State_College.length] = createMarker(new GPoint(-77.85550800,40.79673800),"
Grace Lutheran Dayschool
205 S Garner Street
State College, PA 16801
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Lutheran Dayschool",'State_College=' + State_College.length); State_College[State_College.length] = createMarker(new GPoint(-77.84587400,40.79133700),"
Grace Prep
1117 Williams Street
State College, PA 16801
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Prep",'State_College=' + State_College.length); Howard[Howard.length] = createMarker(new GPoint(-77.58182800,40.98577300),"
Hubler Ridge School
844 Snydertown Road
Howard, PA 16841
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hubler Ridge School",'Howard=' + Howard.length); State_College[State_College.length] = createMarker(new GPoint(-77.88151300,40.76529000),"
Learning Station
3035 Enterprise Drive
State College, PA 16801
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Learning Station",'State_College=' + State_College.length); Howard[Howard.length] = createMarker(new GPoint(-77.59337700,41.01341900),"
Little Nittany School
5445 Jacksonville Road
Howard, PA 16841
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Nittany School",'Howard=' + Howard.length); State_College[State_College.length] = createMarker(new GPoint(-77.90448800,40.79096300),"
Magic Years
228 Farmstead Lane
State College, PA 16803
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Magic Years",'State_College=' + State_College.length); State_College[State_College.length] = createMarker(new GPoint(-77.81716600,40.81790300),"
Montessori School Of The Ni
138 Lime Rock Ter
State College, PA 16801
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori School Of The Ni",'State_College=' + State_College.length); Rebersburg[Rebersburg.length] = createMarker(new GPoint(-121.84250000,47.53120000),"
Mountain View School
168 Beeler Drive
Rebersburg, PA 16872
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mountain View School",'Rebersburg=' + Rebersburg.length); Lemont[Lemont.length] = createMarker(new GPoint(-77.81860000,40.81050000),"
Mt Nittany Preschool
Po Box 1103
Lemont, PA 16851
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mt Nittany Preschool",'Lemont=' + Lemont.length); State_College[State_College.length] = createMarker(new GPoint(-77.86427900,40.76783200),"
Nittany Christian School
1221 W Whitehall Road
State College, PA 16801
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nittany Christian School",'State_College=' + State_College.length); State_College[State_College.length] = createMarker(new GPoint(-77.85952900,40.78938700),"
Our Children's Center
411 South Burrowes Street
State College, PA 16801
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Children's Center",'State_College=' + State_College.length); State_College[State_College.length] = createMarker(new GPoint(-77.86481500,40.78175600),"
Our Lady Of Victory Catholic School
800 Westerly Parkway
State College, PA 16801
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Victory Catholic School",'State_College=' + State_College.length); State_College[State_College.length] = createMarker(new GPoint(-77.90421900,40.80731000),"
Park Forest Montessori School
1833 Park Forest Avenue
State College, PA 16803
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Park Forest Montessori School",'State_College=' + State_College.length); Aaronsburg[Aaronsburg.length] = createMarker(new GPoint(-77.39852700,40.89987900),"
Penns Valley Amish Paroch School
205 Amish School Drive
Aaronsburg, PA 16820
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Penns Valley Amish Paroch School",'Aaronsburg=' + Aaronsburg.length); Aaronsburg[Aaronsburg.length] = createMarker(new GPoint(-77.41960000,40.89350000),"
Penns Valley Amish Parochial School
205 Amish School Drive
Aaronsburg, PA 16820
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Penns Valley Amish Parochial School",'Aaronsburg=' + Aaronsburg.length); State_College[State_College.length] = createMarker(new GPoint(-77.84958300,40.78935400),"
Red Satchel
1015 S Pugh Street
State College, PA 16801
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Red Satchel",'State_College=' + State_College.length); Rebersburg[Rebersburg.length] = createMarker(new GPoint(-77.47784800,40.92630800),"
Rockville School C/o Verna Beiler
155 Smullton Road
Rebersburg, PA 16872
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rockville School C/o Verna Beiler",'Rebersburg=' + Rebersburg.length); Bellefonte[Bellefonte.length] = createMarker(new GPoint(-77.77698900,40.91074200),"
St John The Evangelist Catholic School
116 E Bishop Street
Bellefonte, PA 16823
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John The Evangelist Catholic School",'Bellefonte=' + Bellefonte.length); State_College[State_College.length] = createMarker(new GPoint(-77.84868000,40.79145700),"
State College Children's House
632 W Beavenuer Avenue
State College, PA 16801
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("State College Children's House",'State_College=' + State_College.length); State_College[State_College.length] = createMarker(new GPoint(-77.84133000,40.77881200),"
State College Friends School
1900 University Drive
State College, PA 16801
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("State College Friends School",'State_College=' + State_College.length); Bellefonte[Bellefonte.length] = createMarker(new GPoint(-75.74120000,40.51202000),"
Sunny Meadow Parochial School
2595 Jacksonville Road
Bellefonte, PA 16823
Co-ed school, 1-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sunny Meadow Parochial School",'Bellefonte=' + Bellefonte.length); Bellefonte[Bellefonte.length] = createMarker(new GPoint(-77.64297500,40.98485200),"
Sunset View School
3770 Jacksonville Road
Bellefonte, PA 16823
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sunset View School",'Bellefonte=' + Bellefonte.length); Spring_Mills[Spring_Mills.length] = createMarker(new GPoint(-77.49435800,40.87297400),"
Woodside Amish School C/o Daniel King
204 Big Oak Lane
Spring Mills, PA 16875
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodside Amish School C/o Daniel King",'Spring_Mills=' + Spring_Mills.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,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/////3/' + showArray); map.removeOverlays(Aaronsburg); map.removeOverlays(Bellefonte); map.removeOverlays(Howard); map.removeOverlays(Lemont); map.removeOverlays(Madisonburg); map.removeOverlays(Philipsburg); map.removeOverlays(Rebersburg); map.removeOverlays(Spring_Mills); map.removeOverlays(State_College); map.removeOverlays(University_Park); map.removeOverlays(Woodward); 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(University_Park);map.removeOverlays(Aaronsburg); map.removeOverlays(Bellefonte); map.removeOverlays(Howard); map.removeOverlays(Lemont); map.removeOverlays(Madisonburg); map.removeOverlays(Philipsburg); map.removeOverlays(Rebersburg); map.removeOverlays(Spring_Mills); map.removeOverlays(State_College); map.removeOverlays(University_Park); map.removeOverlays(Woodward); map.addOverlays(Aaronsburg); centerByArray(Aaronsburg, false, false); cntMarker += Aaronsburg.length; map.addOverlays(Bellefonte); centerByArray(Bellefonte, false, false); cntMarker += Bellefonte.length; map.addOverlays(Howard); centerByArray(Howard, false, false); cntMarker += Howard.length; map.addOverlays(Lemont); centerByArray(Lemont, false, false); cntMarker += Lemont.length; map.addOverlays(Madisonburg); centerByArray(Madisonburg, false, false); cntMarker += Madisonburg.length; map.addOverlays(Philipsburg); centerByArray(Philipsburg, false, false); cntMarker += Philipsburg.length; map.addOverlays(Rebersburg); centerByArray(Rebersburg, false, false); cntMarker += Rebersburg.length; map.addOverlays(Spring_Mills); centerByArray(Spring_Mills, false, false); cntMarker += Spring_Mills.length; map.addOverlays(State_College); centerByArray(State_College, false, false); cntMarker += State_College.length; map.addOverlays(University_Park); centerByArray(University_Park, false, false); cntMarker += University_Park.length; map.addOverlays(Woodward); centerByArray(Woodward, false, false); cntMarker += Woodward.length; centerByArray(University_Park,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'); //window.open('/map.php?type=1&schools=&school_level=3&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; }