function addMarkers(){ mySelect = document.getElementById('selection'); Rochester = [];Penfield = [];Brockport = [];Webster = [];mySelect.options[mySelect.options.length] = new Option("Brockport schools",'all=Brockport'); mySelect.options[mySelect.options.length] = new Option("Penfield schools",'all=Penfield'); mySelect.options[mySelect.options.length] = new Option("Rochester schools",'all=Rochester'); mySelect.options[mySelect.options.length] = new Option("Webster schools",'all=Webster'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Rochester[Rochester.length] = createMarker(new GPoint(-77.69538900,43.16685800),"
All Saints Catholic Academy
170 Spencerport Road
Rochester, NY 14606
Co-ed school, 7-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("All Saints Catholic Academy",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.53923500,43.11862900),"
Allendale Columbia School
519 Allens Creek Road
Rochester, NY 14618
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Allendale Columbia School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.63908700,43.18596500),"
Aquinas Institute
1127 Dewey Avenue
Rochester, NY 14613
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aquinas Institute",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.59270100,43.19865300),"
Archangel School
95 Stanton Lane
Rochester, NY 14617
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Archangel School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.57732800,43.20142000),"
Bishop Hogan Catholic Academy
125 Kings Highway South
Rochester, NY 14617
Co-ed school, 7-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bishop Hogan Catholic Academy",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.57732800,43.20142000),"
Bishop Kearney High School
125 Kings Highway South
Rochester, NY 14617
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bishop Kearney High School",'Rochester=' + Rochester.length); Penfield[Penfield.length] = createMarker(new GPoint(-77.47558900,43.13329800),"
The Charles Finney School
2070 Five Mile Line Road
Penfield, NY 14526
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Charles Finney School",'Penfield=' + Penfield.length); Brockport[Brockport.length] = createMarker(new GPoint(-77.94237100,43.21425300),"
Cornerstone Christian Academy
60 Holley Street
Brockport, NY 14420
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone Christian Academy",'Brockport=' + Brockport.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.70588200,43.07674900),"
Crestwood Childrens Center
2075 Scottsville Road
Rochester, NY 14623
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crestwood Childrens Center",'Rochester=' + Rochester.length); Brockport[Brockport.length] = createMarker(new GPoint(-77.92661600,43.23265400),"
Golden Heights Christian Academy
8341 West Ridge Rd.
Brockport, NY 14420
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Golden Heights Christian Academy",'Brockport=' + Brockport.length); Webster[Webster.length] = createMarker(new GPoint(-77.50940400,43.22745900),"
Halpern Education Center
695 Bay Road
Webster, NY 14580
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Halpern Education Center",'Webster=' + Webster.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.54832700,43.11875100),"
The Harley School
1981 Clover Street
Rochester, NY 14618
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Harley School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.59459400,43.06856300),"
Henrietta Christian School
1125 Calkins Road
Rochester, NY 14623
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Henrietta Christian School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.57822900,43.13759200),"
Hillside Children Center Andrews Trahey School
1183 Monroe Avenue
Rochester, NY 14620
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hillside Children Center Andrews Trahey School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.69532300,43.14993700),"
Hope Hall School
1612 Buffalo Road
Rochester, NY 14624
Co-ed school, 2-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hope Hall School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.59336800,43.12403600),"
Mc Quaid Jesuit High School
1800 Clinton Avenue S
Rochester, NY 14618
All-boys school, 7-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mc Quaid Jesuit High School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.63153100,43.18397500),"
Nazareth Schools
1001 Lake Avenue
Rochester, NY 14613
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Nazareth Schools",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.58273200,43.07913900),"
The Norman Howard School
275 Pinnacle Road
Rochester, NY 14623
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Norman Howard School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.59810000,43.22160000),"
Northside Christian Academy
P.o. Box 67173
Rochester, NY 14617
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northside Christian Academy",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.69913200,43.16856600),"
Northstar Christian Academy
332 Spencerport Road
Rochester, NY 14606
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northstar Christian Academy",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.58840800,43.15369500),"
Ora Academy
600 East Avenue
Rochester, NY 14607
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ora Academy",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.53762400,43.14907500),"
Our Lady Of Mercy High School
1437 Blossom Road
Rochester, NY 14610
All-girls school, 7-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Mercy High School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.62918700,43.14894000),"
Rochester Seventh-day Adventist Junior Academy
309 Jefferson Avenue
Rochester, NY 14611
school, PK-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rochester Seventh-day Adventist Junior Academy",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.64634200,43.22943600),"
St. Joseph Villa School
3300 Dewey Avenue
Rochester, NY 14616
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph Villa School",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.59582200,43.07756000),"
School Of The Holy Childhood
100 Groton Parkway
Rochester, NY 14623
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("School Of The Holy Childhood",'Rochester=' + Rochester.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.54540000,43.14200000),"
Siena Catholic Academy
2617 East Avenue
Rochester, NY 14610
Co-ed school, 7-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Siena Catholic Academy",'Rochester=' + Rochester.length); Penfield[Penfield.length] = createMarker(new GPoint(-77.43632800,43.14837600),"
Southeast Christian Academy
1850 Fairport Nine Mile Pt Road
Penfield, NY 14526
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southeast Christian Academy",'Penfield=' + Penfield.length); Rochester[Rochester.length] = createMarker(new GPoint(-77.57511800,43.14725100),"
Talmudical Institute
769 Park Avenue
Rochester, NY 14607
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Talmudical Institute",'Rochester=' + Rochester.length); Webster[Webster.length] = createMarker(new GPoint(-77.44688700,43.22940000),"
Webster Christian School
675 Holt Road
Webster, NY 14580
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Webster Christian School",'Webster=' + Webster.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/////2/' + showArray); map.removeOverlays(Brockport); map.removeOverlays(Penfield); map.removeOverlays(Rochester); map.removeOverlays(Webster); 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(Rochester);map.removeOverlays(Brockport); map.removeOverlays(Penfield); map.removeOverlays(Rochester); map.removeOverlays(Webster); map.addOverlays(Brockport); centerByArray(Brockport, false, false); cntMarker += Brockport.length; map.addOverlays(Penfield); centerByArray(Penfield, false, false); cntMarker += Penfield.length; map.addOverlays(Rochester); centerByArray(Rochester, false, false); cntMarker += Rochester.length; map.addOverlays(Webster); centerByArray(Webster, false, false); cntMarker += Webster.length; centerByArray(Rochester,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=2&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; }