function addMarkers() { mySelect = document.getElementById('selection'); Stroudsburg = [];Cresco = [];Brodheadsville = [];Tobyhanna = [];East_Stroudsburg = [];Kunkletown = [];Sciota = [];Bartonsville = [];Tannersville = [];Swiftwater = [];Pocono_Summit = [];Kresgeville = [];Pocono_Pines = [];mySelect.options[mySelect.options.length] = new Option("Bartonsville schools",'all=Bartonsville'); mySelect.options[mySelect.options.length] = new Option("Brodheadsville schools",'all=Brodheadsville'); mySelect.options[mySelect.options.length] = new Option("Cresco schools",'all=Cresco'); mySelect.options[mySelect.options.length] = new Option("East Stroudsburg schools",'all=East_Stroudsburg'); mySelect.options[mySelect.options.length] = new Option("Kresgeville schools",'all=Kresgeville'); mySelect.options[mySelect.options.length] = new Option("Kunkletown schools",'all=Kunkletown'); mySelect.options[mySelect.options.length] = new Option("Pocono Pines schools",'all=Pocono_Pines'); mySelect.options[mySelect.options.length] = new Option("Pocono Summit schools",'all=Pocono_Summit'); mySelect.options[mySelect.options.length] = new Option("Sciota schools",'all=Sciota'); mySelect.options[mySelect.options.length] = new Option("Stroudsburg schools",'all=Stroudsburg'); mySelect.options[mySelect.options.length] = new Option("Swiftwater schools",'all=Swiftwater'); mySelect.options[mySelect.options.length] = new Option("Tannersville schools",'all=Tannersville'); mySelect.options[mySelect.options.length] = new Option("Tobyhanna schools",'all=Tobyhanna'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Stroudsburg[Stroudsburg.length] = createMarker(new GPoint(-75.21417999,40.98993683),"
Arlington Heights Elementary School
1100 N 9th St
Stroudsburg, PA 18360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arlington Heights Elementary School",'Stroudsburg=' + Stroudsburg.length); Stroudsburg[Stroudsburg.length] = createMarker(new GPoint(-75.20410156,40.98313522),"
B F Morey Elementary School
1044 W Main St
Stroudsburg, PA 18360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("B F Morey Elementary School",'Stroudsburg=' + Stroudsburg.length); Cresco[Cresco.length] = createMarker(new GPoint(-75.28012085,41.15420151),"
Barrett El Center
Rr 2 Box 2402
Cresco, PA 18326

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Barrett El Center",'Cresco=' + Cresco.length); Brodheadsville[Brodheadsville.length] = createMarker(new GPoint(-75.39376831,40.92407990),"
Chestnuthill Elementary School
Route 115
Brodheadsville, PA 18322

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chestnuthill Elementary School",'Brodheadsville=' + Brodheadsville.length); Tobyhanna[Tobyhanna.length] = createMarker(new GPoint(-75.38224792,41.15542221),"
Clear Run El Center
3700 Memorial Blvd
Tobyhanna, PA 18466

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clear Run El Center",'Tobyhanna=' + Tobyhanna.length); Tobyhanna[Tobyhanna.length] = createMarker(new GPoint(-75.38086700,41.15404510),"
Clear Run Intermediate School
3600 Memorial Blvd
Tobyhanna, PA 18466

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Clear Run Intermediate School",'Tobyhanna=' + Tobyhanna.length); Stroudsburg[Stroudsburg.length] = createMarker(new GPoint(-75.20421600,41.00848770),"
Clearview Elementary School
2000 N 5th St
Stroudsburg, PA 18360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clearview Elementary School",'Stroudsburg=' + Stroudsburg.length); Tobyhanna[Tobyhanna.length] = createMarker(new GPoint(-75.42333984,41.17569733),"
Coolbaugh El Center
5800 Memorial Blvd
Tobyhanna, PA 18466

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Coolbaugh El Center",'Tobyhanna=' + Tobyhanna.length); Tobyhanna[Tobyhanna.length] = createMarker(new GPoint(-75.42390442,41.18001556),"
Coolbaugh Learning Center
194 Main Street
Tobyhanna, PA 18466

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Coolbaugh Learning Center",'Tobyhanna=' + Tobyhanna.length); East_Stroudsburg[East_Stroudsburg.length] = createMarker(new GPoint(-75.14880371,41.05770111),"
East Stroudsburg Elementary School
2002 Milford Road
East Stroudsburg, PA 18301

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("East Stroudsburg Elementary School",'East_Stroudsburg=' + East_Stroudsburg.length); East_Stroudsburg[East_Stroudsburg.length] = createMarker(new GPoint(-75.18455505,41.00740814),"
East Stroudsburg Shs South High School
279 N Courtland St
East Stroudsburg, PA 18301

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Stroudsburg Shs South High School",'East_Stroudsburg=' + East_Stroudsburg.length); Kunkletown[Kunkletown.length] = createMarker(new GPoint(-75.47070312,40.85940170),"
Eldred Elementary School
Rr 2 Box 11
Kunkletown, PA 18058

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eldred Elementary School",'Kunkletown=' + Kunkletown.length); Sciota[Sciota.length] = createMarker(new GPoint(-75.31690979,40.92942810),"
Hamilton Township Elementary School
Hcr Box 218
Sciota, PA 18354

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hamilton Township Elementary School",'Sciota=' + Sciota.length); East_Stroudsburg[East_Stroudsburg.length] = createMarker(new GPoint(-75.17831421,41.00451279),"
J M Hill Elementary School
151 E Broad St
East Stroudsburg, PA 18301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("J M Hill Elementary School",'East_Stroudsburg=' + East_Stroudsburg.length); East_Stroudsburg[East_Stroudsburg.length] = createMarker(new GPoint(-75.17554474,41.02206039),"
J T Lambert Intermediate School
2000 Milford Rd
East Stroudsburg, PA 18301

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("J T Lambert Intermediate School",'East_Stroudsburg=' + East_Stroudsburg.length); East_Stroudsburg[East_Stroudsburg.length] = createMarker(new GPoint(-75.07890320,41.06040573),"
Middle Smithfield Elementary School
5180 Milford Rd
East Stroudsburg, PA 18301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Middle Smithfield Elementary School",'East_Stroudsburg=' + East_Stroudsburg.length); Bartonsville[Bartonsville.length] = createMarker(new GPoint(-75.28949738,41.01419830),"
Monroe Career & Tech Inst
Po Box 66
Bartonsville, PA 18321

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Monroe Career & Tech Inst",'Bartonsville=' + Bartonsville.length); Kunkletown[Kunkletown.length] = createMarker(new GPoint(-75.45629883,40.89450073),"
Pleasant Valley Elementary School
Rr 3 Box 505
Kunkletown, PA 18058

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Valley Elementary School",'Kunkletown=' + Kunkletown.length); Brodheadsville[Brodheadsville.length] = createMarker(new GPoint(-75.39376831,40.92407990),"
Pleasant Valley High School
Route 209
Brodheadsville, PA 18322

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pleasant Valley High School",'Brodheadsville=' + Brodheadsville.length); Kunkletown[Kunkletown.length] = createMarker(new GPoint(-75.50240326,40.91519928),"
Pleasant Valley Intrmd School
Rr 3 Box 498
Kunkletown, PA 18058

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pleasant Valley Intrmd School",'Kunkletown=' + Kunkletown.length); Brodheadsville[Brodheadsville.length] = createMarker(new GPoint(-75.39376831,40.92407990),"
Pleasant Valley Middle School
Route 115
Brodheadsville, PA 18322

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pleasant Valley Middle School",'Brodheadsville=' + Brodheadsville.length); Tannersville[Tannersville.length] = createMarker(new GPoint(-75.31944275,41.02980042),"
Pocono El Center
Warner Road
Tannersville, PA 18372

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pocono El Center",'Tannersville=' + Tannersville.length); Cresco[Cresco.length] = createMarker(new GPoint(-75.28012085,41.15420151),"
Pocono Mountain Academy
Rd2 Box 64
Cresco, PA 18326

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pocono Mountain Academy",'Cresco=' + Cresco.length); Tobyhanna[Tobyhanna.length] = createMarker(new GPoint(-75.36895752,41.19792175),"
Pocono Mountain Charter School
16 Carriage Square
Tobyhanna, PA 18466

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pocono Mountain Charter School",'Tobyhanna=' + Tobyhanna.length); Swiftwater[Swiftwater.length] = createMarker(new GPoint(-75.35859680,41.08639908),"
Pocono Mountain East High School/academ
Po Box 200
Swiftwater, PA 18370

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pocono Mountain East High School/academ",'Swiftwater=' + Swiftwater.length); Pocono_Summit[Pocono_Summit.length] = createMarker(new GPoint(-75.41000366,41.09870148),"
Pocono Mountain West High School
Hc 89 Box 2002
Pocono Summit, PA 18346

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pocono Mountain West High School",'Pocono_Summit=' + Pocono_Summit.length); Tobyhanna[Tobyhanna.length] = createMarker(new GPoint(-75.41818400,41.17700800),"
Pocono School Of Excellence Charter School
Route 196
Tobyhanna, PA 18466

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pocono School Of Excellence Charter School",'Tobyhanna=' + Tobyhanna.length); Kresgeville[Kresgeville.length] = createMarker(new GPoint(-75.50334167,40.89688873),"
Polk Elementary School
Route 209
Kresgeville, PA 18333

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Polk Elementary School",'Kresgeville=' + Kresgeville.length); East_Stroudsburg[East_Stroudsburg.length] = createMarker(new GPoint(-75.11151886,41.07456207),"
Resica Elementary School
1 Gravel Ridge Rd
East Stroudsburg, PA 18301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Resica Elementary School",'East_Stroudsburg=' + East_Stroudsburg.length); East_Stroudsburg[East_Stroudsburg.length] = createMarker(new GPoint(-75.17806400,40.99455000),"
Smithfield Elementary School
Rr 5 Box 5210
East Stroudsburg, PA 18301

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Smithfield Elementary School",'East_Stroudsburg=' + East_Stroudsburg.length); Stroudsburg[Stroudsburg.length] = createMarker(new GPoint(-75.20558167,40.98293686),"
Stroudsburg High School
1100 W Main St
Stroudsburg, PA 18360

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Stroudsburg High School",'Stroudsburg=' + Stroudsburg.length); Stroudsburg[Stroudsburg.length] = createMarker(new GPoint(-75.23159790,41.00078201),"
Stroudsburg Intrmd Elementary School
2000 Chipperfield Drive
Stroudsburg, PA 18360

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Stroudsburg Intrmd Elementary School",'Stroudsburg=' + Stroudsburg.length); Stroudsburg[Stroudsburg.length] = createMarker(new GPoint(-75.21813965,40.99463654),"
Stroudsburg Jhs/ms Middle School
1198 Chipperfield Drive
Stroudsburg, PA 18360

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Stroudsburg Jhs/ms Middle School",'Stroudsburg=' + Stroudsburg.length); Stroudsburg[Stroudsburg.length] = createMarker(new GPoint(-75.24450400,40.99584400),"
Stroudsburg MiddleSchool
200 Pocono Commons
Stroudsburg, PA 18360

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Stroudsburg MiddleSchool",'Stroudsburg=' + Stroudsburg.length); Swiftwater[Swiftwater.length] = createMarker(new GPoint(-75.35859680,41.08639908),"
Swiftwater El Center
Po Box 200
Swiftwater, PA 18370

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Swiftwater El Center",'Swiftwater=' + Swiftwater.length); Swiftwater[Swiftwater.length] = createMarker(new GPoint(-75.35859680,41.08639908),"
Swiftwater Interm School
Po Box 200
Swiftwater, PA 18370

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Swiftwater Interm School",'Swiftwater=' + Swiftwater.length); Tannersville[Tannersville.length] = createMarker(new GPoint(-75.30870056,41.04433823),"
Tannersville Learning Center
Route 611
Tannersville, PA 18372

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tannersville Learning Center",'Tannersville=' + Tannersville.length); Pocono_Pines[Pocono_Pines.length] = createMarker(new GPoint(-75.46219635,41.11069870),"
Tobyhanna El Center
Hc 89 Box 36
Pocono Pines, PA 18350

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tobyhanna El Center",'Pocono_Pines=' + Pocono_Pines.length); Stroudsburg[Stroudsburg.length] = createMarker(new GPoint(-75.19343567,40.98899460),"
W H Ramsey Elementary School
528 Thomas St
Stroudsburg, PA 18360

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("W H Ramsey Elementary School",'Stroudsburg=' + Stroudsburg.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(Bartonsville); map.removeOverlays(Brodheadsville); map.removeOverlays(Cresco); map.removeOverlays(East_Stroudsburg); map.removeOverlays(Kresgeville); map.removeOverlays(Kunkletown); map.removeOverlays(Pocono_Pines); map.removeOverlays(Pocono_Summit); map.removeOverlays(Sciota); map.removeOverlays(Stroudsburg); map.removeOverlays(Swiftwater); map.removeOverlays(Tannersville); map.removeOverlays(Tobyhanna); 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(Stroudsburg);map.removeOverlays(Bartonsville); map.removeOverlays(Brodheadsville); map.removeOverlays(Cresco); map.removeOverlays(East_Stroudsburg); map.removeOverlays(Kresgeville); map.removeOverlays(Kunkletown); map.removeOverlays(Pocono_Pines); map.removeOverlays(Pocono_Summit); map.removeOverlays(Sciota); map.removeOverlays(Stroudsburg); map.removeOverlays(Swiftwater); map.removeOverlays(Tannersville); map.removeOverlays(Tobyhanna); map.addOverlays(Bartonsville); centerByArray(Bartonsville, false, false); cntMarker += Bartonsville.length; map.addOverlays(Brodheadsville); centerByArray(Brodheadsville, false, false); cntMarker += Brodheadsville.length; map.addOverlays(Cresco); centerByArray(Cresco, false, false); cntMarker += Cresco.length; map.addOverlays(East_Stroudsburg); centerByArray(East_Stroudsburg, false, false); cntMarker += East_Stroudsburg.length; map.addOverlays(Kresgeville); centerByArray(Kresgeville, false, false); cntMarker += Kresgeville.length; map.addOverlays(Kunkletown); centerByArray(Kunkletown, false, false); cntMarker += Kunkletown.length; map.addOverlays(Pocono_Pines); centerByArray(Pocono_Pines, false, false); cntMarker += Pocono_Pines.length; map.addOverlays(Pocono_Summit); centerByArray(Pocono_Summit, false, false); cntMarker += Pocono_Summit.length; map.addOverlays(Sciota); centerByArray(Sciota, false, false); cntMarker += Sciota.length; map.addOverlays(Stroudsburg); centerByArray(Stroudsburg, false, false); cntMarker += Stroudsburg.length; map.addOverlays(Swiftwater); centerByArray(Swiftwater, false, false); cntMarker += Swiftwater.length; map.addOverlays(Tannersville); centerByArray(Tannersville, false, false); cntMarker += Tannersville.length; map.addOverlays(Tobyhanna); centerByArray(Tobyhanna, false, false); cntMarker += Tobyhanna.length; centerByArray(Stroudsburg,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'); } }