function addMarkers(){ mySelect = document.getElementById('selection'); Clarks_Green = [];Scranton = [];Moscow = [];Waverly = [];Olyphant = [];Jessup = [];Carbondale = [];Dunmore = [];Clarks_Summit = [];Dickson_City = [];Old_Forge = [];Blakely = [];mySelect.options[mySelect.options.length] = new Option("Blakely schools",'all=Blakely'); mySelect.options[mySelect.options.length] = new Option("Carbondale schools",'all=Carbondale'); mySelect.options[mySelect.options.length] = new Option("Clarks Green schools",'all=Clarks_Green'); mySelect.options[mySelect.options.length] = new Option("Clarks Summit schools",'all=Clarks_Summit'); mySelect.options[mySelect.options.length] = new Option("Dickson City schools",'all=Dickson_City'); mySelect.options[mySelect.options.length] = new Option("Dunmore schools",'all=Dunmore'); mySelect.options[mySelect.options.length] = new Option("Jessup schools",'all=Jessup'); mySelect.options[mySelect.options.length] = new Option("Moscow schools",'all=Moscow'); mySelect.options[mySelect.options.length] = new Option("Old Forge schools",'all=Old_Forge'); mySelect.options[mySelect.options.length] = new Option("Olyphant schools",'all=Olyphant'); mySelect.options[mySelect.options.length] = new Option("Scranton schools",'all=Scranton'); mySelect.options[mySelect.options.length] = new Option("Waverly schools",'all=Waverly'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Clarks_Green[Clarks_Green.length] = createMarker(new GPoint(-75.69514200,41.49715000),"
Abington Christian Academy
204 S Abington Road
Clarks Green, PA 18411
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Abington Christian Academy",'Clarks_Green=' + Clarks_Green.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.68471100,41.41416100),"
All Saints Academy
1425 Jackson Street
Scranton, PA 18504
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("All Saints Academy",'Scranton=' + Scranton.length); Moscow[Moscow.length] = createMarker(new GPoint(-75.51990000,41.34320000),"
Bethel Christian Academy
Rr7 Po Box 7368
Moscow, PA 18444
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethel Christian Academy",'Moscow=' + Moscow.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.64948700,41.43172700),"
The Children's Cornerstone
1759 Sanderson Avenue
Scranton, PA 18509
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Children's Cornerstone",'Scranton=' + Scranton.length); Waverly[Waverly.length] = createMarker(new GPoint(-75.70580000,41.52630000),"
Childrens House In Abingtons
Clinton Street, P O Box 654
Waverly, PA 18471
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Childrens House In Abingtons",'Waverly=' + Waverly.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.68410000,41.37310000),"
Depaul School
475 Morgan High Way Po Box 1103
Scranton, PA 18501
Co-ed school, 2-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Depaul School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.64971000,41.38316100),"
Friendship House
1615 E Elm Street
Scranton, PA 18505
Co-ed school, K-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Friendship House",'Scranton=' + Scranton.length); Olyphant[Olyphant.length] = createMarker(new GPoint(-75.60544700,41.47085100),"
Geneva School
133 River Street
Olyphant, PA 18447
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Geneva School",'Olyphant=' + Olyphant.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.65770300,41.44042600),"
Holy Rosary School
312 William Street
Scranton, PA 18508
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Rosary School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.65538700,41.41144400),"
The Jefferson Schoolhouse
630 Jefferson Avenue
Scranton, PA 18510
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Jefferson Schoolhouse",'Scranton=' + Scranton.length); Jessup[Jessup.length] = createMarker(new GPoint(-75.56699600,41.47460800),"
Lasalle Academy
309 1st Avenue
Jessup, PA 18434
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lasalle Academy",'Jessup=' + Jessup.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.66666300,41.44727800),"
Little People Day Care School
910 Oak Street
Scranton, PA 18508
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little People Day Care School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.68030300,41.45621100),"
Magic Years
511 Morgan Hwy
Scranton, PA 18508
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Magic Years",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.64560000,41.40730000),"
Magic Years Moses Taylor Hospi
633 35 Quincy Ave
Scranton, PA 18510
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Magic Years Moses Taylor Hospi",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.66417900,41.40135500),"
Marian Catholic Primary Campus
430 River St
Scranton, PA 18505
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marian Catholic Primary Campus",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.65883800,41.40086000),"
Marian Catholic School
638 Hemlock Street
Scranton, PA 18505
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marian Catholic School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.64730000,41.42820000),"
Marywood Early Childhood Center
2300 Adams Avenue Marywood University
Scranton, PA 18509
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marywood Early Childhood Center",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.65980200,41.40735200),"
Montessori Kindergarten
712 Linden Street
Scranton, PA 18510
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Kindergarten",'Scranton=' + Scranton.length); Clarks_Green[Clarks_Green.length] = createMarker(new GPoint(-75.69769400,41.50516000),"
Our Lady Of Peace School
410 N Abington Rd
Clarks Green, PA 18411
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Peace School",'Clarks_Green=' + Clarks_Green.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.65458600,41.43842000),"
Revival Baptist Christian School
2020 North Main Avenue
Scranton, PA 18508
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Revival Baptist Christian School",'Scranton=' + Scranton.length); Carbondale[Carbondale.length] = createMarker(new GPoint(-75.50393200,41.57974300),"
Sacred Heart Elementary School
27 Farview Street 33
Carbondale, PA 18407
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Elementary School",'Carbondale=' + Carbondale.length); Carbondale[Carbondale.length] = createMarker(new GPoint(-75.50160000,41.57070000),"
Sacred Heart Intermediate
27 Farview Street
Carbondale, PA 18407
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Intermediate",'Carbondale=' + Carbondale.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.68992800,41.40233300),"
St. Ann Basilica Parish School
1228 St Anns Street
Scranton, PA 18504
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Ann Basilica Parish School",'Scranton=' + Scranton.length); Dunmore[Dunmore.length] = createMarker(new GPoint(-75.62246300,41.41766300),"
St. Anthony Elementary School
208 Smith Street
Dunmore, PA 18512
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Anthony Elementary School",'Dunmore=' + Dunmore.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.63895900,41.43328800),"
St. Clare School
2215 N Washington Ave
Scranton, PA 18509
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Clare School",'Scranton=' + Scranton.length); Clarks_Summit[Clarks_Summit.length] = createMarker(new GPoint(-75.69754500,41.50432800),"
St. Gregory's E.c.c.
330 N. Abington Road
Clarks Summit, PA 18411
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Gregory's E.c.c.",'Clarks_Summit=' + Clarks_Summit.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.64857100,41.42637600),"
St. Paul S School
1527 Penn Avenue
Scranton, PA 18509
Co-ed school, 4-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Paul S School",'Scranton=' + Scranton.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.65437200,41.40891400),"
Scranton Hebrew Day School
540 Monroe Avenue
Scranton, PA 18510
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Scranton Hebrew Day School",'Scranton=' + Scranton.length); Clarks_Green[Clarks_Green.length] = createMarker(new GPoint(-75.69754300,41.50439900),"
St Gregory's Ecc
330 N Abington Road
Clarks Green, PA 18411
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Gregory's Ecc",'Clarks_Green=' + Clarks_Green.length); Dunmore[Dunmore.length] = createMarker(new GPoint(-75.62917500,41.41745300),"
St Mary Of Mt. Carmel School
325 Chestnut Street
Dunmore, PA 18512
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mary Of Mt. Carmel School",'Dunmore=' + Dunmore.length); Dickson_City[Dickson_City.length] = createMarker(new GPoint(-75.61921100,41.46729900),"
St Mary Visitation School
1090 Carmalt Street
Dickson City, PA 18519
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mary Visitation School",'Dickson_City=' + Dickson_City.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.66957800,41.39370400),"
St Stanislaus Elementary School
529 E Locust Street
Scranton, PA 18505
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Stanislaus Elementary School",'Scranton=' + Scranton.length); Clarks_Summit[Clarks_Summit.length] = createMarker(new GPoint(-75.72076800,41.49327600),"
Summit Christian Academy – Elementary Campus
232 Noble Road
Clarks Summit, PA 18411
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Summit Christian Academy – Elementary Campus",'Clarks_Summit=' + Clarks_Summit.length); Old_Forge[Old_Forge.length] = createMarker(new GPoint(-75.74523500,41.35965500),"
Triboro Christian Academy
100 S Main Street
Old Forge, PA 18518
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Triboro Christian Academy",'Old_Forge=' + Old_Forge.length); Scranton[Scranton.length] = createMarker(new GPoint(-75.65645500,41.43891000),"
University Of Scranton Campus
134 School St.
Scranton, PA 18508
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("University Of Scranton Campus",'Scranton=' + Scranton.length); Blakely[Blakely.length] = createMarker(new GPoint(-75.60480000,41.47540000),"
Wee Care Jc & Jm Inc
Rt 6 Scranton Carbondale Hwy
Blakely, PA 18447
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wee Care Jc & Jm Inc",'Blakely=' + Blakely.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(Blakely); map.removeOverlays(Carbondale); map.removeOverlays(Clarks_Green); map.removeOverlays(Clarks_Summit); map.removeOverlays(Dickson_City); map.removeOverlays(Dunmore); map.removeOverlays(Jessup); map.removeOverlays(Moscow); map.removeOverlays(Old_Forge); map.removeOverlays(Olyphant); map.removeOverlays(Scranton); map.removeOverlays(Waverly); 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(Clarks_Green);map.removeOverlays(Blakely); map.removeOverlays(Carbondale); map.removeOverlays(Clarks_Green); map.removeOverlays(Clarks_Summit); map.removeOverlays(Dickson_City); map.removeOverlays(Dunmore); map.removeOverlays(Jessup); map.removeOverlays(Moscow); map.removeOverlays(Old_Forge); map.removeOverlays(Olyphant); map.removeOverlays(Scranton); map.removeOverlays(Waverly); map.addOverlays(Blakely); centerByArray(Blakely, false, false); cntMarker += Blakely.length; map.addOverlays(Carbondale); centerByArray(Carbondale, false, false); cntMarker += Carbondale.length; map.addOverlays(Clarks_Green); centerByArray(Clarks_Green, false, false); cntMarker += Clarks_Green.length; map.addOverlays(Clarks_Summit); centerByArray(Clarks_Summit, false, false); cntMarker += Clarks_Summit.length; map.addOverlays(Dickson_City); centerByArray(Dickson_City, false, false); cntMarker += Dickson_City.length; map.addOverlays(Dunmore); centerByArray(Dunmore, false, false); cntMarker += Dunmore.length; map.addOverlays(Jessup); centerByArray(Jessup, false, false); cntMarker += Jessup.length; map.addOverlays(Moscow); centerByArray(Moscow, false, false); cntMarker += Moscow.length; map.addOverlays(Old_Forge); centerByArray(Old_Forge, false, false); cntMarker += Old_Forge.length; map.addOverlays(Olyphant); centerByArray(Olyphant, false, false); cntMarker += Olyphant.length; map.addOverlays(Scranton); centerByArray(Scranton, false, false); cntMarker += Scranton.length; map.addOverlays(Waverly); centerByArray(Waverly, false, false); cntMarker += Waverly.length; centerByArray(Clarks_Green,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; }