function addMarkers(){ mySelect = document.getElementById('selection'); Willingboro = [];Marlton = [];Burlington = [];Mount_Holly = [];Mount_Laurel = [];Delran = [];Moorestown = [];Florence_Township = [];Chesterfield = [];Lumberton = [];Wrightstown = [];mySelect.options[mySelect.options.length] = new Option("Burlington schools",'all=Burlington'); mySelect.options[mySelect.options.length] = new Option("Chesterfield schools",'all=Chesterfield'); mySelect.options[mySelect.options.length] = new Option("Delran schools",'all=Delran'); mySelect.options[mySelect.options.length] = new Option("Florence Township schools",'all=Florence_Township'); mySelect.options[mySelect.options.length] = new Option("Lumberton schools",'all=Lumberton'); mySelect.options[mySelect.options.length] = new Option("Marlton schools",'all=Marlton'); mySelect.options[mySelect.options.length] = new Option("Moorestown schools",'all=Moorestown'); mySelect.options[mySelect.options.length] = new Option("Mount Holly schools",'all=Mount_Holly'); mySelect.options[mySelect.options.length] = new Option("Mount Laurel schools",'all=Mount_Laurel'); mySelect.options[mySelect.options.length] = new Option("Willingboro schools",'all=Willingboro'); mySelect.options[mySelect.options.length] = new Option("Wrightstown schools",'all=Wrightstown'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Willingboro[Willingboro.length] = createMarker(new GPoint(-74.87716000,40.01363800),"
Calvary Christian School
594 Beverly Rancocas Road
Willingboro, NJ 08046
Co-ed school, 4-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Christian School",'Willingboro=' + Willingboro.length); Marlton[Marlton.length] = createMarker(new GPoint(-74.90310000,39.87730000),"
Center For Education/greenberg Educational Center
55 E Route 70
Marlton, NJ 08053
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Center For Education/greenberg Educational Center",'Marlton=' + Marlton.length); Burlington[Burlington.length] = createMarker(new GPoint(-74.86771800,40.07985400),"
Doane Academy
350 Riverbank
Burlington, NJ 08016
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Doane Academy",'Burlington=' + Burlington.length); Willingboro[Willingboro.length] = createMarker(new GPoint(-74.88420000,40.02920000),"
Garfield Park Academy
Po Box 189
Willingboro, NJ 08046
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Garfield Park Academy",'Willingboro=' + Willingboro.length); Mount_Holly[Mount_Holly.length] = createMarker(new GPoint(-74.79501200,39.98811500),"
Githens Center (burlington Cou
40 Cedar Street
Mount Holly, NJ 08060
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Githens Center (burlington Cou",'Mount_Holly=' + Mount_Holly.length); Mount_Holly[Mount_Holly.length] = createMarker(new GPoint(-74.79506800,39.98816100),"
Githens Center Burlington Coun
40 Cedar Street
Mount Holly, NJ 08060
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Githens Center Burlington Coun",'Mount_Holly=' + Mount_Holly.length); Mount_Holly[Mount_Holly.length] = createMarker(new GPoint(-74.80618600,40.01990800),"
Hampton Academy
108 Burrs Road
Mount Holly, NJ 08060
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hampton Academy",'Mount_Holly=' + Mount_Holly.length); Mount_Laurel[Mount_Laurel.length] = createMarker(new GPoint(-74.90440000,39.94830000),"
Heritage Christian Academy
Po Box 326 530 Union Mill Road
Mount Laurel, NJ 08054
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian Academy",'Mount_Laurel=' + Mount_Laurel.length); Delran[Delran.length] = createMarker(new GPoint(-74.95335800,40.01651400),"
Holy Cross High School
5035 Route 130
Delran, NJ 08075
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Cross High School",'Delran=' + Delran.length); Moorestown[Moorestown.length] = createMarker(new GPoint(-74.95107400,39.95219200),"
Kingsway Learning Center-secondary Program
244 W Route 38
Moorestown, NJ 08057
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kingsway Learning Center-secondary Program",'Moorestown=' + Moorestown.length); Florence_Township[Florence_Township.length] = createMarker(new GPoint(-74.79182500,40.08018200),"
Life Center Academy
2045 Columbus Rd
Florence Township, NJ 08518
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Life Center Academy",'Florence_Township=' + Florence_Township.length); Marlton[Marlton.length] = createMarker(new GPoint(-74.88594700,39.88513300),"
Marlton Christian Academy
625 E Main Street
Marlton, NJ 08053
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marlton Christian Academy",'Marlton=' + Marlton.length); Mount_Holly[Mount_Holly.length] = createMarker(new GPoint(-74.78356900,39.98505700),"
Mary A Dobbins School
243 Pine Street
Mount Holly, NJ 08060
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mary A Dobbins School",'Mount_Holly=' + Mount_Holly.length); Chesterfield[Chesterfield.length] = createMarker(new GPoint(-74.65203900,40.12480300),"
Meadow View Junior Academy
241 Bordentown Chesterfield Rd
Chesterfield, NJ 08515
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Meadow View Junior Academy",'Chesterfield=' + Chesterfield.length); Lumberton[Lumberton.length] = createMarker(new GPoint(-74.79800000,39.96880000),"
Midway School
P.o. Box 587
Lumberton, NJ 08048
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Midway School",'Lumberton=' + Lumberton.length); Moorestown[Moorestown.length] = createMarker(new GPoint(-74.92894700,40.00059400),"
Moorestown Children S School
760 Garwood Road
Moorestown, NJ 08057
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Moorestown Children S School",'Moorestown=' + Moorestown.length); Moorestown[Moorestown.length] = createMarker(new GPoint(-74.94236000,39.96536200),"
Moorestown Friends School
110 East Main Street
Moorestown, NJ 08057
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Moorestown Friends School",'Moorestown=' + Moorestown.length); Wrightstown[Wrightstown.length] = createMarker(new GPoint(-74.57100800,40.10216400),"
The Patriots Academy
Po Box 206 128 Georgetown Wrightstown Road
Wrightstown, NJ 08562
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Patriots Academy",'Wrightstown=' + Wrightstown.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/////2/' + showArray); map.removeOverlays(Burlington); map.removeOverlays(Chesterfield); map.removeOverlays(Delran); map.removeOverlays(Florence_Township); map.removeOverlays(Lumberton); map.removeOverlays(Marlton); map.removeOverlays(Moorestown); map.removeOverlays(Mount_Holly); map.removeOverlays(Mount_Laurel); map.removeOverlays(Willingboro); map.removeOverlays(Wrightstown); 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(Willingboro);map.removeOverlays(Burlington); map.removeOverlays(Chesterfield); map.removeOverlays(Delran); map.removeOverlays(Florence_Township); map.removeOverlays(Lumberton); map.removeOverlays(Marlton); map.removeOverlays(Moorestown); map.removeOverlays(Mount_Holly); map.removeOverlays(Mount_Laurel); map.removeOverlays(Willingboro); map.removeOverlays(Wrightstown); map.addOverlays(Burlington); centerByArray(Burlington, false, false); cntMarker += Burlington.length; map.addOverlays(Chesterfield); centerByArray(Chesterfield, false, false); cntMarker += Chesterfield.length; map.addOverlays(Delran); centerByArray(Delran, false, false); cntMarker += Delran.length; map.addOverlays(Florence_Township); centerByArray(Florence_Township, false, false); cntMarker += Florence_Township.length; map.addOverlays(Lumberton); centerByArray(Lumberton, false, false); cntMarker += Lumberton.length; map.addOverlays(Marlton); centerByArray(Marlton, false, false); cntMarker += Marlton.length; map.addOverlays(Moorestown); centerByArray(Moorestown, false, false); cntMarker += Moorestown.length; map.addOverlays(Mount_Holly); centerByArray(Mount_Holly, false, false); cntMarker += Mount_Holly.length; map.addOverlays(Mount_Laurel); centerByArray(Mount_Laurel, false, false); cntMarker += Mount_Laurel.length; map.addOverlays(Willingboro); centerByArray(Willingboro, false, false); cntMarker += Willingboro.length; map.addOverlays(Wrightstown); centerByArray(Wrightstown, false, false); cntMarker += Wrightstown.length; centerByArray(Willingboro,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=2&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; }