function addMarkers(){ mySelect = document.getElementById('selection'); Albany = [];Albany[Albany.length] = createMarker(new GPoint(-73.83417500,42.65004000),"
Academy Of The Holy Names Uppe
1075 New Scotland Road
Albany, NY 12208
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Academy Of The Holy Names Uppe",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-73.83367700,42.65015000),"
Academy Of The Holy Names Upper School
1075 New Scotland Road
Albany, NY 12208
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Academy Of The Holy Names Upper School",'Albany=' + Albany.length); 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); 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); Albany[Albany.length] = createMarker(new GPoint(-73.77196400,42.64248400),"
Bishop Maginn High School
99 Slingerland Street
Albany, NY 12202
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bishop Maginn High School",'Albany=' + Albany.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); 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); 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); 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); Albany[Albany.length] = createMarker(new GPoint(-73.78529000,42.66458400),"
Lasalle School
391 Western Avenue
Albany, NY 12203
All-boys school, 7-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lasalle School",'Albany=' + Albany.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); 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); Albany[Albany.length] = createMarker(new GPoint(-73.78243000,42.67094700),"
St. Anne Institute
160 North Main Avenue
Albany, NY 12206
All-girls school, 7-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("St. Anne Institute",'Albany=' + Albany.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); 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); 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); 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); } // 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//////' + showArray); map.removeOverlays(Albany); 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.addOverlays(Albany); centerByArray(Albany, false, false); cntMarker += Albany.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=&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; }