function addMarkers(){ mySelect = document.getElementById('selection'); Albany = [];Schenectady = [];Slingerlands = [];Glenmont = [];Delmar = [];Altamont = [];Westerlo = [];Latham = [];Loudonville = [];Watervliet = [];mySelect.options[mySelect.options.length] = new Option("Albany schools",'all=Albany'); mySelect.options[mySelect.options.length] = new Option("Altamont schools",'all=Altamont'); mySelect.options[mySelect.options.length] = new Option("Delmar schools",'all=Delmar'); mySelect.options[mySelect.options.length] = new Option("Glenmont schools",'all=Glenmont'); mySelect.options[mySelect.options.length] = new Option("Latham schools",'all=Latham'); mySelect.options[mySelect.options.length] = new Option("Loudonville schools",'all=Loudonville'); mySelect.options[mySelect.options.length] = new Option("Schenectady schools",'all=Schenectady'); mySelect.options[mySelect.options.length] = new Option("Slingerlands schools",'all=Slingerlands'); mySelect.options[mySelect.options.length] = new Option("Watervliet schools",'all=Watervliet'); mySelect.options[mySelect.options.length] = new Option("Westerlo schools",'all=Westerlo'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Albany[Albany.length] = createMarker(new GPoint(-73.78572600,42.64713800),"
The Albany Academy
135 Academy Road
Albany, NY 12208
All-boys school, PK-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("The Albany Academy",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-73.78537200,42.64695300),"
Albany Academy For Girls
140 Academy Road
Albany, NY 12208
All-girls school, PK-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Albany Academy For Girls",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-73.80633400,42.64899100),"
Albany Jcc
340 Whitehall Road
Albany, NY 12208
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Albany Jcc",'Albany=' + Albany.length); Schenectady[Schenectady.length] = createMarker(new GPoint(-73.88210900,42.76103000),"
Annur Islamic School
2195 Central Ave
Schenectady, NY 12304
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Annur Islamic School",'Schenectady=' + Schenectady.length); Albany[Albany.length] = createMarker(new GPoint(-73.78206300,42.68882700),"
Bet Shraga Hebrew Academy
54 Sand Creek Road
Albany, NY 12205
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bet Shraga Hebrew Academy",'Albany=' + Albany.length); Slingerlands[Slingerlands.length] = createMarker(new GPoint(-73.87030000,42.64670000),"
Bethlehem Childrens School
Po Box 235
Slingerlands, NY 12159
Co-ed school, K-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethlehem Childrens School",'Slingerlands=' + Slingerlands.length); Glenmont[Glenmont.length] = createMarker(new GPoint(-73.79500000,42.59860000),"
Bethlehem Preschool Inc
Po Box 4
Glenmont, NY 12077
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethlehem Preschool Inc",'Glenmont=' + Glenmont.length); Albany[Albany.length] = createMarker(new GPoint(-73.78174700,42.67307800),"
Blessed Sacrament School
605 Central Avenue
Albany, NY 12206
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blessed Sacrament School",'Albany=' + Albany.length); Delmar[Delmar.length] = createMarker(new GPoint(-73.83900000,42.61460000),"
Blossoms Montessori Learning
Po Box 223 56 Hudson Avenue
Delmar, NY 12054
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blossoms Montessori Learning",'Delmar=' + Delmar.length); Albany[Albany.length] = createMarker(new GPoint(-73.83520000,42.68050000),"
Christ The King Elementary School
20 Sumpter Avenue
Albany, NY 12203
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ The King Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-73.81873900,42.73692200),"
Christian Brothers Academy
12 Airline Drive
Albany, NY 12205
All-boys school, 6-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Christian Brothers Academy",'Albany=' + Albany.length); Altamont[Altamont.length] = createMarker(new GPoint(-74.01870000,42.70090000),"
Cobb Memorial School
100-300 Mt. Presentation Way, Po Box 503
Altamont, NY 12009
Co-ed school, 1-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cobb Memorial School",'Altamont=' + Altamont.length); Albany[Albany.length] = createMarker(new GPoint(-73.81376100,42.70071400),"
Colony Christian Academy
1 Van Buren Avenue
Albany, NY 12205
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Colony Christian Academy",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-73.76700800,42.62864000),"
Doane Stuart School
799 S Pearl St
Albany, NY 12202
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Doane Stuart School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-73.75737400,42.64573500),"
The Free School
8 Elm Street
Albany, NY 12202
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Free School",'Albany=' + Albany.length); Westerlo[Westerlo.length] = createMarker(new GPoint(-74.04521900,42.51325000),"
Helderberg Christian School
Po Box 164
Westerlo, NY 12193
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Helderberg Christian School",'Westerlo=' + Westerlo.length); Albany[Albany.length] = createMarker(new GPoint(-73.80535400,42.67165000),"
Holy Cross Elementary School
10 Rosemont Street
Albany, NY 12203
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Cross Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-73.80619300,42.65489200),"
Kevin G Langan School
314 So Manning Blvd
Albany, NY 12208
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kevin G Langan School",'Albany=' + Albany.length); Latham[Latham.length] = createMarker(new GPoint(-73.75234900,42.73369500),"
Latham Christian Academy
495 Watervliet Shaker Rd
Latham, NY 12110
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Latham Christian Academy",'Latham=' + Latham.length); Loudonville[Loudonville.length] = createMarker(new GPoint(-73.75413600,42.69589900),"
Loudonville Christian School
374 Loudon Road
Loudonville, NY 12211
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Loudonville Christian School",'Loudonville=' + Loudonville.length); Albany[Albany.length] = createMarker(new GPoint(-73.78949800,42.65701400),"
Maimonides Hebrew Day School
Po Box 8806
Albany, NY 12208
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Maimonides Hebrew Day School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-73.80759200,42.65875900),"
Maria College Campus School
700 New Scotland Avenue
Albany, NY 12208
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Maria College Campus School",'Albany=' + Albany.length); Glenmont[Glenmont.length] = createMarker(new GPoint(-73.79511200,42.61819500),"
Montessori Childrens Center
1 Kenwood Avenue
Glenmont, NY 12077
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Childrens Center",'Glenmont=' + Glenmont.length); Glenmont[Glenmont.length] = createMarker(new GPoint(-73.79500000,42.59860000),"
Mt Moriah Academy
Po Box 160
Glenmont, NY 12077
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mt Moriah Academy",'Glenmont=' + Glenmont.length); Albany[Albany.length] = createMarker(new GPoint(-73.80972400,42.70406800),"
Our Savior's Lutheran School
63 Mountain View Avenue
Albany, NY 12205
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Savior's Lutheran School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-73.78507100,42.64987100),"
Parsons Child & Family Center
60 Academy Road
Albany, NY 12208
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parsons Child & Family Center",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-73.79200100,42.66478100),"
Pine Hills Montessori Daycare
715 Morris St
Albany, NY 12208
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pine Hills Montessori Daycare",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-73.85995600,42.70659800),"
Pineview Community Church Preschool
251 Washington Avenue Ext
Albany, NY 12205
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pineview Community Church Preschool",'Albany=' + Albany.length); Latham[Latham.length] = createMarker(new GPoint(-73.75411200,42.75645000),"
St. Ambrose School
347 Old Loudon Road
Latham, NY 12110
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Ambrose School",'Latham=' + Latham.length); Watervliet[Watervliet.length] = createMarker(new GPoint(-73.70795300,42.71497000),"
St. Brigids Regional Catholic School
700 5th Avenue
Watervliet, NY 12189
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Brigids Regional Catholic School",'Watervliet=' + Watervliet.length); Albany[Albany.length] = createMarker(new GPoint(-73.76365000,42.66049500),"
St. Casimir Regional School
309 Sheridan Avenue
Albany, NY 12206
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Casimir Regional School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-73.81350600,42.65644900),"
St. Catherine Of Siena
35 Hurst Avenue
Albany, NY 12208
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Catherine Of Siena",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-73.78688800,42.66633500),"
St. Catherine's Center For Chil
30 North Main Avenue
Albany, NY 12203
Co-ed school, NS-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Catherine's Center For Chil",'Albany=' + Albany.length); Loudonville[Loudonville.length] = createMarker(new GPoint(-73.77034700,42.72048500),"
St. Gregory's School
121 Old Niskayuna Road
Loudonville, NY 12211
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Gregory's School",'Loudonville=' + Loudonville.length); Schenectady[Schenectady.length] = createMarker(new GPoint(-73.94271500,42.74093900),"
St. Madeleine Sophie School
3510 Carman Road
Schenectady, NY 12303
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Madeleine Sophie School",'Schenectady=' + Schenectady.length); Albany[Albany.length] = createMarker(new GPoint(-73.78694800,42.64104400),"
St. Matthew Lutheran School
75 Whitehall Rd
Albany, NY 12209
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Matthew Lutheran School",'Albany=' + Albany.length); Loudonville[Loudonville.length] = createMarker(new GPoint(-73.76055500,42.69758100),"
St. Pius X School
75 Upper Loudon Road
Loudonville, NY 12211
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Pius X School",'Loudonville=' + Loudonville.length); Albany[Albany.length] = createMarker(new GPoint(-73.79414700,42.65370200),"
St. Teresa Of Avila School
8 Hollywood Avenue
Albany, NY 12208
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Teresa Of Avila School",'Albany=' + Albany.length); Delmar[Delmar.length] = createMarker(new GPoint(-73.83162300,42.62127400),"
St. Thomas The Apostle School
42 Adams Place
Delmar, NY 12054
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Thomas The Apostle School",'Delmar=' + Delmar.length); Albany[Albany.length] = createMarker(new GPoint(-73.78087500,42.64276100),"
St James Institute School
50 Summit Avenue
Albany, NY 12209
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St James Institute School",'Albany=' + Albany.length); Delmar[Delmar.length] = createMarker(new GPoint(-73.81286800,42.62876300),"
Tutor Time Child Care Learning Center
180 Delaware Avenue
Delmar, NY 12054
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tutor Time Child Care Learning Center",'Delmar=' + Delmar.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(Albany); map.removeOverlays(Altamont); map.removeOverlays(Delmar); map.removeOverlays(Glenmont); map.removeOverlays(Latham); map.removeOverlays(Loudonville); map.removeOverlays(Schenectady); map.removeOverlays(Slingerlands); map.removeOverlays(Watervliet); map.removeOverlays(Westerlo); 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(Albany);map.removeOverlays(Albany); map.removeOverlays(Altamont); map.removeOverlays(Delmar); map.removeOverlays(Glenmont); map.removeOverlays(Latham); map.removeOverlays(Loudonville); map.removeOverlays(Schenectady); map.removeOverlays(Slingerlands); map.removeOverlays(Watervliet); map.removeOverlays(Westerlo); map.addOverlays(Albany); centerByArray(Albany, false, false); cntMarker += Albany.length; map.addOverlays(Altamont); centerByArray(Altamont, false, false); cntMarker += Altamont.length; map.addOverlays(Delmar); centerByArray(Delmar, false, false); cntMarker += Delmar.length; map.addOverlays(Glenmont); centerByArray(Glenmont, false, false); cntMarker += Glenmont.length; map.addOverlays(Latham); centerByArray(Latham, false, false); cntMarker += Latham.length; map.addOverlays(Loudonville); centerByArray(Loudonville, false, false); cntMarker += Loudonville.length; map.addOverlays(Schenectady); centerByArray(Schenectady, false, false); cntMarker += Schenectady.length; map.addOverlays(Slingerlands); centerByArray(Slingerlands, false, false); cntMarker += Slingerlands.length; map.addOverlays(Watervliet); centerByArray(Watervliet, false, false); cntMarker += Watervliet.length; map.addOverlays(Westerlo); centerByArray(Westerlo, false, false); cntMarker += Westerlo.length; centerByArray(Albany,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; }