function addMarkers(){ mySelect = document.getElementById('selection'); Bear = [];Claymont = [];Newark = [];Wilmington = [];Hockessin = [];New_Castle = [];mySelect.options[mySelect.options.length] = new Option("Bear schools",'all=Bear'); mySelect.options[mySelect.options.length] = new Option("Claymont schools",'all=Claymont'); mySelect.options[mySelect.options.length] = new Option("Hockessin schools",'all=Hockessin'); mySelect.options[mySelect.options.length] = new Option("New Castle schools",'all=New_Castle'); mySelect.options[mySelect.options.length] = new Option("Newark schools",'all=Newark'); mySelect.options[mySelect.options.length] = new Option("Wilmington schools",'all=Wilmington'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Bear[Bear.length] = createMarker(new GPoint(-75.67720200,39.56134500),"
Advo Serv
4185 Kirkwood Saint Georges Rd
Bear, DE 19701
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Advo Serv",'Bear=' + Bear.length); Bear[Bear.length] = createMarker(new GPoint(-75.69578100,39.57239400),"
Aquinas Academy Inc.
2370 Red Lion Road
Bear, DE 19701
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aquinas Academy Inc.",'Bear=' + Bear.length); Claymont[Claymont.length] = createMarker(new GPoint(-75.46390000,39.80350000),"
Archmere Academy
Po Box 130 3600 Philadelphia Pi
Claymont, DE 19703
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Archmere Academy",'Claymont=' + Claymont.length); Bear[Bear.length] = createMarker(new GPoint(-75.71767100,39.59807000),"
Caravel Academy
2801 Del Laws Road
Bear, DE 19701
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Caravel Academy",'Bear=' + Bear.length); Newark[Newark.length] = createMarker(new GPoint(-75.73887100,39.67753500),"
The College School
461 Wyoming Road
Newark, DE 19716
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The College School",'Newark=' + Newark.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-75.48698700,39.82316700),"
Concord Christian Academy
2510 Marsh Road
Wilmington, DE 19810
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Concord Christian Academy",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-75.52805200,39.76241000),"
Delaware Education Reclamation Project School
302 W 37th Street
Wilmington, DE 19802
Co-ed school, 4-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Delaware Education Reclamation Project School",'Wilmington=' + Wilmington.length); Newark[Newark.length] = createMarker(new GPoint(-75.70179700,39.69836600),"
Diamond Christian Academy
28 Longview Dr
Newark, DE 19711
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Diamond Christian Academy",'Newark=' + Newark.length); Bear[Bear.length] = createMarker(new GPoint(-75.64510600,39.64331600),"
Fairwinds Christian-school
801 Seymour Rd
Bear, DE 19701
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fairwinds Christian-school",'Bear=' + Bear.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-75.62455200,39.72456200),"
Gospel Chur Of God Deliverance
203 Meadowbrooke Ave
Wilmington, DE 19804
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gospel Chur Of God Deliverance",'Wilmington=' + Wilmington.length); Bear[Bear.length] = createMarker(new GPoint(-75.64617600,39.65196200),"
Highland Mennonite School
180 School Bell Road
Bear, DE 19701
Co-ed school, 1-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Highland Mennonite School",'Bear=' + Bear.length); Hockessin[Hockessin.length] = createMarker(new GPoint(-75.67906700,39.77840000),"
The Hockessin Montessori School
1000 Old Lancaster Pike
Hockessin, DE 19707
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Hockessin Montessori School",'Hockessin=' + Hockessin.length); Newark[Newark.length] = createMarker(new GPoint(-75.76181000,39.67801800),"
Mt Sophia Academy
Po Box 9925
Newark, DE 19714
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mt Sophia Academy",'Newark=' + Newark.length); New_Castle[New_Castle.length] = createMarker(new GPoint(-75.58081300,39.66654300),"
New Castle Christian Academy
901 E Basin Road
New Castle, DE 19720
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Castle Christian Academy",'New_Castle=' + New_Castle.length); Newark[Newark.length] = createMarker(new GPoint(-75.71280000,39.67070000),"
The New School
Po Box 947 812 Elkton Road
Newark, DE 19711
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The New School",'Newark=' + Newark.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-75.56284300,39.75081600),"
Padua Academy High School
905 North Broom Street
Wilmington, DE 19806
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Padua Academy High School",'Wilmington=' + Wilmington.length); Bear[Bear.length] = createMarker(new GPoint(-75.67306000,39.59835700),"
Red Lion Christian Academy
1390 Red Lion Road
Bear, DE 19701
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Red Lion Christian Academy",'Bear=' + Bear.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-75.57290600,39.73809100),"
St. Elizabeth High School
1500 Cedar Street
Wilmington, DE 19805
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Elizabeth High School",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-75.68405300,39.71295100),"
St. Mark's High School
2501 Pike Creek Road
Wilmington, DE 19808
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mark's High School",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-75.55021100,39.75992800),"
Salesianum School
1801 N Broom Street
Wilmington, DE 19802
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Salesianum School",'Wilmington=' + Wilmington.length); Hockessin[Hockessin.length] = createMarker(new GPoint(-75.68974100,39.77811100),"
Sanford School
6900 Lancaster Pike, PO Box 888
Hockessin, DE 19707
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sanford School",'Hockessin=' + Hockessin.length); Newark[Newark.length] = createMarker(new GPoint(-75.65841100,39.67078000),"
Tall Oaks Classical School
181 Stanton - Christiana Road
Newark, DE 19702
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tall Oaks Classical School",'Newark=' + Newark.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-75.61658800,39.77051200),"
The Tatnall School
1501 Barley Mill Road
Wilmington, DE 19807
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Tatnall School",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-75.57683600,39.76454900),"
Tower Hill School
2813 W 17th Street
Wilmington, DE 19806
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tower Hill School",'Wilmington=' + Wilmington.length); Hockessin[Hockessin.length] = createMarker(new GPoint(-75.69589900,39.79102000),"
Towle Institute
Po Box 580
Hockessin, DE 19707
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Towle Institute",'Hockessin=' + Hockessin.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-75.55677600,39.75242800),"
Ursuline Academy (pk-12)
1106 Pennsylvania Avenue
Wilmington, DE 19806
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ursuline Academy (pk-12)",'Wilmington=' + Wilmington.length); Hockessin[Hockessin.length] = createMarker(new GPoint(-75.66487100,39.77696600),"
Wilmington Christian School
825 Loveville Road
Hockessin, DE 19707
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wilmington Christian School",'Hockessin=' + Hockessin.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-75.55056700,39.76768200),"
Wilmington Friends School
101 School Road
Wilmington, DE 19803
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wilmington Friends School",'Wilmington=' + Wilmington.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(Bear); map.removeOverlays(Claymont); map.removeOverlays(Hockessin); map.removeOverlays(New_Castle); map.removeOverlays(Newark); map.removeOverlays(Wilmington); 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(Bear);map.removeOverlays(Bear); map.removeOverlays(Claymont); map.removeOverlays(Hockessin); map.removeOverlays(New_Castle); map.removeOverlays(Newark); map.removeOverlays(Wilmington); map.addOverlays(Bear); centerByArray(Bear, false, false); cntMarker += Bear.length; map.addOverlays(Claymont); centerByArray(Claymont, false, false); cntMarker += Claymont.length; map.addOverlays(Hockessin); centerByArray(Hockessin, false, false); cntMarker += Hockessin.length; map.addOverlays(New_Castle); centerByArray(New_Castle, false, false); cntMarker += New_Castle.length; map.addOverlays(Newark); centerByArray(Newark, false, false); cntMarker += Newark.length; map.addOverlays(Wilmington); centerByArray(Wilmington, false, false); cntMarker += Wilmington.length; centerByArray(Bear,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; }