function addMarkers() { mySelect = document.getElementById('selection'); Westminster = [];Sykesville = [];Eldersburg = [];Union_Bridge = [];Hampstead = [];Manchester = [];Mount_Airy = [];New_Windsor = [];Taneytown = [];Mt_Airy = [];Finksburg = [];mySelect.options[mySelect.options.length] = new Option("Eldersburg schools",'all=Eldersburg'); mySelect.options[mySelect.options.length] = new Option("Finksburg schools",'all=Finksburg'); mySelect.options[mySelect.options.length] = new Option("Hampstead schools",'all=Hampstead'); mySelect.options[mySelect.options.length] = new Option("Manchester schools",'all=Manchester'); mySelect.options[mySelect.options.length] = new Option("Mount Airy schools",'all=Mount_Airy'); mySelect.options[mySelect.options.length] = new Option("Mt Airy schools",'all=Mt_Airy'); mySelect.options[mySelect.options.length] = new Option("New Windsor schools",'all=New_Windsor'); mySelect.options[mySelect.options.length] = new Option("Sykesville schools",'all=Sykesville'); mySelect.options[mySelect.options.length] = new Option("Taneytown schools",'all=Taneytown'); mySelect.options[mySelect.options.length] = new Option("Union Bridge schools",'all=Union_Bridge'); mySelect.options[mySelect.options.length] = new Option("Westminster schools",'all=Westminster'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Westminster[Westminster.length] = createMarker(new GPoint(-76.99387360,39.54079056),"
Carroll County Career & Technology Center
1229 Washington Rd
Westminster, MD 21157

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carroll County Career & Technology Center",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.98601532,39.57227325),"
Carroll County Evening High School
125 N Court St
Westminster, MD 21157

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carroll County Evening High School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.98601532,39.57227325),"
Carroll County Home & Hospital School
125 N Court Street
Westminster, MD 21157

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carroll County Home & Hospital School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.99221802,39.55764771),"
Carroll Springs School
495 S Center St
Westminster, MD 21157

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carroll Springs School",'Westminster=' + Westminster.length); Sykesville[Sykesville.length] = createMarker(new GPoint(-76.93203735,39.39425659),"
Carrolltowne Elementary School
6542 Ridge Rd
Sykesville, MD 21784

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carrolltowne Elementary School",'Sykesville=' + Sykesville.length); Eldersburg[Eldersburg.length] = createMarker(new GPoint(-76.98271179,39.42262268),"
Century High School
355 Ronsdale Rd
Eldersburg, MD 21784

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Century High School",'Eldersburg=' + Eldersburg.length); Westminster[Westminster.length] = createMarker(new GPoint(-77.03498077,39.67545700),"
Charles Carroll Elementary School
3719 Littlestown Pike
Westminster, MD 21158

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Charles Carroll Elementary School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.97978973,39.57531357),"
Cranberry Station Elementary School
505n Center St
Westminster, MD 21157

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cranberry Station Elementary School",'Westminster=' + Westminster.length); Sykesville[Sykesville.length] = createMarker(new GPoint(-76.96054840,39.40816116),"
Eldersburg Elementary School
1021 Johnsville Rd
Sykesville, MD 21784

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eldersburg Elementary School",'Sykesville=' + Sykesville.length); Union_Bridge[Union_Bridge.length] = createMarker(new GPoint(-77.17522430,39.57644653),"
Elmer A. Wolfe Elementary School
119 N Main St
Union Bridge, MD 21791

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Elmer A. Wolfe Elementary School",'Union_Bridge=' + Union_Bridge.length); Union_Bridge[Union_Bridge.length] = createMarker(new GPoint(-77.13181305,39.59359741),"
Francis Scott Key Senior High School
3825 Bark Hill Rd
Union Bridge, MD 21791

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Francis Scott Key Senior High School",'Union_Bridge=' + Union_Bridge.length); Sykesville[Sykesville.length] = createMarker(new GPoint(-76.95055389,39.31485748),"
Freedom District Elementary School
5626 Sykesville Rd
Sykesville, MD 21784

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Freedom District Elementary School",'Sykesville=' + Sykesville.length); Westminster[Westminster.length] = createMarker(new GPoint(-77.00595856,39.54104233),"
Friendship Valley Elementary School
1100 Gist Rd
Westminster, MD 21157

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Friendship Valley Elementary School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.99600983,39.57518768),"
Gateway School
225 Kate Wagner Rd
Westminster, MD 21157

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gateway School",'Westminster=' + Westminster.length); Hampstead[Hampstead.length] = createMarker(new GPoint(-76.86280823,39.60306931),"
Hampstead Elementary School
3737 Shiloh Rd
Hampstead, MD 21074

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hampstead Elementary School",'Hampstead=' + Hampstead.length); Sykesville[Sykesville.length] = createMarker(new GPoint(-76.95529938,39.41484070),"
Liberty High School
5855 Bartholow Rd
Sykesville, MD 21784

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Liberty High School",'Sykesville=' + Sykesville.length); Sykesville[Sykesville.length] = createMarker(new GPoint(-76.98186493,39.42256546),"
Linton Springs Elementary School
375 Ronsdale Rd
Sykesville, MD 21784

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Linton Springs Elementary School",'Sykesville=' + Sykesville.length); Manchester[Manchester.length] = createMarker(new GPoint(-76.88407135,39.66170502),"
Manchester Elementary School
3224 York Street
Manchester, MD 21102

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Manchester Elementary School",'Manchester=' + Manchester.length); Sykesville[Sykesville.length] = createMarker(new GPoint(-76.95055389,39.31485748),"
Mechanicsville Elementary School
3838 Sykesville Rd
Sykesville, MD 21784

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mechanicsville Elementary School",'Sykesville=' + Sykesville.length); Mount_Airy[Mount_Airy.length] = createMarker(new GPoint(-77.15033722,39.37986755),"
Mount Airy Elementary School
405 N Main St
Mount Airy, MD 21771

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mount Airy Elementary School",'Mount_Airy=' + Mount_Airy.length); New_Windsor[New_Windsor.length] = createMarker(new GPoint(-77.11191559,39.55007935),"
New Windsor Middle School
1000 Green Valley Rd
New Windsor, MD 21776

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("New Windsor Middle School",'New_Windsor=' + New_Windsor.length); Hampstead[Hampstead.length] = createMarker(new GPoint(-76.86128998,39.60866547),"
North Carroll High School
1400 Panther Dr
Hampstead, MD 21074

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Carroll High School",'Hampstead=' + Hampstead.length); Hampstead[Hampstead.length] = createMarker(new GPoint(-76.86961365,39.64087296),"
North Carroll Middle School
2401 Hanover Pike
Hampstead, MD 21074

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("North Carroll Middle School",'Hampstead=' + Hampstead.length); Taneytown[Taneytown.length] = createMarker(new GPoint(-77.16871643,39.65212631),"
Northwest Middle School
99 Kings Drive
Taneytown, MD 21787

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Northwest Middle School",'Taneytown=' + Taneytown.length); Sykesville[Sykesville.length] = createMarker(new GPoint(-76.93217468,39.39942551),"
Oklahoma Road Middle School
6300 Oklahoma Rd
Sykesville, MD 21784

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Oklahoma Road Middle School",'Sykesville=' + Sykesville.length); Mt_Airy[Mt_Airy.length] = createMarker(new GPoint(-77.15479900,39.37647000),"
Parr's Ridge Elementary School
2202 Watersville Rd
Mt Airy, MD 21771

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Parr's Ridge Elementary School",'Mt_Airy=' + Mt_Airy.length); Sykesville[Sykesville.length] = createMarker(new GPoint(-76.96546936,39.40611649),"
Piney Ridge Elementary School
6315 Freedom Ave
Sykesville, MD 21784

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Piney Ridge Elementary School",'Sykesville=' + Sykesville.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.98591900,39.57341400),"
Post Secondary Program
125 N Court St
Westminster, MD 21157

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Post Secondary Program",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.99255900,39.57448500),"
Pride School
495 S Center St
Westminster, MD 21157

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pride School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.99462128,39.53378677),"
Robert Moton Elementary School
1413 Washington Rd
Westminster, MD 21157

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robert Moton Elementary School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-77.10593414,39.63109589),"
Runnymede Elementary School
3000 Langdon Dr
Westminster, MD 21158

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Runnymede Elementary School",'Westminster=' + Westminster.length); Finksburg[Finksburg.length] = createMarker(new GPoint(-76.92402649,39.52406311),"
Sandymount Elementary School
2222 Old Westminster Pike
Finksburg, MD 21048

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sandymount Elementary School",'Finksburg=' + Finksburg.length); Hampstead[Hampstead.length] = createMarker(new GPoint(-76.85796356,39.60207748),"
Shiloh Middle School
3675 Willow St
Hampstead, MD 21074

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Shiloh Middle School",'Hampstead=' + Hampstead.length); Sykesville[Sykesville.length] = createMarker(new GPoint(-77.04566956,39.44329071),"
South Carroll Senior High School
1300 W Old Liberty Rd
Sykesville, MD 21784

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Carroll Senior High School",'Sykesville=' + Sykesville.length); Hampstead[Hampstead.length] = createMarker(new GPoint(-76.83910370,39.59287262),"
Spring Garden Elementary School
700 Boxwood Dr
Hampstead, MD 21074

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Spring Garden Elementary School",'Hampstead=' + Hampstead.length); Sykesville[Sykesville.length] = createMarker(new GPoint(-76.96749878,39.37279129),"
Sykesville Middle School
7301 Springfield Ave
Sykesville, MD 21784

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sykesville Middle School",'Sykesville=' + Sykesville.length); Taneytown[Taneytown.length] = createMarker(new GPoint(-77.16871643,39.65212631),"
Taneytown Elementary School
100 Kings Drive
Taneytown, MD 21787

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Taneytown Elementary School",'Taneytown=' + Taneytown.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.99185181,39.57494736),"
Westminster East Middle School
121 Longwell Ave
Westminster, MD 21157

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Westminster East Middle School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-77.02466583,39.58052826),"
Westminster Elementary School
811 Uniontown Rd
Westminster, MD 21158

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westminster Elementary School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.99389648,39.54223251),"
Westminster Senior High School
1225 Washington Rd
Westminster, MD 21157

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westminster Senior High School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.99212646,39.58301163),"
Westminster West Middle School
60 Monroe St
Westminster, MD 21157

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Westminster West Middle School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.99183655,39.58286285),"
William Winchester Elementary School
70 Monroe St
Westminster, MD 21157

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("William Winchester Elementary School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-77.05499268,39.45439529),"
Winfield Elementary School
4401 Salem Bottom Rd
Westminster, MD 21157

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Winfield Elementary School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.97801971,39.57043839),"
Winters Mill High School
560 Gorsuch Rd
Westminster, MD 21157

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Winters Mill High School",'Westminster=' + Westminster.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,10); /* 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(Eldersburg); map.removeOverlays(Finksburg); map.removeOverlays(Hampstead); map.removeOverlays(Manchester); map.removeOverlays(Mount_Airy); map.removeOverlays(Mt_Airy); map.removeOverlays(New_Windsor); map.removeOverlays(Sykesville); map.removeOverlays(Taneytown); map.removeOverlays(Union_Bridge); map.removeOverlays(Westminster); 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(Westminster);map.removeOverlays(Eldersburg); map.removeOverlays(Finksburg); map.removeOverlays(Hampstead); map.removeOverlays(Manchester); map.removeOverlays(Mount_Airy); map.removeOverlays(Mt_Airy); map.removeOverlays(New_Windsor); map.removeOverlays(Sykesville); map.removeOverlays(Taneytown); map.removeOverlays(Union_Bridge); map.removeOverlays(Westminster); map.addOverlays(Eldersburg); centerByArray(Eldersburg, false, false); cntMarker += Eldersburg.length; map.addOverlays(Finksburg); centerByArray(Finksburg, false, false); cntMarker += Finksburg.length; map.addOverlays(Hampstead); centerByArray(Hampstead, false, false); cntMarker += Hampstead.length; map.addOverlays(Manchester); centerByArray(Manchester, false, false); cntMarker += Manchester.length; map.addOverlays(Mount_Airy); centerByArray(Mount_Airy, false, false); cntMarker += Mount_Airy.length; map.addOverlays(Mt_Airy); centerByArray(Mt_Airy, false, false); cntMarker += Mt_Airy.length; map.addOverlays(New_Windsor); centerByArray(New_Windsor, false, false); cntMarker += New_Windsor.length; map.addOverlays(Sykesville); centerByArray(Sykesville, false, false); cntMarker += Sykesville.length; map.addOverlays(Taneytown); centerByArray(Taneytown, false, false); cntMarker += Taneytown.length; map.addOverlays(Union_Bridge); centerByArray(Union_Bridge, false, false); cntMarker += Union_Bridge.length; map.addOverlays(Westminster); centerByArray(Westminster, false, false); cntMarker += Westminster.length; centerByArray(Westminster,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'); } }