function addMarkers(){ mySelect = document.getElementById('selection'); Annapolis = [];Arnold = [];Accokeek = [];Avenue = [];Ashton = [];Abingdon = [];Adelphi = [];Arbutus = [];Aberdeen = [];mySelect.options[mySelect.options.length] = new Option("Aberdeen schools",'all=Aberdeen'); mySelect.options[mySelect.options.length] = new Option("Abingdon schools",'all=Abingdon'); mySelect.options[mySelect.options.length] = new Option("Accokeek schools",'all=Accokeek'); mySelect.options[mySelect.options.length] = new Option("Adelphi schools",'all=Adelphi'); mySelect.options[mySelect.options.length] = new Option("Annapolis schools",'all=Annapolis'); mySelect.options[mySelect.options.length] = new Option("Arbutus schools",'all=Arbutus'); mySelect.options[mySelect.options.length] = new Option("Arnold schools",'all=Arnold'); mySelect.options[mySelect.options.length] = new Option("Ashton schools",'all=Ashton'); mySelect.options[mySelect.options.length] = new Option("Avenue schools",'all=Avenue'); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.51267600,38.96612200),"
Aleph-bet Jewish Day School
1125 Spa Road
Annapolis, MD 21403
Co-ed school, K-5
[ View School Profile ]
",iconGr); 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); 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); Arnold[Arnold.length] = createMarker(new GPoint(-76.50097700,39.05063900),"
Arnold Christian Academy
365 Jones Station Road
Arnold, MD 21012
Co-ed school, K-8
[ View School Profile ]
",iconGr); Arnold[Arnold.length] = createMarker(new GPoint(-76.49811800,39.03433700),"
Asbury Community Christian Preschool
78 Church Road
Arnold, MD 21012
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.54614700,38.97016000),"
Bay Cty Childrens Learning Cnt
190 Admiral Cochrane Dr Ste 190
Annapolis, MD 21401
Co-ed school, PK-K
[ View School Profile ]
",iconGr); Accokeek[Accokeek.length] = createMarker(new GPoint(-77.01663700,38.67295200),"
Beddow High School, The
501 Bryan Point Road
Accokeek, MD 20607
Co-ed school, 7-12
[ View School Profile ]
",iconGr); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.50732700,38.98120700),"
Book Of Life Academy
913 Cedar Park Rd
Annapolis, MD 21401
Co-ed school, PK-3
[ View School Profile ]
",iconGr); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.50064700,38.98547500),"
Calvary Center School
301 Rowe Blvd
Annapolis, MD 21401
Co-ed school, PK-K
[ View School Profile ]
",iconGr); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.44840400,39.04156300),"
Cape Kids Corner
857 Chestnut Tree Drive
Annapolis, MD 21401
Co-ed school, PK-5
[ View School Profile ]
",iconGr); Arnold[Arnold.length] = createMarker(new GPoint(-76.52204600,39.04434000),"
Chesapeake Academy
1185 Baltimore Annapolis Blvd
Arnold, MD 21012
Co-ed school, PK-5
[ View School Profile ]
",iconGr); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.47733800,39.02398500),"
Chesapeake Montessori School
30 Old Mill Bottom Road N
Annapolis, MD 21409
Co-ed school, PK-5
[ View School Profile ]
",iconGr); Arnold[Arnold.length] = createMarker(new GPoint(-76.50726600,39.05220700),"
College Parkways Creative Beginnings Preschool
Po Box 859
Arnold, MD 21012
Co-ed school, NS-K
[ View School Profile ]
",iconGr); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.51479700,38.96818100),"
Creative Garden Learning Center
479 Merryman Rd
Annapolis, MD 21401
Co-ed school, PK-K
[ View School Profile ]
",iconGr); 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); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.51915100,38.96918300),"
Heritage Learning Center
1740 Forest Drive
Annapolis, MD 21401
Co-ed school, PK-K
[ View School Profile ]
",iconGr); Avenue[Avenue.length] = createMarker(new GPoint(-76.76913600,38.25465100),"
Holy Angels Sacred Heart School
21335 Colton Point Road
Avenue, MD 20609
Co-ed school, PK-8
[ View School Profile ]
",iconGr); 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); 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); Ashton[Ashton.length] = createMarker(new GPoint(-76.99984200,39.16237200),"
Mater Amoris Montessori School
18501 Mink Hollow Road, PO Box 97
Ashton, MD 20861
Co-ed school, PK-6
[ View School Profile ]
",iconGr); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.49564400,39.01559200),"
Montessori International Childrens House
1641 N Winchester Road
Annapolis, MD 21409
Co-ed school, PK-6
[ View School Profile ]
",iconGr); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.46520100,38.99605600),"
Naval Academy Primary School
74 Greenbury Point Road
Annapolis, MD 21402
Co-ed school, PK-5
[ View School Profile ]
",iconGr); Abingdon[Abingdon.length] = createMarker(new GPoint(-76.31362500,39.48957100),"
New Covenant Christian School
128 Saint Marys Church Road
Abingdon, MD 21009
Co-ed school, PK-10
[ View School Profile ]
",iconGr); Adelphi[Adelphi.length] = createMarker(new GPoint(-76.95138900,39.03245900),"
Paint Branch Montessori School
3215 Powder Mill Road
Adelphi, MD 20783
Co-ed school, PK-6
[ View School Profile ]
",iconGr); Arbutus[Arbutus.length] = createMarker(new GPoint(-76.68074700,39.25651900),"
Phoenix Resource Program
1540 Caton Center Drive Suite F
Arbutus, MD 21227
All-boys school, 8-10
[ View School Profile ]
",iconBl); 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); 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); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.51306600,38.96631200),"
St. Martins Lutheran Church School
1120 Spa Road
Annapolis, MD 21403
Co-ed school, PK-8
[ View School Profile ]
",iconGr); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.48799300,38.97526600),"
St. Mary Elementary School
111 Duke Of Gloucester Street
Annapolis, MD 21401
Co-ed school, K-8
[ View School Profile ]
",iconGr); 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); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.48850000,38.94870000),"
Salvation Army Day Care Center
Po Box 3334 Or 351 Hilltop Lan
Annapolis, MD 21403
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); Aberdeen[Aberdeen.length] = createMarker(new GPoint(-76.17035900,39.50799400),"
St Joan Of Arc Elementary School
230 S Law Street
Aberdeen, MD 21001
Co-ed school, K-8
[ View School Profile ]
",iconGr); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.46286600,39.02081400),"
St Margaret's Day School
1605 Pleasant Plains Road
Annapolis, MD 21409
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); 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); Arnold[Arnold.length] = createMarker(new GPoint(-76.51536800,39.03965800),"
Wee Lad & Lassie Early Learning Center
1281 Baltimore Annapolis Blvd
Arnold, MD 21012
Co-ed school, PK-K
[ View School Profile ]
",iconGr); Annapolis[Annapolis.length] = createMarker(new GPoint(-76.51388100,38.99312000),"
Weems Creek Nursery School & Kindergarten
238 Kirkley Road
Annapolis, MD 21401
Co-ed school, PK-K
[ View School Profile ]
",iconGr); Ashton[Ashton.length] = createMarker(new GPoint(-77.00080000,39.14900000),"
Wheaton Christian School
Po Box 460
Ashton, MD 20861
Co-ed school, 1-12
[ View School Profile ]
",iconGr); } // 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//////' + showArray); map.removeOverlays(Aberdeen); map.removeOverlays(Abingdon); map.removeOverlays(Accokeek); map.removeOverlays(Adelphi); map.removeOverlays(Annapolis); map.removeOverlays(Arbutus); map.removeOverlays(Arnold); map.removeOverlays(Ashton); map.removeOverlays(Avenue); 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(Annapolis);map.removeOverlays(Aberdeen); map.removeOverlays(Abingdon); map.removeOverlays(Accokeek); map.removeOverlays(Adelphi); map.removeOverlays(Annapolis); map.removeOverlays(Arbutus); map.removeOverlays(Arnold); map.removeOverlays(Ashton); map.removeOverlays(Avenue); map.addOverlays(Aberdeen); centerByArray(Aberdeen, false, false); cntMarker += Aberdeen.length; map.addOverlays(Abingdon); centerByArray(Abingdon, false, false); cntMarker += Abingdon.length; map.addOverlays(Accokeek); centerByArray(Accokeek, false, false); cntMarker += Accokeek.length; map.addOverlays(Adelphi); centerByArray(Adelphi, false, false); cntMarker += Adelphi.length; map.addOverlays(Annapolis); centerByArray(Annapolis, false, false); cntMarker += Annapolis.length; map.addOverlays(Arbutus); centerByArray(Arbutus, false, false); cntMarker += Arbutus.length; map.addOverlays(Arnold); centerByArray(Arnold, false, false); cntMarker += Arnold.length; map.addOverlays(Ashton); centerByArray(Ashton, false, false); cntMarker += Ashton.length; map.addOverlays(Avenue); centerByArray(Avenue, false, false); cntMarker += Avenue.length; centerByArray(Annapolis,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=&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; }