function addMarkers(){ mySelect = document.getElementById('selection'); Sykesville = [];Keymar = [];Westminster = [];Eldersburg = [];Finksburg = [];Manchester = [];Hampstead = [];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("Keymar schools",'all=Keymar'); mySelect.options[mySelect.options.length] = new Option("Manchester schools",'all=Manchester'); mySelect.options[mySelect.options.length] = new Option("Sykesville schools",'all=Sykesville'); mySelect.options[mySelect.options.length] = new Option("Westminster schools",'all=Westminster'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Sykesville[Sykesville.length] = createMarker(new GPoint(-76.96926100,39.36619600),"
Aleem Academy
7543 Main Street
Sykesville, MD 21784
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aleem Academy",'Sykesville=' + Sykesville.length); Keymar[Keymar.length] = createMarker(new GPoint(-77.26360000,39.59170000),"
Bowling Brook Preparatory School
P O Box 100
Keymar, MD 21757
All-boys school, Ungraded
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bowling Brook Preparatory School",'Keymar=' + Keymar.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.97858100,39.56764200),"
Carroll Christian Schools
550 Baltimore Blvd
Westminster, MD 21157
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carroll Christian Schools",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-77.00403900,39.59606400),"
Carroll Lutheran School
700 Kriders Cemetary Road
Westminster, MD 21158
Co-ed school, K-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carroll Lutheran School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.98755200,39.56212500),"
Christian Preschool & Kindergarten Program
65 Washington Road
Westminster, MD 21157
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Preschool & Kindergarten Program",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.98614200,39.54381700),"
Crest Lane Sda Church School
324 Crest Lane
Westminster, MD 21157
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crest Lane Sda Church School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.97988900,39.57610300),"
Faith Christian School
30 N Cranberry Road
Westminster, MD 21157
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Christian School",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.98936300,39.58371500),"
The Forbush School At Westminster
200 Baltimore Blvd
Westminster, MD 21157
Co-ed school, 4-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Forbush School At Westminster",'Westminster=' + Westminster.length); Eldersburg[Eldersburg.length] = createMarker(new GPoint(-76.94252000,39.41134100),"
Friendship School
1545 Progress Way
Eldersburg, MD 21784
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Friendship School",'Eldersburg=' + Eldersburg.length); Finksburg[Finksburg.length] = createMarker(new GPoint(-76.90544200,39.51034800),"
Gerstell Academy
2500 Old Westminster Pike
Finksburg, MD 21048
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gerstell Academy",'Finksburg=' + Finksburg.length); Eldersburg[Eldersburg.length] = createMarker(new GPoint(-76.92427100,39.39711900),"
Goddard School Of Eldersburg, The
2028 Liberty Road
Eldersburg, MD 21784
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Goddard School Of Eldersburg, The",'Eldersburg=' + Eldersburg.length); Manchester[Manchester.length] = createMarker(new GPoint(-76.88579100,39.64878300),"
Grace Bible Christian Preschoo
3250 Charmil Drive
Manchester, MD 21102
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Bible Christian Preschoo",'Manchester=' + Manchester.length); Westminster[Westminster.length] = createMarker(new GPoint(-77.03540000,39.60833900),"
Montessori School Of Westminster
1055 Montessori Drive
Westminster, MD 21158
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori School Of Westminster",'Westminster=' + Westminster.length); Hampstead[Hampstead.length] = createMarker(new GPoint(-76.84303300,39.58604800),"
Morning Star Christian School
328 Hanover Pike Pob 215
Hampstead, MD 21074
Co-ed school, KG-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Morning Star Christian School",'Hampstead=' + Hampstead.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.98937300,39.59410100),"
Ncl: The Nazarene Christian Learning
147 Sullivan Road
Westminster, MD 21157
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ncl: The Nazarene Christian Learning",'Westminster=' + Westminster.length); Hampstead[Hampstead.length] = createMarker(new GPoint(-76.86570000,39.68020000),"
North Carroll Christian Academy
2693 Hanover Pike
Hampstead, MD 21074
Co-ed school, K-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Carroll Christian Academy",'Hampstead=' + Hampstead.length); Westminster[Westminster.length] = createMarker(new GPoint(-76.99508100,39.58422800),"
St. John Catholic School
45 Monroe Street
Westminster, MD 21157
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John Catholic School",'Westminster=' + Westminster.length); Eldersburg[Eldersburg.length] = createMarker(new GPoint(-76.91464500,39.39471800),"
St. Stephen's Classical Christian
2275 Liberty Rd
Eldersburg, MD 21784
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Stephen's Classical Christian",'Eldersburg=' + Eldersburg.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/////1/' + showArray); map.removeOverlays(Eldersburg); map.removeOverlays(Finksburg); map.removeOverlays(Hampstead); map.removeOverlays(Keymar); map.removeOverlays(Manchester); map.removeOverlays(Sykesville); 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(Sykesville);map.removeOverlays(Eldersburg); map.removeOverlays(Finksburg); map.removeOverlays(Hampstead); map.removeOverlays(Keymar); map.removeOverlays(Manchester); map.removeOverlays(Sykesville); 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(Keymar); centerByArray(Keymar, false, false); cntMarker += Keymar.length; map.addOverlays(Manchester); centerByArray(Manchester, false, false); cntMarker += Manchester.length; map.addOverlays(Sykesville); centerByArray(Sykesville, false, false); cntMarker += Sykesville.length; map.addOverlays(Westminster); centerByArray(Westminster, false, false); cntMarker += Westminster.length; centerByArray(Sykesville,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=1&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; }