function addMarkers(){ mySelect = document.getElementById('selection'); Baldwinsville = [];Syracuse = [];Cicero = [];Fayetteville = [];Dewitt = [];East_Syracuse = [];North_Syracuse = [];Mattydale = [];mySelect.options[mySelect.options.length] = new Option("Baldwinsville schools",'all=Baldwinsville'); mySelect.options[mySelect.options.length] = new Option("Cicero schools",'all=Cicero'); mySelect.options[mySelect.options.length] = new Option("Dewitt schools",'all=Dewitt'); mySelect.options[mySelect.options.length] = new Option("East Syracuse schools",'all=East_Syracuse'); mySelect.options[mySelect.options.length] = new Option("Fayetteville schools",'all=Fayetteville'); mySelect.options[mySelect.options.length] = new Option("Mattydale schools",'all=Mattydale'); mySelect.options[mySelect.options.length] = new Option("North Syracuse schools",'all=North_Syracuse'); mySelect.options[mySelect.options.length] = new Option("Syracuse schools",'all=Syracuse'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Baldwinsville[Baldwinsville.length] = createMarker(new GPoint(-76.31733900,43.12464400),"
Baldwinsville Christian Academy
7312 Van Buren Road
Baldwinsville, NY 13027
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Baldwinsville Christian Academy",'Baldwinsville=' + Baldwinsville.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.10240600,43.06915600),"
Blessed Sacrament School
3129 James Street
Syracuse, NY 13206
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blessed Sacrament School",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.16846700,43.05113700),"
Blessed Virgin Mary Mother Of God Academy
450 Wilkinson Street
Syracuse, NY 13204
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blessed Virgin Mary Mother Of God Academy",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.14898700,43.04649700),"
Cathedral School
420 Montgomery Street
Syracuse, NY 13202
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cathedral School",'Syracuse=' + Syracuse.length); Cicero[Cicero.length] = createMarker(new GPoint(-76.11947100,43.16310700),"
Childtime Chldrn Center
8098 Brewerton Rd
Cicero, NY 13039
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Childtime Chldrn Center",'Cicero=' + Cicero.length); Baldwinsville[Baldwinsville.length] = createMarker(new GPoint(-76.30753600,43.17669400),"
Childtime Learning Center
8439 Loop Rd
Baldwinsville, NY 13027
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Childtime Learning Center",'Baldwinsville=' + Baldwinsville.length); Fayetteville[Fayetteville.length] = createMarker(new GPoint(-76.00205500,43.03048900),"
Creative Environment Day School
531 E Genesee Street
Fayetteville, NY 13066
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Creative Environment Day School",'Fayetteville=' + Fayetteville.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.14725300,43.00350300),"
Faith Heritage School
3740 Midland Avenue
Syracuse, NY 13205
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Heritage School",'Syracuse=' + Syracuse.length); Dewitt[Dewitt.length] = createMarker(new GPoint(-76.07327600,43.03622800),"
Holy Cross Elementary School
4200 E Genesee Street
Dewitt, NY 13214
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Cross Elementary School",'Dewitt=' + Dewitt.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.23966800,43.04605300),"
Holy Family School
130 Chapel Drive
Syracuse, NY 13219
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Family School",'Syracuse=' + Syracuse.length); Fayetteville[Fayetteville.length] = createMarker(new GPoint(-75.99296300,43.02683300),"
Immaculate Conception School
400 Salt Springs Street
Fayetteville, NY 13066
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Immaculate Conception School",'Fayetteville=' + Fayetteville.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.10014600,43.04279800),"
Jowonio School
3049 East Genesee Street
Syracuse, NY 13224
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jowonio School",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.09793000,43.08436400),"
Living Word Academy
6101 Court Street Road
Syracuse, NY 13206
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Living Word Academy",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.15743900,43.04039000),"
Madrasat Al Ihsan
423 West Onondaga Street
Syracuse, NY 13202
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Madrasat Al Ihsan",'Syracuse=' + Syracuse.length); Dewitt[Dewitt.length] = createMarker(new GPoint(-76.07140600,43.02656300),"
Manlius Pebble Hill School
5300 Jamesville Road
Dewitt, NY 13214
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Manlius Pebble Hill School",'Dewitt=' + Dewitt.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.12416600,43.06407700),"
Merriday School
1636 James Street
Syracuse, NY 13203
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Merriday School",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.10998600,43.02632700),"
Montessori School of Syracuse
155 Waldorf Parkway
Syracuse, NY 13224
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori School of Syracuse",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.17134000,43.03283600),"
Most Holy Rosary School
1031 Bellevue Avenue
Syracuse, NY 13207
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Most Holy Rosary School",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.12444800,43.05377900),"
The New School
1103 Burnet Avenue
Syracuse, NY 13203
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The New School",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.14916200,43.05930200),"
Our Lady Of Pompei School
915 N Mcbride Street
Syracuse, NY 13208
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Pompei School",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.18975900,43.04215900),"
Parkview Jr Academy
412 S Avenuery Avenue
Syracuse, NY 13219
Co-ed school, K-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parkview Jr Academy",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.17979400,43.05226300),"
Sacred Heart School
1001 Park Avenue
Syracuse, NY 13204
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart School",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.20425200,43.02820800),"
St. Ann's School
4471 Onondaga Blvd
Syracuse, NY 13219
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Ann's School",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.16141500,43.04349400),"
St. Lucy's Academy
422 Gifford St.
Syracuse, NY 13204
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Lucy's Academy",'Syracuse=' + Syracuse.length); East_Syracuse[East_Syracuse.length] = createMarker(new GPoint(-76.07661100,43.06767100),"
St. Matthew School
214 Kinne Street
East Syracuse, NY 13057
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Matthew School",'East_Syracuse=' + East_Syracuse.length); North_Syracuse[North_Syracuse.length] = createMarker(new GPoint(-76.13231000,43.13093800),"
St. Rose Of Lima School
411 South Main Street
North Syracuse, NY 13212
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Rose Of Lima School",'North_Syracuse=' + North_Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.20275300,43.04045400),"
St Charles Borromeo School
200 W High Ter
Syracuse, NY 13219
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Charles Borromeo School",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.12649700,43.08183800),"
St Daniel School
621 Roxford Road S
Syracuse, NY 13208
Co-ed school, 5-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Daniel School",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.14277800,42.99896500),"
St James School
4837 S Salina Street
Syracuse, NY 13205
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St James School",'Syracuse=' + Syracuse.length); Mattydale[Mattydale.length] = createMarker(new GPoint(-76.14760100,43.09973400),"
St Margarets School
201 Roxboro Road
Mattydale, NY 13211
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Margarets School",'Mattydale=' + Mattydale.length); Baldwinsville[Baldwinsville.length] = createMarker(new GPoint(-76.32994800,43.15315900),"
St Mary's Academy
49 Syracuse Street
Baldwinsville, NY 13027
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mary's Academy",'Baldwinsville=' + Baldwinsville.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.18302300,43.05082800),"
St Patricks School
210 Schuyler Street
Syracuse, NY 13204
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Patricks School",'Syracuse=' + Syracuse.length); Syracuse[Syracuse.length] = createMarker(new GPoint(-76.07320200,43.04492800),"
Syracuse Hebrew Day School
5655 Thompson Road
Syracuse, NY 13214
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Syracuse Hebrew Day School",'Syracuse=' + Syracuse.length); Baldwinsville[Baldwinsville.length] = createMarker(new GPoint(-76.34858400,43.15176100),"
Temple Baptist Academy
2295 Downer Street
Baldwinsville, NY 13027
All-girls school, K-2
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Temple Baptist Academy",'Baldwinsville=' + Baldwinsville.length); Baldwinsville[Baldwinsville.length] = createMarker(new GPoint(-76.33260400,43.16218000),"
Word of Life Christian Academy
12 E. Oneida Street
Baldwinsville, NY 13027
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Word of Life Christian Academy",'Baldwinsville=' + Baldwinsville.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(Baldwinsville); map.removeOverlays(Cicero); map.removeOverlays(Dewitt); map.removeOverlays(East_Syracuse); map.removeOverlays(Fayetteville); map.removeOverlays(Mattydale); map.removeOverlays(North_Syracuse); map.removeOverlays(Syracuse); 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(Baldwinsville);map.removeOverlays(Baldwinsville); map.removeOverlays(Cicero); map.removeOverlays(Dewitt); map.removeOverlays(East_Syracuse); map.removeOverlays(Fayetteville); map.removeOverlays(Mattydale); map.removeOverlays(North_Syracuse); map.removeOverlays(Syracuse); map.addOverlays(Baldwinsville); centerByArray(Baldwinsville, false, false); cntMarker += Baldwinsville.length; map.addOverlays(Cicero); centerByArray(Cicero, false, false); cntMarker += Cicero.length; map.addOverlays(Dewitt); centerByArray(Dewitt, false, false); cntMarker += Dewitt.length; map.addOverlays(East_Syracuse); centerByArray(East_Syracuse, false, false); cntMarker += East_Syracuse.length; map.addOverlays(Fayetteville); centerByArray(Fayetteville, false, false); cntMarker += Fayetteville.length; map.addOverlays(Mattydale); centerByArray(Mattydale, false, false); cntMarker += Mattydale.length; map.addOverlays(North_Syracuse); centerByArray(North_Syracuse, false, false); cntMarker += North_Syracuse.length; map.addOverlays(Syracuse); centerByArray(Syracuse, false, false); cntMarker += Syracuse.length; centerByArray(Baldwinsville,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; }