function addMarkers(){ mySelect = document.getElementById('selection'); Severn = [];Annapolis = [];Arnold = [];Brooklyn_Park = [];Glen_Burnie = [];Lothian = [];Crownsville = [];Millersville = [];Severna_Park = [];Harwood = [];Pasadena = [];Odenton = [];mySelect.options[mySelect.options.length] = new Option("Annapolis schools",'all=Annapolis'); mySelect.options[mySelect.options.length] = new Option("Arnold schools",'all=Arnold'); mySelect.options[mySelect.options.length] = new Option("Brooklyn Park schools",'all=Brooklyn_Park'); mySelect.options[mySelect.options.length] = new Option("Crownsville schools",'all=Crownsville'); mySelect.options[mySelect.options.length] = new Option("Glen Burnie schools",'all=Glen_Burnie'); mySelect.options[mySelect.options.length] = new Option("Harwood schools",'all=Harwood'); mySelect.options[mySelect.options.length] = new Option("Lothian schools",'all=Lothian'); mySelect.options[mySelect.options.length] = new Option("Millersville schools",'all=Millersville'); mySelect.options[mySelect.options.length] = new Option("Odenton schools",'all=Odenton'); mySelect.options[mySelect.options.length] = new Option("Pasadena schools",'all=Pasadena'); mySelect.options[mySelect.options.length] = new Option("Severn schools",'all=Severn'); mySelect.options[mySelect.options.length] = new Option("Severna Park schools",'all=Severna_Park'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Severn[Severn.length] = createMarker(new GPoint(-76.68486400,39.10550900),"
Annapolis Area Christian School
109 Burns Crossing Road
Severn, MD 21144
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Annapolis Area Christian School",'Severn=' + Severn.length); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.52983300,38.99585600),"
Annapolis Area Christian School
716 Bestgate Road
Annapolis, MD 21401
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Annapolis Area Christian School",'Annapolis=' + Annapolis.length); Arnold[Arnold.length] = createMarker(new GPoint(-76.49999700,39.02468400),"
Antioch Christian School
Po Box 897
Arnold, MD 21012
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Antioch Christian School",'Arnold=' + Arnold.length); Severn[Severn.length] = createMarker(new GPoint(-76.64465600,39.12248000),"
Archbishop Spalding High School
8080 New Cut Road
Severn, MD 21144
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Archbishop Spalding High School",'Severn=' + Severn.length); Brooklyn_Park[Brooklyn_Park.length] = createMarker(new GPoint(-76.59829100,39.22127400),"
Brooklyn Park Christian Academy
900 Church Street
Brooklyn Park, MD 21225
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brooklyn Park Christian Academy",'Brooklyn_Park=' + Brooklyn_Park.length); Glen_Burnie[Glen_Burnie.length] = createMarker(new GPoint(-76.59986200,39.14353400),"
Calvary Baptist Church Academy
407 Marley Station Road
Glen Burnie, MD 21060
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Baptist Church Academy",'Glen_Burnie=' + Glen_Burnie.length); Severn[Severn.length] = createMarker(new GPoint(-76.64446700,39.12282000),"
Calvary Chapel Christian Academy
8064 New Cut Road
Severn, MD 21144
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Chapel Christian Academy",'Severn=' + Severn.length); Lothian[Lothian.length] = createMarker(new GPoint(-76.61796600,38.78179200),"
Chesapeake Christian School
250 W Bay Front Road
Lothian, MD 20711
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chesapeake Christian School",'Lothian=' + Lothian.length); Crownsville[Crownsville.length] = createMarker(new GPoint(-76.57027600,39.05041900),"
Christian Community Fellowship
830 Birch Trail
Crownsville, MD 21032
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Community Fellowship",'Crownsville=' + Crownsville.length); Millersville[Millersville.length] = createMarker(new GPoint(-76.63071200,39.11761200),"
Church on the Rock Christian Academy
649 Old Mill Rd
Millersville, MD 21108
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Church on the Rock Christian Academy",'Millersville=' + Millersville.length); Crownsville[Crownsville.length] = createMarker(new GPoint(-76.60446800,39.02091200),"
Focus Point School
1211 Farm Road
Crownsville, MD 21032
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Focus Point School",'Crownsville=' + Crownsville.length); Glen_Burnie[Glen_Burnie.length] = createMarker(new GPoint(-76.59122000,39.16469600),"
Glen Burnie Nazarene Christian
100 Northdale Rd
Glen Burnie, MD 21060
Co-ed school, 1-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Glen Burnie Nazarene Christian",'Glen_Burnie=' + Glen_Burnie.length); Severna_Park[Severna_Park.length] = createMarker(new GPoint(-76.55716100,39.07658300),"
Hannah More At Severna Park High School
60 Robinson Road B9
Severna Park, MD 21146
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hannah More At Severna Park High School",'Severna_Park=' + Severna_Park.length); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.45656800,39.03739300),"
Harbour School & Innovative Learning Center
1277 Green Holly Drive
Annapolis, MD 21409
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harbour School & Innovative Learning Center",'Annapolis=' + Annapolis.length); Crownsville[Crownsville.length] = createMarker(new GPoint(-76.60382900,39.06847200),"
Indian Creek School
680 Evergreen Road
Crownsville, MD 21032
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Indian Creek School",'Crownsville=' + Crownsville.length); Harwood[Harwood.length] = createMarker(new GPoint(-76.61678400,38.86873700),"
Kennedy Krieger At Southern High School
4400 Solomons Island Road Room G-104
Harwood, MD 20776
Co-ed school, 9-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kennedy Krieger At Southern High School",'Harwood=' + Harwood.length); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.49406500,38.93144300),"
Key School
534 Hillsmere Drive
Annapolis, MD 21403
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Key School",'Annapolis=' + Annapolis.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-76.50413300,39.10257600),"
Lake Shore Christian Academy
860 Swift Road
Pasadena, MD 21122
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lake Shore Christian Academy",'Pasadena=' + Pasadena.length); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.49948600,38.99257900),"
Learning Community International, The
110 Shiley Street
Annapolis, MD 21401
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Learning Community International, The",'Annapolis=' + Annapolis.length); Crownsville[Crownsville.length] = createMarker(new GPoint(-76.60459900,39.02090900),"
Meadow Brook Education Center
1211 Farm Rd.
Crownsville, MD 21032
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Meadow Brook Education Center",'Crownsville=' + Crownsville.length); Odenton[Odenton.length] = createMarker(new GPoint(-76.70070400,39.08347400),"
Odenton Christian School
8410 Piney Orchard Parkway
Odenton, MD 21113
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Odenton Christian School",'Odenton=' + Odenton.length); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.52276700,38.97603300),"
Rapture Learning Institute For
1834 George Ave
Annapolis, MD 21401
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rapture Learning Institute For",'Annapolis=' + Annapolis.length); Crownsville[Crownsville.length] = createMarker(new GPoint(-76.60278100,39.01646900),"
Ridge School Of Anne Arundel County, The
16 Romig Drive
Crownsville, MD 21032
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ridge School Of Anne Arundel County, The",'Crownsville=' + Crownsville.length); Millersville[Millersville.length] = createMarker(new GPoint(-76.62790700,39.05994000),"
Rockbridge Academy
911 Generals Highway
Millersville, MD 21108
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rockbridge Academy",'Millersville=' + Millersville.length); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.48404700,38.93956700),"
St. Anne's School of Annapolis
3112 Arundel On The Bay Road
Annapolis, MD 21403
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Anne's School of Annapolis",'Annapolis=' + Annapolis.length); Severna_Park[Severna_Park.length] = createMarker(new GPoint(-76.56928400,39.07759900),"
St. Martins-in-the-Field Day School
375 A Benfield Road
Severna Park, MD 21146
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Martins-in-the-Field Day School",'Severna_Park=' + Severna_Park.length); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.48805400,38.97530300),"
St. Marys High School
113 Duke Of Gloucester St
Annapolis, MD 21401
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Marys High School",'Annapolis=' + Annapolis.length); Severna_Park[Severna_Park.length] = createMarker(new GPoint(-76.54669900,39.06874100),"
Severn School
201 Water Street
Severna Park, MD 21146
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Severn School",'Severna_Park=' + Severna_Park.length); Severna_Park[Severna_Park.length] = createMarker(new GPoint(-76.55790000,39.08070000),"
Severna Park Christian School
Po Box 826
Severna Park, MD 21146
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Severna Park Christian School",'Severna_Park=' + Severna_Park.length); Glen_Burnie[Glen_Burnie.length] = createMarker(new GPoint(-76.63194300,39.14814400),"
Tree Of Life Christian Academy
1406b Crain Highway S Suite 102
Glen Burnie, MD 21061
school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tree Of Life Christian Academy",'Glen_Burnie=' + Glen_Burnie.length); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.49079200,38.96160200),"
Van Buren Street Baptist School
911 Van Buren Street
Annapolis, MD 21403
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Van Buren Street Baptist School",'Annapolis=' + Annapolis.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(Annapolis); map.removeOverlays(Arnold); map.removeOverlays(Brooklyn_Park); map.removeOverlays(Crownsville); map.removeOverlays(Glen_Burnie); map.removeOverlays(Harwood); map.removeOverlays(Lothian); map.removeOverlays(Millersville); map.removeOverlays(Odenton); map.removeOverlays(Pasadena); map.removeOverlays(Severn); map.removeOverlays(Severna_Park); 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(Severn);map.removeOverlays(Annapolis); map.removeOverlays(Arnold); map.removeOverlays(Brooklyn_Park); map.removeOverlays(Crownsville); map.removeOverlays(Glen_Burnie); map.removeOverlays(Harwood); map.removeOverlays(Lothian); map.removeOverlays(Millersville); map.removeOverlays(Odenton); map.removeOverlays(Pasadena); map.removeOverlays(Severn); map.removeOverlays(Severna_Park); map.addOverlays(Annapolis); centerByArray(Annapolis, false, false); cntMarker += Annapolis.length; map.addOverlays(Arnold); centerByArray(Arnold, false, false); cntMarker += Arnold.length; map.addOverlays(Brooklyn_Park); centerByArray(Brooklyn_Park, false, false); cntMarker += Brooklyn_Park.length; map.addOverlays(Crownsville); centerByArray(Crownsville, false, false); cntMarker += Crownsville.length; map.addOverlays(Glen_Burnie); centerByArray(Glen_Burnie, false, false); cntMarker += Glen_Burnie.length; map.addOverlays(Harwood); centerByArray(Harwood, false, false); cntMarker += Harwood.length; map.addOverlays(Lothian); centerByArray(Lothian, false, false); cntMarker += Lothian.length; map.addOverlays(Millersville); centerByArray(Millersville, false, false); cntMarker += Millersville.length; map.addOverlays(Odenton); centerByArray(Odenton, false, false); cntMarker += Odenton.length; map.addOverlays(Pasadena); centerByArray(Pasadena, false, false); cntMarker += Pasadena.length; map.addOverlays(Severn); centerByArray(Severn, false, false); cntMarker += Severn.length; map.addOverlays(Severna_Park); centerByArray(Severna_Park, false, false); cntMarker += Severna_Park.length; centerByArray(Severn,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; }