function addMarkers() { mySelect = document.getElementById('selection'); Camp_Hill = [];Carlisle = [];Newville = [];Boiling_Springs = [];Mechanicsburg = [];Enola = [];Shippensburg = [];New_Cumberland = [];Lemoyne = [];Shiremanstown = [];Mount_Holly_Springs = [];mySelect.options[mySelect.options.length] = new Option("Boiling Springs schools",'all=Boiling_Springs'); mySelect.options[mySelect.options.length] = new Option("Camp Hill schools",'all=Camp_Hill'); mySelect.options[mySelect.options.length] = new Option("Carlisle schools",'all=Carlisle'); mySelect.options[mySelect.options.length] = new Option("Enola schools",'all=Enola'); mySelect.options[mySelect.options.length] = new Option("Lemoyne schools",'all=Lemoyne'); mySelect.options[mySelect.options.length] = new Option("Mechanicsburg schools",'all=Mechanicsburg'); mySelect.options[mySelect.options.length] = new Option("Mount Holly Springs schools",'all=Mount_Holly_Springs'); mySelect.options[mySelect.options.length] = new Option("New Cumberland schools",'all=New_Cumberland'); mySelect.options[mySelect.options.length] = new Option("Newville schools",'all=Newville'); mySelect.options[mySelect.options.length] = new Option("Shippensburg schools",'all=Shippensburg'); mySelect.options[mySelect.options.length] = new Option("Shiremanstown schools",'all=Shiremanstown'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Camp_Hill[Camp_Hill.length] = createMarker(new GPoint(-76.95114899,40.21650314),"
Allen Middle School
4225 Gettysburg Rd
Camp Hill, PA 17011

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Allen Middle School",'Camp_Hill=' + Camp_Hill.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-77.20339966,40.20677948),"
Bellaire Elementary School
623 W Penn St
Carlisle, PA 17013

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bellaire Elementary School",'Carlisle=' + Carlisle.length); Newville[Newville.length] = createMarker(new GPoint(-77.38427734,40.17431641),"
Big Spring High School
100 Mount Rock Rd
Newville, PA 17241

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Big Spring High School",'Newville=' + Newville.length); Newville[Newville.length] = createMarker(new GPoint(-77.38413239,40.17427826),"
Big Spring Middle School
47 Mount Rock Rd
Newville, PA 17241

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Big Spring Middle School",'Newville=' + Newville.length); Boiling_Springs[Boiling_Springs.length] = createMarker(new GPoint(-77.13197327,40.15198517),"
Boiling Springs High School
4 Forge Rd
Boiling Springs, PA 17007

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Boiling Springs High School",'Boiling_Springs=' + Boiling_Springs.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-77.01651001,40.20822525),"
Broad Street Elementary School
200 S Broad St
Mechanicsburg, PA 17055

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Broad Street Elementary School",'Mechanicsburg=' + Mechanicsburg.length); Camp_Hill[Camp_Hill.length] = createMarker(new GPoint(-76.92547607,40.23876190),"
Camp Hill Middle School
2401 Chestnut St
Camp Hill, PA 17011

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Camp Hill Middle School",'Camp_Hill=' + Camp_Hill.length); Camp_Hill[Camp_Hill.length] = createMarker(new GPoint(-76.92547607,40.23876190),"
Camp Hill Senior High School
100 S 24th St
Camp Hill, PA 17011

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Camp Hill Senior High School",'Camp_Hill=' + Camp_Hill.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-77.20339966,40.20677948),"
Carlisle Area High School
623 W Penn St
Carlisle, PA 17013

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carlisle Area High School",'Carlisle=' + Carlisle.length); Camp_Hill[Camp_Hill.length] = createMarker(new GPoint(-76.89994049,40.23128128),"
Cedar Cliff High School
Carlisle Warwick Roads
Camp Hill, PA 17011

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cedar Cliff High School",'Camp_Hill=' + Camp_Hill.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-76.87516022,40.25551987),"
Commonwealth Connections Academy
5010 Trindle Rd Suite 200
Mechanicsburg, PA 17050

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Commonwealth Connections Academy",'Mechanicsburg=' + Mechanicsburg.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-77.20339966,40.20677948),"
Crestview Elementary School
623 W Penn St
Carlisle, PA 17013

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Crestview Elementary School",'Carlisle=' + Carlisle.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-77.06110382,40.23792648),"
Cumberland Valley High School
6746 Carlisle Pike
Mechanicsburg, PA 17050

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cumberland Valley High School",'Mechanicsburg=' + Mechanicsburg.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-77.03915405,40.25778961),"
Cumberland-perry Avts
110 Old Willow Mill Rd
Mechanicsburg, PA 17050

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cumberland-perry Avts",'Mechanicsburg=' + Mechanicsburg.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-77.06110382,40.23792648),"
Eagle View Middle School
6746 Carlisle Pike
Mechanicsburg, PA 17050

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Eagle View Middle School",'Mechanicsburg=' + Mechanicsburg.length); Enola[Enola.length] = createMarker(new GPoint(-76.94049072,40.30118942),"
East Pennsboro Area Middle School
529 N Enola Dr
Enola, PA 17025

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("East Pennsboro Area Middle School",'Enola=' + Enola.length); Enola[Enola.length] = createMarker(new GPoint(-76.94033051,40.29544830),"
East Pennsboro Area Senior High School
425 W Shady Ln
Enola, PA 17025

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Pennsboro Area Senior High School",'Enola=' + Enola.length); Enola[Enola.length] = createMarker(new GPoint(-76.94441986,40.30033112),"
East Pennsboro Elementary School
840 Panther Pkwy
Enola, PA 17025

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Pennsboro Elementary School",'Enola=' + Enola.length); Camp_Hill[Camp_Hill.length] = createMarker(new GPoint(-76.92253113,40.24803162),"
Eisenhower Elementary School
340 N 21st St
Camp Hill, PA 17011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eisenhower Elementary School",'Camp_Hill=' + Camp_Hill.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-76.99644470,40.21089554),"
Filbert Street Elementary School
100 E Elmwood Avenue
Mechanicsburg, PA 17055

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Filbert Street Elementary School",'Mechanicsburg=' + Mechanicsburg.length); Newville[Newville.length] = createMarker(new GPoint(-77.35973358,40.24911499),"
Frankford Elementary School
3967 Enola Rd
Newville, PA 17241

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Frankford Elementary School",'Newville=' + Newville.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-76.98219299,40.25139236),"
Good Hope Middle School
451 Skyport Rd
Mechanicsburg, PA 17050

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Good Hope Middle School",'Mechanicsburg=' + Mechanicsburg.length); Shippensburg[Shippensburg.length] = createMarker(new GPoint(-77.52056885,40.05057907),"
Grace B Luhrs Univ Elementary School
1871 Old Main Dr
Shippensburg, PA 17257

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Grace B Luhrs Univ Elementary School",'Shippensburg=' + Shippensburg.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-77.05297852,40.26860428),"
Green Ridge Elementary School
1 Green Ridge Rd
Mechanicsburg, PA 17050

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Green Ridge Elementary School",'Mechanicsburg=' + Mechanicsburg.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-77.20339966,40.20677948),"
Hamilton Elementary School
623 W Penn St
Carlisle, PA 17013

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hamilton Elementary School",'Carlisle=' + Carlisle.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-76.98268127,40.25133514),"
Hampden Elementary School
441 Skyport Rd
Mechanicsburg, PA 17050

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hampden Elementary School",'Mechanicsburg=' + Mechanicsburg.length); Camp_Hill[Camp_Hill.length] = createMarker(new GPoint(-76.89767456,40.23096466),"
Highland Elementary School
1325 Carlisle Rd
Camp Hill, PA 17011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Highland Elementary School",'Camp_Hill=' + Camp_Hill.length); New_Cumberland[New_Cumberland.length] = createMarker(new GPoint(-76.87422943,40.22750854),"
Hillside Elementary School
516 7th St
New Cumberland, PA 17070

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hillside Elementary School",'New_Cumberland=' + New_Cumberland.length); Camp_Hill[Camp_Hill.length] = createMarker(new GPoint(-76.92472076,40.23541641),"
Hoover Elementary School
420 S 24th St
Camp Hill, PA 17011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hoover Elementary School",'Camp_Hill=' + Camp_Hill.length); Boiling_Springs[Boiling_Springs.length] = createMarker(new GPoint(-77.13197327,40.15198517),"
Iron Forge Educnl Center
4 Forge Rd
Boiling Springs, PA 17007

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Iron Forge Educnl Center",'Boiling_Springs=' + Boiling_Springs.length); Shippensburg[Shippensburg.length] = createMarker(new GPoint(-77.50404358,40.05279922),"
James Burd Elementary School
600 Brad St
Shippensburg, PA 17257

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("James Burd Elementary School",'Shippensburg=' + Shippensburg.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-77.20339966,40.20677948),"
Lamberton Middle School
623 W Penn St
Carlisle, PA 17013

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lamberton Middle School",'Carlisle=' + Carlisle.length); Lemoyne[Lemoyne.length] = createMarker(new GPoint(-76.90014648,40.24466705),"
Lemoyne Middle School
701 Market St
Lemoyne, PA 17043

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lemoyne Middle School",'Lemoyne=' + Lemoyne.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-77.20339966,40.20677948),"
Letort Elementary School
623 W Penn St
Carlisle, PA 17013

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Letort Elementary School",'Carlisle=' + Carlisle.length); Camp_Hill[Camp_Hill.length] = createMarker(new GPoint(-76.94644928,40.21943665),"
Lower Allen Elementary School
4100 Old Gettysburg Road
Camp Hill, PA 17011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lower Allen Elementary School",'Camp_Hill=' + Camp_Hill.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-77.01490784,40.20502472),"
Mechanicsburg Area Senior High School
500 S Broad St
Mechanicsburg, PA 17055

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mechanicsburg Area Senior High School",'Mechanicsburg=' + Mechanicsburg.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-76.99247742,40.18339920),"
Mechanicsburg Middle School
1750 South Market Street
Mechanicsburg, PA 17055

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mechanicsburg Middle School",'Mechanicsburg=' + Mechanicsburg.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-77.13969421,40.25696182),"
Middlesex Elementary School
250 N Middlesex Rd
Carlisle, PA 17013

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Middlesex Elementary School",'Carlisle=' + Carlisle.length); Newville[Newville.length] = createMarker(new GPoint(-77.47129059,40.21262741),"
Mifflin Elementary School
399 Roxbury Rd
Newville, PA 17241

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mifflin Elementary School",'Newville=' + Newville.length); Boiling_Springs[Boiling_Springs.length] = createMarker(new GPoint(-77.08085632,40.16636658),"
Monroe Elementary School
1240 Boiling Springs Rd
Boiling Springs, PA 17007

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Monroe Elementary School",'Boiling_Springs=' + Boiling_Springs.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-77.20339966,40.20677948),"
Mooreland Elementary School
623 W Penn St
Carlisle, PA 17013

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mooreland Elementary School",'Carlisle=' + Carlisle.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-77.20339966,40.20677948),"
Mt Holly Springs Elementary School
623 West Penn Street
Carlisle, PA 17013

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mt Holly Springs Elementary School",'Carlisle=' + Carlisle.length); New_Cumberland[New_Cumberland.length] = createMarker(new GPoint(-76.87142944,40.23049545),"
New Cumberland Middle School
331 8th St
New Cumberland, PA 17070

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("New Cumberland Middle School",'New_Cumberland=' + New_Cumberland.length); Newville[Newville.length] = createMarker(new GPoint(-77.40217590,40.17486191),"
Newville Elementary School
100 Steelstown Rd
Newville, PA 17241

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Newville Elementary School",'Newville=' + Newville.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-77.20339966,40.20677948),"
North Dickinson Elementary School
623 W Penn St
Carlisle, PA 17013

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Dickinson Elementary School",'Carlisle=' + Carlisle.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-77.00560760,40.21898651),"
Northside Elementary School
411 N Walnut St
Mechanicsburg, PA 17055

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northside Elementary School",'Mechanicsburg=' + Mechanicsburg.length); Newville[Newville.length] = createMarker(new GPoint(-77.38481140,40.15822983),"
Oak Flat Elementary School
334 Centerville Rd
Newville, PA 17241

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak Flat Elementary School",'Newville=' + Newville.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-77.29320526,40.19832611),"
Plainfield Elementary School
7 Springview Rd
Carlisle, PA 17013

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Plainfield Elementary School",'Carlisle=' + Carlisle.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-76.95146942,40.20144272),"
Rossmoyne Elementary School
1225 Rossmoyne Rd
Mechanicsburg, PA 17055

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rossmoyne Elementary School",'Mechanicsburg=' + Mechanicsburg.length); Camp_Hill[Camp_Hill.length] = createMarker(new GPoint(-76.92969513,40.24162292),"
Schaeffer Elementary School
2900 Walnut St
Camp Hill, PA 17011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Schaeffer Elementary School",'Camp_Hill=' + Camp_Hill.length); Enola[Enola.length] = createMarker(new GPoint(-76.98623657,40.28489685),"
Shaull Elementary School
1920 Good Hope Rd
Enola, PA 17025

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shaull Elementary School",'Enola=' + Enola.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-76.99323273,40.18035889),"
Shepherdstown Elementary School
1849 S York St
Mechanicsburg, PA 17055

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shepherdstown Elementary School",'Mechanicsburg=' + Mechanicsburg.length); Shippensburg[Shippensburg.length] = createMarker(new GPoint(-77.54339600,40.04061890),"
Shippensburg Area Senior High School
201 Eberly Drive
Shippensburg, PA 17257

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shippensburg Area Senior High School",'Shippensburg=' + Shippensburg.length); Shiremanstown[Shiremanstown.length] = createMarker(new GPoint(-76.95323181,40.22286606),"
Shiremanstown Elementary School
41 S Locust St
Shiremanstown, PA 17011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shiremanstown Elementary School",'Shiremanstown=' + Shiremanstown.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-77.06110382,40.23792648),"
Silver Spring Elementary School
6746 Carlisle Pike
Mechanicsburg, PA 17050

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Silver Spring Elementary School",'Mechanicsburg=' + Mechanicsburg.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-76.97200775,40.23434448),"
Sporting Hill Elementary School
210 S Sporting Hill Rd
Mechanicsburg, PA 17050

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sporting Hill Elementary School",'Mechanicsburg=' + Mechanicsburg.length); Mechanicsburg[Mechanicsburg.length] = createMarker(new GPoint(-76.99213409,40.18230057),"
Upper Allen Elementary School
1790 S Market St
Mechanicsburg, PA 17055

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Upper Allen Elementary School",'Mechanicsburg=' + Mechanicsburg.length); Mount_Holly_Springs[Mount_Holly_Springs.length] = createMarker(new GPoint(-77.19203949,40.12960434),"
W.g. Rice Elementary School
805 Holly Pike
Mount Holly Springs, PA 17065

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("W.g. Rice Elementary School",'Mount_Holly_Springs=' + Mount_Holly_Springs.length); Lemoyne[Lemoyne.length] = createMarker(new GPoint(-76.89844513,40.24628448),"
Washington Heights Elementary School
531 Walnut St
Lemoyne, PA 17043

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Heights Elementary School",'Lemoyne=' + Lemoyne.length); Camp_Hill[Camp_Hill.length] = createMarker(new GPoint(-76.92661285,40.27098083),"
West Creek Hills Elementary School
400 Erford Rd
Camp Hill, PA 17011

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Creek Hills Elementary School",'Camp_Hill=' + Camp_Hill.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-77.20339966,40.20677948),"
Wilson Middle School
623 W Penn St
Carlisle, PA 17013

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Wilson Middle School",'Carlisle=' + Carlisle.length); Boiling_Springs[Boiling_Springs.length] = createMarker(new GPoint(-77.13197327,40.15198517),"
Yellow Breeches Middle School
4 Forge Rd
Boiling Springs, PA 17007

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Yellow Breeches Middle School",'Boiling_Springs=' + Boiling_Springs.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(Boiling_Springs); map.removeOverlays(Camp_Hill); map.removeOverlays(Carlisle); map.removeOverlays(Enola); map.removeOverlays(Lemoyne); map.removeOverlays(Mechanicsburg); map.removeOverlays(Mount_Holly_Springs); map.removeOverlays(New_Cumberland); map.removeOverlays(Newville); map.removeOverlays(Shippensburg); map.removeOverlays(Shiremanstown); 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(Camp_Hill);map.removeOverlays(Boiling_Springs); map.removeOverlays(Camp_Hill); map.removeOverlays(Carlisle); map.removeOverlays(Enola); map.removeOverlays(Lemoyne); map.removeOverlays(Mechanicsburg); map.removeOverlays(Mount_Holly_Springs); map.removeOverlays(New_Cumberland); map.removeOverlays(Newville); map.removeOverlays(Shippensburg); map.removeOverlays(Shiremanstown); map.addOverlays(Boiling_Springs); centerByArray(Boiling_Springs, false, false); cntMarker += Boiling_Springs.length; map.addOverlays(Camp_Hill); centerByArray(Camp_Hill, false, false); cntMarker += Camp_Hill.length; map.addOverlays(Carlisle); centerByArray(Carlisle, false, false); cntMarker += Carlisle.length; map.addOverlays(Enola); centerByArray(Enola, false, false); cntMarker += Enola.length; map.addOverlays(Lemoyne); centerByArray(Lemoyne, false, false); cntMarker += Lemoyne.length; map.addOverlays(Mechanicsburg); centerByArray(Mechanicsburg, false, false); cntMarker += Mechanicsburg.length; map.addOverlays(Mount_Holly_Springs); centerByArray(Mount_Holly_Springs, false, false); cntMarker += Mount_Holly_Springs.length; map.addOverlays(New_Cumberland); centerByArray(New_Cumberland, false, false); cntMarker += New_Cumberland.length; map.addOverlays(Newville); centerByArray(Newville, false, false); cntMarker += Newville.length; map.addOverlays(Shippensburg); centerByArray(Shippensburg, false, false); cntMarker += Shippensburg.length; map.addOverlays(Shiremanstown); centerByArray(Shiremanstown, false, false); cntMarker += Shiremanstown.length; centerByArray(Camp_Hill,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'); } }