function addMarkers(){ mySelect = document.getElementById('selection'); Bethel = [];Jonestown = [];Lebanon = [];Myerstown = [];Newmanstown = [];Palmyra = [];mySelect.options[mySelect.options.length] = new Option("Bethel schools",'all=Bethel'); mySelect.options[mySelect.options.length] = new Option("Jonestown schools",'all=Jonestown'); mySelect.options[mySelect.options.length] = new Option("Lebanon schools",'all=Lebanon'); mySelect.options[mySelect.options.length] = new Option("Myerstown schools",'all=Myerstown'); mySelect.options[mySelect.options.length] = new Option("Newmanstown schools",'all=Newmanstown'); mySelect.options[mySelect.options.length] = new Option("Palmyra schools",'all=Palmyra'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Bethel[Bethel.length] = createMarker(new GPoint(-76.28064000,40.46152000),"
Blue Mountain View Paroch School
Salem Rd
Bethel, PA 19507
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blue Mountain View Paroch School",'Bethel=' + Bethel.length); Jonestown[Jonestown.length] = createMarker(new GPoint(-76.50053300,40.41924900),"
Blue Mt Christian School
14 Silvertown Road
Jonestown, PA 17038
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blue Mt Christian School",'Jonestown=' + Jonestown.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-76.35253200,40.29151300),"
Buffalo Springs Parish School
750 Rexmont Road
Lebanon, PA 17042
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Buffalo Springs Parish School",'Lebanon=' + Lebanon.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-76.50815700,40.36379300),"
Cedar Run Mennonite School
2770 Cedar Run Road
Lebanon, PA 17046
Co-ed school, 1-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cedar Run Mennonite School",'Lebanon=' + Lebanon.length); Myerstown[Myerstown.length] = createMarker(new GPoint(-76.31580000,40.38270000),"
Cherry Lane School
Cherry Lane Road
Myerstown, PA 17067
Co-ed school, 1-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cherry Lane School",'Myerstown=' + Myerstown.length); Myerstown[Myerstown.length] = createMarker(new GPoint(-76.31733300,40.41482900),"
County Line School
1317 Hilltop Road
Myerstown, PA 17067
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("County Line School",'Myerstown=' + Myerstown.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-76.49395600,40.28443800),"
Fontana Parochial School
902 Horseshoe Pike
Lebanon, PA 17042
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fontana Parochial School",'Lebanon=' + Lebanon.length); Myerstown[Myerstown.length] = createMarker(new GPoint(-76.31470000,40.38600000),"
Hope Christian School
Rr 2 Box 424a
Myerstown, PA 17067
Co-ed school, 1-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hope Christian School",'Myerstown=' + Myerstown.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-76.40626800,40.27343600),"
Jack And Jill Kindergarten
280 Hillcrest Road
Lebanon, PA 17042
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jack And Jill Kindergarten",'Lebanon=' + Lebanon.length); Myerstown[Myerstown.length] = createMarker(new GPoint(-76.27535700,40.32844100),"
Jacksonville Parochial School
231 Reistville Road
Myerstown, PA 17067
Co-ed school, 1-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jacksonville Parochial School",'Myerstown=' + Myerstown.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-76.42610100,40.32452000),"
Kindercare Learning Center
989 Quentin Road
Lebanon, PA 17042
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kindercare Learning Center",'Lebanon=' + Lebanon.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-76.43500500,40.33716700),"
Lebanon Catholic School
1400 Chestnut Street
Lebanon, PA 17042
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lebanon Catholic School",'Lebanon=' + Lebanon.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-76.40289700,40.36425000),"
Lebanon Christian Academy
875 Academy Drive
Lebanon, PA 17046
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lebanon Christian Academy",'Lebanon=' + Lebanon.length); Myerstown[Myerstown.length] = createMarker(new GPoint(-76.32203900,40.39898500),"
Little Kutztown Christian School
530 Kutztown Road
Myerstown, PA 17067
Co-ed school, 1-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Kutztown Christian School",'Myerstown=' + Myerstown.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-76.35463000,40.35271600),"
Meadow Ridge School
2201 S 5th Avenue
Lebanon, PA 17042
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Meadow Ridge School",'Lebanon=' + Lebanon.length); Newmanstown[Newmanstown.length] = createMarker(new GPoint(-76.25050000,40.31180000),"
Milcreek Parochial School
Rd 1
Newmanstown, PA 17073
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Milcreek Parochial School",'Newmanstown=' + Newmanstown.length); Newmanstown[Newmanstown.length] = createMarker(new GPoint(-76.24107600,40.33278500),"
Millbach Mennonite School
601 St Rt 419
Newmanstown, PA 17073
Co-ed school, 1-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Millbach Mennonite School",'Newmanstown=' + Newmanstown.length); Myerstown[Myerstown.length] = createMarker(new GPoint(-76.25603800,40.32613000),"
Millbach Springs School
750 State Route 419
Myerstown, PA 17067
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Millbach Springs School",'Myerstown=' + Myerstown.length); Myerstown[Myerstown.length] = createMarker(new GPoint(-76.27856800,40.38453800),"
Myerstown Mennonite School
739 East Lincoln Avenue
Myerstown, PA 17067
Co-ed school, 1-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Myerstown Mennonite School",'Myerstown=' + Myerstown.length); Myerstown[Myerstown.length] = createMarker(new GPoint(-76.35354000,40.38866000),"
Nacetown Mennonite School
703 W Strack Drive
Myerstown, PA 17067
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nacetown Mennonite School",'Myerstown=' + Myerstown.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-76.46084300,40.35997400),"
New Covenant Christian School
452 Ebenezer Road
Lebanon, PA 17046
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Covenant Christian School",'Lebanon=' + Lebanon.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-76.39247400,40.44661400),"
Pleasant Hill School
544 Union Road
Lebanon, PA 17046
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pleasant Hill School",'Lebanon=' + Lebanon.length); Myerstown[Myerstown.length] = createMarker(new GPoint(-76.27409200,40.32768000),"
Reistville School
Reistville Road
Myerstown, PA 17067
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Reistville School",'Myerstown=' + Myerstown.length); Myerstown[Myerstown.length] = createMarker(new GPoint(-76.31470000,40.38600000),"
Rocky Ledge School
200 Hergelrode Drive
Myerstown, PA 17067
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rocky Ledge School",'Myerstown=' + Myerstown.length); Myerstown[Myerstown.length] = createMarker(new GPoint(-76.28236900,40.37951600),"
Stony Ridge Parochial School
800 E Main Avenue
Myerstown, PA 17067
Co-ed school, 1-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Stony Ridge Parochial School",'Myerstown=' + Myerstown.length); Newmanstown[Newmanstown.length] = createMarker(new GPoint(-76.24109300,40.31787000),"
Sun Valley Parochial School
241 S Millbach Road
Newmanstown, PA 17073
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sun Valley Parochial School",'Newmanstown=' + Newmanstown.length); Palmyra[Palmyra.length] = createMarker(new GPoint(-76.58820000,40.29770000),"
U Gro Child Care Center
Po Box 190
Palmyra, PA 17078
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("U Gro Child Care Center",'Palmyra=' + Palmyra.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/////1/' + showArray); map.removeOverlays(Bethel); map.removeOverlays(Jonestown); map.removeOverlays(Lebanon); map.removeOverlays(Myerstown); map.removeOverlays(Newmanstown); map.removeOverlays(Palmyra); 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(Bethel);map.removeOverlays(Bethel); map.removeOverlays(Jonestown); map.removeOverlays(Lebanon); map.removeOverlays(Myerstown); map.removeOverlays(Newmanstown); map.removeOverlays(Palmyra); map.addOverlays(Bethel); centerByArray(Bethel, false, false); cntMarker += Bethel.length; map.addOverlays(Jonestown); centerByArray(Jonestown, false, false); cntMarker += Jonestown.length; map.addOverlays(Lebanon); centerByArray(Lebanon, false, false); cntMarker += Lebanon.length; map.addOverlays(Myerstown); centerByArray(Myerstown, false, false); cntMarker += Myerstown.length; map.addOverlays(Newmanstown); centerByArray(Newmanstown, false, false); cntMarker += Newmanstown.length; map.addOverlays(Palmyra); centerByArray(Palmyra, false, false); cntMarker += Palmyra.length; centerByArray(Bethel,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=1&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; }