function addMarkers(){ mySelect = document.getElementById('selection'); Amherst = [];Tonawanda = [];Buffalo = [];Collins = [];Cheektowaga = [];West_Seneca = [];Williamsville = [];Depew = [];South_Wales = [];Gowanda = [];Grand_Island = [];Hamburg = [];Kenmore = [];Snyder = [];Athol_Springs = [];Lancaster = [];mySelect.options[mySelect.options.length] = new Option("Amherst schools",'all=Amherst'); mySelect.options[mySelect.options.length] = new Option("Athol Springs schools",'all=Athol_Springs'); mySelect.options[mySelect.options.length] = new Option("Buffalo schools",'all=Buffalo'); mySelect.options[mySelect.options.length] = new Option("Cheektowaga schools",'all=Cheektowaga'); mySelect.options[mySelect.options.length] = new Option("Collins schools",'all=Collins'); mySelect.options[mySelect.options.length] = new Option("Depew schools",'all=Depew'); mySelect.options[mySelect.options.length] = new Option("Gowanda schools",'all=Gowanda'); mySelect.options[mySelect.options.length] = new Option("Grand Island schools",'all=Grand_Island'); mySelect.options[mySelect.options.length] = new Option("Hamburg schools",'all=Hamburg'); mySelect.options[mySelect.options.length] = new Option("Kenmore schools",'all=Kenmore'); mySelect.options[mySelect.options.length] = new Option("Lancaster schools",'all=Lancaster'); mySelect.options[mySelect.options.length] = new Option("Snyder schools",'all=Snyder'); mySelect.options[mySelect.options.length] = new Option("South Wales schools",'all=South_Wales'); mySelect.options[mySelect.options.length] = new Option("Tonawanda schools",'all=Tonawanda'); mySelect.options[mySelect.options.length] = new Option("West Seneca schools",'all=West_Seneca'); mySelect.options[mySelect.options.length] = new Option("Williamsville schools",'all=Williamsville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Amherst[Amherst.length] = createMarker(new GPoint(-78.75295900,43.06876600),"
Amherst Christian Academy
2625 Tonawanda Creek Road
Amherst, NY 14228
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Amherst Christian Academy",'Amherst=' + Amherst.length); Tonawanda[Tonawanda.length] = createMarker(new GPoint(-78.87358300,43.02149300),"
The Baptist School
72 E Niagara Street
Tonawanda, NY 14150
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Baptist School",'Tonawanda=' + Tonawanda.length); Buffalo[Buffalo.length] = createMarker(new GPoint(-78.81865200,42.84800600),"
Bishop Timon-st Jude High School
601 Mckinley Parkway
Buffalo, NY 14220
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bishop Timon-st Jude High School",'Buffalo=' + Buffalo.length); Collins[Collins.length] = createMarker(new GPoint(-78.84491500,42.49845300),"
Blossom Garden Friends School
13961 Sisson Highway
Collins, NY 14034
Co-ed school, 1-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blossom Garden Friends School",'Collins=' + Collins.length); Amherst[Amherst.length] = createMarker(new GPoint(-78.80721300,42.96223700),"
Buffalo Academy Of The Sacred Heart
3860 Main Street
Amherst, NY 14226
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buffalo Academy Of The Sacred Heart",'Amherst=' + Amherst.length); Buffalo[Buffalo.length] = createMarker(new GPoint(-78.87531300,42.92423000),"
Buffalo Seminary
205 Bidwell Parkway
Buffalo, NY 14222
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buffalo Seminary",'Buffalo=' + Buffalo.length); Buffalo[Buffalo.length] = createMarker(new GPoint(-78.86927600,42.91617400),"
Canisius High School
1180 Delaware Avenue
Buffalo, NY 14209
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Canisius High School",'Buffalo=' + Buffalo.length); Buffalo[Buffalo.length] = createMarker(new GPoint(-78.82482000,42.95191300),"
Cantalician Center For Learnin
3233 Main Street
Buffalo, NY 14214
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cantalician Center For Learnin",'Buffalo=' + Buffalo.length); Tonawanda[Tonawanda.length] = createMarker(new GPoint(-78.86351100,42.99950600),"
Cardinal O Hara High School
39 Ohara Road
Tonawanda, NY 14150
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cardinal O Hara High School",'Tonawanda=' + Tonawanda.length); Cheektowaga[Cheektowaga.length] = createMarker(new GPoint(-78.74649900,42.92040000),"
The Center For Handicapped Children
1 Nagel Drive
Cheektowaga, NY 14225
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Center For Handicapped Children",'Cheektowaga=' + Cheektowaga.length); West_Seneca[West_Seneca.length] = createMarker(new GPoint(-78.76744100,42.83974100),"
Center Road Christian Academy
412 Center Road
West Seneca, NY 14224
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Center Road Christian Academy",'West_Seneca=' + West_Seneca.length); Buffalo[Buffalo.length] = createMarker(new GPoint(-78.79923700,42.93201000),"
Charles Grandison Finney High School
260 Eggert Road
Buffalo, NY 14215
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charles Grandison Finney High School",'Buffalo=' + Buffalo.length); Williamsville[Williamsville.length] = createMarker(new GPoint(-78.73691900,42.96505100),"
Christian Central Academy
39 Academy St
Williamsville, NY 14221
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Central Academy",'Williamsville=' + Williamsville.length); Buffalo[Buffalo.length] = createMarker(new GPoint(-78.83288600,42.89924500),"
Darul Ullom Al Madania
182 Sobieski Street
Buffalo, NY 14212
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Darul Ullom Al Madania",'Buffalo=' + Buffalo.length); Williamsville[Williamsville.length] = createMarker(new GPoint(-78.71631600,42.96627600),"
Gateway-longview Lynde School
6350 Main Street
Williamsville, NY 14221
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gateway-longview Lynde School",'Williamsville=' + Williamsville.length); Depew[Depew.length] = createMarker(new GPoint(-78.68707700,42.90520100),"
God's New Covenant Academy
570 Gould Ave
Depew, NY 14043
Co-ed school, 11-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("God's New Covenant Academy",'Depew=' + Depew.length); South_Wales[South_Wales.length] = createMarker(new GPoint(-78.58229300,42.70862000),"
The Gow School
Po Box 85
South Wales, NY 14139
All-boys school, 7-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("The Gow School",'South_Wales=' + South_Wales.length); Gowanda[Gowanda.length] = createMarker(new GPoint(-78.94178600,42.47326300),"
Gowanda Christian Academy
78 Allen Street
Gowanda, NY 14070
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gowanda Christian Academy",'Gowanda=' + Gowanda.length); Grand_Island[Grand_Island.length] = createMarker(new GPoint(-78.95984600,43.01829500),"
Grand Island Christian Academy
2060 Grand Island Boulevard
Grand Island, NY 14072
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grand Island Christian Academy",'Grand_Island=' + Grand_Island.length); Hamburg[Hamburg.length] = createMarker(new GPoint(-78.83362900,42.71606300),"
Hamburg Christian Academy
120 Main Street
Hamburg, NY 14075
Co-ed school, 4-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hamburg Christian Academy",'Hamburg=' + Hamburg.length); Buffalo[Buffalo.length] = createMarker(new GPoint(-78.83586800,42.94825600),"
Holy Angels Academy High School
24 Shoshone Drive
Buffalo, NY 14214
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holy Angels Academy High School",'Buffalo=' + Buffalo.length); Hamburg[Hamburg.length] = createMarker(new GPoint(-78.82432400,42.75602400),"
Immaculata Academy
5138 S Park Avenue
Hamburg, NY 14075
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Immaculata Academy",'Hamburg=' + Hamburg.length); Buffalo[Buffalo.length] = createMarker(new GPoint(-78.81206600,42.84539700),"
Mount Mercy Academy
88 Red Jacket Parkway
Buffalo, NY 14220
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mount Mercy Academy",'Buffalo=' + Buffalo.length); Kenmore[Kenmore.length] = createMarker(new GPoint(-78.87339500,42.98671100),"
Mount St Mary Academy
3756 Delaware Avenue
Kenmore, NY 14217
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mount St Mary Academy",'Kenmore=' + Kenmore.length); Buffalo[Buffalo.length] = createMarker(new GPoint(-78.87353300,42.91761000),"
Nardin Academy High School
135 Cleveland Avenue
Buffalo, NY 14222
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Nardin Academy High School",'Buffalo=' + Buffalo.length); Tonawanda[Tonawanda.length] = createMarker(new GPoint(-78.85948700,43.00871800),"
New Life Christian School
80 Luksin Drive
Tonawanda, NY 14150
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Life Christian School",'Tonawanda=' + Tonawanda.length); Buffalo[Buffalo.length] = createMarker(new GPoint(-78.85604400,42.94126600),"
Nichols School
1250 Amherst Street
Buffalo, NY 14216
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nichols School",'Buffalo=' + Buffalo.length); Hamburg[Hamburg.length] = createMarker(new GPoint(-78.83990000,42.73440000),"
Old Time Baptist Academy
Po Box 120
Hamburg, NY 14075
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Old Time Baptist Academy",'Hamburg=' + Hamburg.length); Snyder[Snyder.length] = createMarker(new GPoint(-78.78375800,42.96780000),"
The Park School Of Buffalo
4625 Harlem Road
Snyder, NY 14226
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Park School Of Buffalo",'Snyder=' + Snyder.length); Athol_Springs[Athol_Springs.length] = createMarker(new GPoint(-78.86534000,42.77143700),"
St. Francis High School
4129 Lake Shore Road
Athol Springs, NY 14010
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St. Francis High School",'Athol_Springs=' + Athol_Springs.length); Buffalo[Buffalo.length] = createMarker(new GPoint(-78.84959100,42.95872000),"
St. Joseph's Collegiate Institute
845 Kenmore Avenue
Buffalo, NY 14223
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St. Joseph's Collegiate Institute",'Buffalo=' + Buffalo.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-78.67962500,42.90772500),"
St. Marys High School
142 Laverack Avenue
Lancaster, NY 14086
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Marys High School",'Lancaster=' + Lancaster.length); Buffalo[Buffalo.length] = createMarker(new GPoint(-78.80668200,42.91896300),"
Turner/carroll
185 Lang Avenue
Buffalo, NY 14215
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Turner/carroll",'Buffalo=' + Buffalo.length); West_Seneca[West_Seneca.length] = createMarker(new GPoint(-78.75198800,42.81403200),"
West Seneca Christian School
511 Union Road
West Seneca, NY 14224
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Seneca Christian School",'West_Seneca=' + West_Seneca.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(Amherst); map.removeOverlays(Athol_Springs); map.removeOverlays(Buffalo); map.removeOverlays(Cheektowaga); map.removeOverlays(Collins); map.removeOverlays(Depew); map.removeOverlays(Gowanda); map.removeOverlays(Grand_Island); map.removeOverlays(Hamburg); map.removeOverlays(Kenmore); map.removeOverlays(Lancaster); map.removeOverlays(Snyder); map.removeOverlays(South_Wales); map.removeOverlays(Tonawanda); map.removeOverlays(West_Seneca); map.removeOverlays(Williamsville); 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(Amherst);map.removeOverlays(Amherst); map.removeOverlays(Athol_Springs); map.removeOverlays(Buffalo); map.removeOverlays(Cheektowaga); map.removeOverlays(Collins); map.removeOverlays(Depew); map.removeOverlays(Gowanda); map.removeOverlays(Grand_Island); map.removeOverlays(Hamburg); map.removeOverlays(Kenmore); map.removeOverlays(Lancaster); map.removeOverlays(Snyder); map.removeOverlays(South_Wales); map.removeOverlays(Tonawanda); map.removeOverlays(West_Seneca); map.removeOverlays(Williamsville); map.addOverlays(Amherst); centerByArray(Amherst, false, false); cntMarker += Amherst.length; map.addOverlays(Athol_Springs); centerByArray(Athol_Springs, false, false); cntMarker += Athol_Springs.length; map.addOverlays(Buffalo); centerByArray(Buffalo, false, false); cntMarker += Buffalo.length; map.addOverlays(Cheektowaga); centerByArray(Cheektowaga, false, false); cntMarker += Cheektowaga.length; map.addOverlays(Collins); centerByArray(Collins, false, false); cntMarker += Collins.length; map.addOverlays(Depew); centerByArray(Depew, false, false); cntMarker += Depew.length; map.addOverlays(Gowanda); centerByArray(Gowanda, false, false); cntMarker += Gowanda.length; map.addOverlays(Grand_Island); centerByArray(Grand_Island, false, false); cntMarker += Grand_Island.length; map.addOverlays(Hamburg); centerByArray(Hamburg, false, false); cntMarker += Hamburg.length; map.addOverlays(Kenmore); centerByArray(Kenmore, false, false); cntMarker += Kenmore.length; map.addOverlays(Lancaster); centerByArray(Lancaster, false, false); cntMarker += Lancaster.length; map.addOverlays(Snyder); centerByArray(Snyder, false, false); cntMarker += Snyder.length; map.addOverlays(South_Wales); centerByArray(South_Wales, false, false); cntMarker += South_Wales.length; map.addOverlays(Tonawanda); centerByArray(Tonawanda, false, false); cntMarker += Tonawanda.length; map.addOverlays(West_Seneca); centerByArray(West_Seneca, false, false); cntMarker += West_Seneca.length; map.addOverlays(Williamsville); centerByArray(Williamsville, false, false); cntMarker += Williamsville.length; centerByArray(Amherst,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; }