function addMarkers() { mySelect = document.getElementById('selection'); Baldwin = [];Towson = [];Catonsville = [];Reisterstown = [];Perry_Hall = [];Randallstown = [];Cockeysville = [];Owings_Mills = [];Timonium = [];Upperco = [];Halethorpe = [];Lutherville = [];Parkton = [];Monkton = [];Phoenix = [];Kingsville = [];Freeland = [];Sparks = [];Sparrows_Point = [];Pikesville = [];Parkville = [];mySelect.options[mySelect.options.length] = new Option("Baldwin schools",'all=Baldwin'); mySelect.options[mySelect.options.length] = new Option("Catonsville schools",'all=Catonsville'); mySelect.options[mySelect.options.length] = new Option("Cockeysville schools",'all=Cockeysville'); mySelect.options[mySelect.options.length] = new Option("Freeland schools",'all=Freeland'); mySelect.options[mySelect.options.length] = new Option("Halethorpe schools",'all=Halethorpe'); mySelect.options[mySelect.options.length] = new Option("Kingsville schools",'all=Kingsville'); mySelect.options[mySelect.options.length] = new Option("Lutherville schools",'all=Lutherville'); mySelect.options[mySelect.options.length] = new Option("Monkton schools",'all=Monkton'); mySelect.options[mySelect.options.length] = new Option("Owings Mills schools",'all=Owings_Mills'); mySelect.options[mySelect.options.length] = new Option("Parkton schools",'all=Parkton'); mySelect.options[mySelect.options.length] = new Option("Parkville schools",'all=Parkville'); mySelect.options[mySelect.options.length] = new Option("Perry Hall schools",'all=Perry_Hall'); mySelect.options[mySelect.options.length] = new Option("Phoenix schools",'all=Phoenix'); mySelect.options[mySelect.options.length] = new Option("Pikesville schools",'all=Pikesville'); mySelect.options[mySelect.options.length] = new Option("Randallstown schools",'all=Randallstown'); mySelect.options[mySelect.options.length] = new Option("Reisterstown schools",'all=Reisterstown'); mySelect.options[mySelect.options.length] = new Option("Sparks schools",'all=Sparks'); mySelect.options[mySelect.options.length] = new Option("Sparrows Point schools",'all=Sparrows_Point'); mySelect.options[mySelect.options.length] = new Option("Timonium schools",'all=Timonium'); mySelect.options[mySelect.options.length] = new Option("Towson schools",'all=Towson'); mySelect.options[mySelect.options.length] = new Option("Upperco schools",'all=Upperco'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Baldwin[Baldwin.length] = createMarker(new GPoint(-76.52501678,39.49596405),"
Carroll Manor Elementary School
4434 Carroll Manor Rd
Baldwin, MD 21013

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carroll Manor Elementary School",'Baldwin=' + Baldwin.length); Towson[Towson.length] = createMarker(new GPoint(-76.60894012,39.40966415),"
Carver Center For Arts & Technology
938 York Rd
Towson, MD 21204

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carver Center For Arts & Technology",'Towson=' + Towson.length); Catonsville[Catonsville.length] = createMarker(new GPoint(-76.72915649,39.27255630),"
Catonsville Elementary School
615 Frederick Rd
Catonsville, MD 21228

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Catonsville Elementary School",'Catonsville=' + Catonsville.length); Catonsville[Catonsville.length] = createMarker(new GPoint(-76.77233124,39.27693939),"
Catonsville Middle School
2301 Edmondson Ave
Catonsville, MD 21228

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Catonsville Middle School",'Catonsville=' + Catonsville.length); Reisterstown[Reisterstown.length] = createMarker(new GPoint(-76.80704498,39.44044876),"
Cedarmere Elementary School
17 Nicodemus Rd
Reisterstown, MD 21136

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cedarmere Elementary School",'Reisterstown=' + Reisterstown.length); Perry_Hall[Perry_Hall.length] = createMarker(new GPoint(-76.43281555,39.39757538),"
Chapel Hill Elementary School
5200 E Joppa Rd
Perry Hall, MD 21128

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chapel Hill Elementary School",'Perry_Hall=' + Perry_Hall.length); Reisterstown[Reisterstown.length] = createMarker(new GPoint(-76.82440186,39.46406174),"
Chatsworth School
222 New Ave
Reisterstown, MD 21136

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chatsworth School",'Reisterstown=' + Reisterstown.length); Randallstown[Randallstown.length] = createMarker(new GPoint(-76.77882385,39.36920929),"
Church Lane Elementary Technology
3820 Fernside Rd
Randallstown, MD 21133

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Church Lane Elementary Technology",'Randallstown=' + Randallstown.length); Cockeysville[Cockeysville.length] = createMarker(new GPoint(-76.63092804,39.47303772),"
Cockeysville Middle School
10401 Greenside Dr
Cockeysville, MD 21030

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Cockeysville Middle School",'Cockeysville=' + Cockeysville.length); Owings_Mills[Owings_Mills.length] = createMarker(new GPoint(-76.81723022,39.39022827),"
Deer Park Elementary School
9809 Lyons Mill Rd
Owings Mills, MD 21117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Deer Park Elementary School",'Owings_Mills=' + Owings_Mills.length); Randallstown[Randallstown.length] = createMarker(new GPoint(-76.81919861,39.38711929),"
Deer Park Middle Magnet School
9830 Winands Rd
Randallstown, MD 21133

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Deer Park Middle Magnet School",'Randallstown=' + Randallstown.length); Timonium[Timonium.length] = createMarker(new GPoint(-76.61413574,39.45886993),"
Dulaney High School
255 Padonia Road
Timonium, MD 21093

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dulaney High School",'Timonium=' + Timonium.length); Upperco[Upperco.length] = createMarker(new GPoint(-76.77494812,39.60174942),"
Fifth District Elementary School
3725 Mount Carmel Rd
Upperco, MD 21155

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fifth District Elementary School",'Upperco=' + Upperco.length); Reisterstown[Reisterstown.length] = createMarker(new GPoint(-76.83035278,39.46388626),"
Franklin Elementary School
33 Cockeysmill Rd
Reisterstown, MD 21136

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Franklin Elementary School",'Reisterstown=' + Reisterstown.length); Reisterstown[Reisterstown.length] = createMarker(new GPoint(-76.81443024,39.44716644),"
Franklin High School
12000 Reisterstown Rd
Reisterstown, MD 21136

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Franklin High School",'Reisterstown=' + Reisterstown.length); Reisterstown[Reisterstown.length] = createMarker(new GPoint(-76.82964325,39.46435165),"
Franklin Middle School
10 Cockeysmill Rd
Reisterstown, MD 21136

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Franklin Middle School",'Reisterstown=' + Reisterstown.length); Reisterstown[Reisterstown.length] = createMarker(new GPoint(-76.81333923,39.46414566),"
Glyndon Elementary School
445 Glyndon Dr
Reisterstown, MD 21136

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glyndon Elementary School",'Reisterstown=' + Reisterstown.length); Halethorpe[Halethorpe.length] = createMarker(new GPoint(-76.68614960,39.24094772),"
Halethorpe Elementary School
4300 Maple Ave
Halethorpe, MD 21227

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Halethorpe Elementary School",'Halethorpe=' + Halethorpe.length); Lutherville[Lutherville.length] = createMarker(new GPoint(-76.60152435,39.41574478),"
Hampton Elementary School
1115 Charmuth Rd
Lutherville, MD 21093

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hampton Elementary School",'Lutherville=' + Lutherville.length); Parkton[Parkton.length] = createMarker(new GPoint(-76.65997314,39.60120392),"
Hereford High School
17301 York Rd
Parkton, MD 21120

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hereford High School",'Parkton=' + Parkton.length); Monkton[Monkton.length] = createMarker(new GPoint(-76.65133667,39.57107925),"
Hereford Middle School
712 Corbett Rd
Monkton, MD 21111

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hereford Middle School",'Monkton=' + Monkton.length); Randallstown[Randallstown.length] = createMarker(new GPoint(-76.82843781,39.37513733),"
Hernwood Elementary School
9919 Marriottsville Rd
Randallstown, MD 21133

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hernwood Elementary School",'Randallstown=' + Randallstown.length); Phoenix[Phoenix.length] = createMarker(new GPoint(-76.56275940,39.50966644),"
Jacksonville Elementary School
3400 Hillendale Heights Rd
Phoenix, MD 21131

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jacksonville Elementary School",'Phoenix=' + Phoenix.length); Kingsville[Kingsville.length] = createMarker(new GPoint(-76.41737366,39.45284653),"
Kingsville Elementary School
7300 Sunshine Ave
Kingsville, MD 21087

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kingsville Elementary School",'Kingsville=' + Kingsville.length); Lutherville[Lutherville.length] = createMarker(new GPoint(-76.61968231,39.42638779),"
Lutherville Laboratory Elementary School
1700 North York Rd
Lutherville, MD 21093

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lutherville Laboratory Elementary School",'Lutherville=' + Lutherville.length); Owings_Mills[Owings_Mills.length] = createMarker(new GPoint(-76.81525421,39.40166855),"
New Town Elementary School
4924 New Town Blvd
Owings Mills, MD 21117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Town Elementary School",'Owings_Mills=' + Owings_Mills.length); Owings_Mills[Owings_Mills.length] = createMarker(new GPoint(-76.78299713,39.41949844),"
New Town High School
4931 New Town Blvd
Owings Mills, MD 21117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Town High School",'Owings_Mills=' + Owings_Mills.length); Owings_Mills[Owings_Mills.length] = createMarker(new GPoint(-76.78289795,39.41939926),"
Owings Mills Elementary School
10824 Reistertown Road
Owings Mills, MD 21117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Owings Mills Elementary School",'Owings_Mills=' + Owings_Mills.length); Owings_Mills[Owings_Mills.length] = createMarker(new GPoint(-76.79342651,39.42231750),"
Owings Mills High School
124 Tollgate Rd
Owings Mills, MD 21117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Owings Mills High School",'Owings_Mills=' + Owings_Mills.length); Cockeysville[Cockeysville.length] = createMarker(new GPoint(-76.63044739,39.46284103),"
Padonia International Elementary School
9834 Greenside Dr
Cockeysville, MD 21030

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Padonia International Elementary School",'Cockeysville=' + Cockeysville.length); Timonium[Timonium.length] = createMarker(new GPoint(-76.63924408,39.44432068),"
Pinewood Elementary School
200 Rickswood Rd
Timonium, MD 21093

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pinewood Elementary School",'Timonium=' + Timonium.length); Towson[Towson.length] = createMarker(new GPoint(-76.57269287,39.39111328),"
Pleasant Plains Elementary School
8300 Pleasant Plains Rd
Towson, MD 21286

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Plains Elementary School",'Towson=' + Towson.length); Timonium[Timonium.length] = createMarker(new GPoint(-76.61363220,39.45471573),"
Pot Spring Elementary School
2410 Spring Lake Dr
Timonium, MD 21093

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pot Spring Elementary School",'Timonium=' + Timonium.length); Freeland[Freeland.length] = createMarker(new GPoint(-76.71121979,39.66640091),"
Prettyboy Elementary School
19810 Middletown Rd
Freeland, MD 21053

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Prettyboy Elementary School",'Freeland=' + Freeland.length); Randallstown[Randallstown.length] = createMarker(new GPoint(-76.79663849,39.36783981),"
Randallstown Elementary School
9013 Liberty Rd
Randallstown, MD 21133

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Randallstown Elementary School",'Randallstown=' + Randallstown.length); Randallstown[Randallstown.length] = createMarker(new GPoint(-76.79660034,39.38037872),"
Randallstown Evening High School
4000 Offutt Rd
Randallstown, MD 21133

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Randallstown Evening High School",'Randallstown=' + Randallstown.length); Randallstown[Randallstown.length] = createMarker(new GPoint(-76.79565430,39.38190842),"
Randallstown High School
4000 Offutt Rd
Randallstown, MD 21133

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Randallstown High School",'Randallstown=' + Randallstown.length); Reisterstown[Reisterstown.length] = createMarker(new GPoint(-76.81647491,39.45644379),"
Reisterstown Elementary School
223 Walgrove Rd
Reisterstown, MD 21136

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Reisterstown Elementary School",'Reisterstown=' + Reisterstown.length); Towson[Towson.length] = createMarker(new GPoint(-76.64758301,39.41403198),"
Riderwood Elementary School
1711 Landrake Rd
Towson, MD 21204

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riderwood Elementary School",'Towson=' + Towson.length); Lutherville[Lutherville.length] = createMarker(new GPoint(-76.61569977,39.43213654),"
Ridgely Middle School
121 Ridgely Road
Lutherville, MD 21093

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ridgely Middle School",'Lutherville=' + Lutherville.length); Parkton[Parkton.length] = createMarker(new GPoint(-76.64585876,39.68498993),"
Seventh District Elementary School
20300 York Rd
Parkton, MD 21120

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Seventh District Elementary School",'Parkton=' + Parkton.length); Sparks[Sparks.length] = createMarker(new GPoint(-76.66059113,39.54494476),"
Sparks Elementary School
601 Belfast Rd
Sparks, MD 21152

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sparks Elementary School",'Sparks=' + Sparks.length); Sparrows_Point[Sparrows_Point.length] = createMarker(new GPoint(-76.44383240,39.23889542),"
Sparrows Point High School
7400 N Point Rd
Sparrows Point, MD 21219

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sparrows Point High School",'Sparrows_Point=' + Sparrows_Point.length); Owings_Mills[Owings_Mills.length] = createMarker(new GPoint(-76.79221344,39.44467545),"
Timber Grove Elementary School
701 Academy Ave
Owings Mills, MD 21117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Timber Grove Elementary School",'Owings_Mills=' + Owings_Mills.length); Timonium[Timonium.length] = createMarker(new GPoint(-76.61347961,39.43952179),"
Timonium Elementary School
2001 Eastridge Rd
Timonium, MD 21093

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Timonium Elementary School",'Timonium=' + Timonium.length); Towson[Towson.length] = createMarker(new GPoint(-76.60199738,39.39124298),"
Towson High Law & Public Policy
69 Cedar Ave
Towson, MD 21286

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Towson High Law & Public Policy",'Towson=' + Towson.length); Cockeysville[Cockeysville.length] = createMarker(new GPoint(-76.60767365,39.47322464),"
Warren Elementary School
900 Bosley Rd
Cockeysville, MD 21030

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Warren Elementary School",'Cockeysville=' + Cockeysville.length); Pikesville[Pikesville.length] = createMarker(new GPoint(-76.69393921,39.37580872),"
Wellwood International Elementary School
2901 Smith Ave
Pikesville, MD 21208

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wellwood International Elementary School",'Pikesville=' + Pikesville.length); Catonsville[Catonsville.length] = createMarker(new GPoint(-76.72463226,39.28790283),"
Westowne Elementary School
401 Harlem Ln
Catonsville, MD 21228

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westowne Elementary School",'Catonsville=' + Catonsville.length); Parkville[Parkville.length] = createMarker(new GPoint(-76.55286407,39.38976669),"
White Oak School
8401 Leefield Rd
Parkville, MD 21234

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("White Oak School",'Parkville=' + Parkville.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(Baldwin); map.removeOverlays(Catonsville); map.removeOverlays(Cockeysville); map.removeOverlays(Freeland); map.removeOverlays(Halethorpe); map.removeOverlays(Kingsville); map.removeOverlays(Lutherville); map.removeOverlays(Monkton); map.removeOverlays(Owings_Mills); map.removeOverlays(Parkton); map.removeOverlays(Parkville); map.removeOverlays(Perry_Hall); map.removeOverlays(Phoenix); map.removeOverlays(Pikesville); map.removeOverlays(Randallstown); map.removeOverlays(Reisterstown); map.removeOverlays(Sparks); map.removeOverlays(Sparrows_Point); map.removeOverlays(Timonium); map.removeOverlays(Towson); map.removeOverlays(Upperco); 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(Baldwin);map.removeOverlays(Baldwin); map.removeOverlays(Catonsville); map.removeOverlays(Cockeysville); map.removeOverlays(Freeland); map.removeOverlays(Halethorpe); map.removeOverlays(Kingsville); map.removeOverlays(Lutherville); map.removeOverlays(Monkton); map.removeOverlays(Owings_Mills); map.removeOverlays(Parkton); map.removeOverlays(Parkville); map.removeOverlays(Perry_Hall); map.removeOverlays(Phoenix); map.removeOverlays(Pikesville); map.removeOverlays(Randallstown); map.removeOverlays(Reisterstown); map.removeOverlays(Sparks); map.removeOverlays(Sparrows_Point); map.removeOverlays(Timonium); map.removeOverlays(Towson); map.removeOverlays(Upperco); map.addOverlays(Baldwin); centerByArray(Baldwin, false, false); cntMarker += Baldwin.length; map.addOverlays(Catonsville); centerByArray(Catonsville, false, false); cntMarker += Catonsville.length; map.addOverlays(Cockeysville); centerByArray(Cockeysville, false, false); cntMarker += Cockeysville.length; map.addOverlays(Freeland); centerByArray(Freeland, false, false); cntMarker += Freeland.length; map.addOverlays(Halethorpe); centerByArray(Halethorpe, false, false); cntMarker += Halethorpe.length; map.addOverlays(Kingsville); centerByArray(Kingsville, false, false); cntMarker += Kingsville.length; map.addOverlays(Lutherville); centerByArray(Lutherville, false, false); cntMarker += Lutherville.length; map.addOverlays(Monkton); centerByArray(Monkton, false, false); cntMarker += Monkton.length; map.addOverlays(Owings_Mills); centerByArray(Owings_Mills, false, false); cntMarker += Owings_Mills.length; map.addOverlays(Parkton); centerByArray(Parkton, false, false); cntMarker += Parkton.length; map.addOverlays(Parkville); centerByArray(Parkville, false, false); cntMarker += Parkville.length; map.addOverlays(Perry_Hall); centerByArray(Perry_Hall, false, false); cntMarker += Perry_Hall.length; map.addOverlays(Phoenix); centerByArray(Phoenix, false, false); cntMarker += Phoenix.length; map.addOverlays(Pikesville); centerByArray(Pikesville, false, false); cntMarker += Pikesville.length; map.addOverlays(Randallstown); centerByArray(Randallstown, false, false); cntMarker += Randallstown.length; map.addOverlays(Reisterstown); centerByArray(Reisterstown, false, false); cntMarker += Reisterstown.length; map.addOverlays(Sparks); centerByArray(Sparks, false, false); cntMarker += Sparks.length; map.addOverlays(Sparrows_Point); centerByArray(Sparrows_Point, false, false); cntMarker += Sparrows_Point.length; map.addOverlays(Timonium); centerByArray(Timonium, false, false); cntMarker += Timonium.length; map.addOverlays(Towson); centerByArray(Towson, false, false); cntMarker += Towson.length; map.addOverlays(Upperco); centerByArray(Upperco, false, false); cntMarker += Upperco.length; centerByArray(Baldwin,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'); } }