function addMarkers(){ mySelect = document.getElementById('selection'); Monroe = [];Newburgh = [];New_Windsor = [];Warwick = [];Port_Jervis = [];Pine_Bush = [];Washingtonville = [];Goshen = [];Middletown = [];Walden = [];Highland_Falls = [];Cornwall_On_Hudson = [];Florida = [];Highland_Mills = [];Tuxedo_Park = [];mySelect.options[mySelect.options.length] = new Option("Cornwall On Hudson schools",'all=Cornwall_On_Hudson'); mySelect.options[mySelect.options.length] = new Option("Florida schools",'all=Florida'); mySelect.options[mySelect.options.length] = new Option("Goshen schools",'all=Goshen'); mySelect.options[mySelect.options.length] = new Option("Highland Falls schools",'all=Highland_Falls'); mySelect.options[mySelect.options.length] = new Option("Highland Mills schools",'all=Highland_Mills'); mySelect.options[mySelect.options.length] = new Option("Middletown schools",'all=Middletown'); mySelect.options[mySelect.options.length] = new Option("Monroe schools",'all=Monroe'); mySelect.options[mySelect.options.length] = new Option("New Windsor schools",'all=New_Windsor'); mySelect.options[mySelect.options.length] = new Option("Newburgh schools",'all=Newburgh'); mySelect.options[mySelect.options.length] = new Option("Pine Bush schools",'all=Pine_Bush'); mySelect.options[mySelect.options.length] = new Option("Port Jervis schools",'all=Port_Jervis'); mySelect.options[mySelect.options.length] = new Option("Tuxedo Park schools",'all=Tuxedo_Park'); mySelect.options[mySelect.options.length] = new Option("Walden schools",'all=Walden'); mySelect.options[mySelect.options.length] = new Option("Warwick schools",'all=Warwick'); mySelect.options[mySelect.options.length] = new Option("Washingtonville schools",'all=Washingtonville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Monroe[Monroe.length] = createMarker(new GPoint(-74.16152500,41.33749900),"
Bais Rochel School
7 Isreal Szupnick
Monroe, NY 10950
All-girls school, -
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bais Rochel School",'Monroe=' + Monroe.length); Newburgh[Newburgh.length] = createMarker(new GPoint(-74.01314800,41.50819300),"
Bishop Dunn Memorial
50 Gidney Avenue
Newburgh, NY 12550
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bishop Dunn Memorial",'Newburgh=' + Newburgh.length); Monroe[Monroe.length] = createMarker(new GPoint(-74.19930000,41.30860000),"
Bnei Yoel School
Po Box 255
Monroe, NY 10949
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bnei Yoel School",'Monroe=' + Monroe.length); New_Windsor[New_Windsor.length] = createMarker(new GPoint(-74.03669600,41.46431700),"
Butterhill Day School
422 Blooming Grove Tpke
New Windsor, NY 12553
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Butterhill Day School",'New_Windsor=' + New_Windsor.length); Warwick[Warwick.length] = createMarker(new GPoint(-74.32666400,41.27342000),"
Calvary Christian Academy
5 Wisner Road
Warwick, NY 10990
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Christian Academy",'Warwick=' + Warwick.length); Port_Jervis[Port_Jervis.length] = createMarker(new GPoint(-74.65860000,41.37510000),"
Calvary Christian School
Po Box 22 41 State Rd 209 N
Port Jervis, NY 12771
Co-ed school, 4-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Christian School",'Port_Jervis=' + Port_Jervis.length); Pine_Bush[Pine_Bush.length] = createMarker(new GPoint(-74.24518200,41.60227300),"
Chapel Field Christian High School
211 Fleury Road
Pine Bush, NY 12566
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chapel Field Christian High School",'Pine_Bush=' + Pine_Bush.length); New_Windsor[New_Windsor.length] = createMarker(new GPoint(-74.10354200,41.48316700),"
Children S Country Day School
1145 Little Britain Road Suite 100
New Windsor, NY 12553
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Children S Country Day School",'New_Windsor=' + New_Windsor.length); Warwick[Warwick.length] = createMarker(new GPoint(-74.35379500,41.28398300),"
Day Spring Community School
21 Old Ridge Road
Warwick, NY 10990
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Day Spring Community School",'Warwick=' + Warwick.length); Washingtonville[Washingtonville.length] = createMarker(new GPoint(-74.15752600,41.42772600),"
English Rose Day School
16 Weathervane Drive
Washingtonville, NY 10992
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("English Rose Day School",'Washingtonville=' + Washingtonville.length); Goshen[Goshen.length] = createMarker(new GPoint(-74.34153700,41.38603400),"
Goshen Christian School
43 Route 17a
Goshen, NY 10924
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Goshen Christian School",'Goshen=' + Goshen.length); Middletown[Middletown.length] = createMarker(new GPoint(-74.29881400,41.48239800),"
Harmony Christian School
1790 Route 211 East
Middletown, NY 10941
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harmony Christian School",'Middletown=' + Middletown.length); Washingtonville[Washingtonville.length] = createMarker(new GPoint(-74.14096300,41.47490400),"
Hudson Valley Circle Of Learning School
Po Box 640
Washingtonville, NY 10992
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hudson Valley Circle Of Learning School",'Washingtonville=' + Washingtonville.length); Newburgh[Newburgh.length] = createMarker(new GPoint(-74.07478800,41.55768100),"
Leptondale Christian Academy
1771 Route 300
Newburgh, NY 12550
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Leptondale Christian Academy",'Newburgh=' + Newburgh.length); New_Windsor[New_Windsor.length] = createMarker(new GPoint(-74.02608900,41.48755000),"
Little Harvard
63 Lawrence Avenue
New Windsor, NY 12553
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Harvard",'New_Windsor=' + New_Windsor.length); Washingtonville[Washingtonville.length] = createMarker(new GPoint(-74.15831800,41.42678400),"
Little Harvard At Washingtonville
83 E Main Street
Washingtonville, NY 10992
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Harvard At Washingtonville",'Washingtonville=' + Washingtonville.length); New_Windsor[New_Windsor.length] = createMarker(new GPoint(-74.05580000,41.46690000),"
Mcquade Childrens Services Kaplan Campus School
Route 94 Box 4064
New Windsor, NY 12553
Co-ed school, 3-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mcquade Childrens Services Kaplan Campus School",'New_Windsor=' + New_Windsor.length); Middletown[Middletown.length] = createMarker(new GPoint(-74.42060900,41.45063000),"
Middletown Christian School-sda
70 Highland Avenue
Middletown, NY 10940
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Middletown Christian School-sda",'Middletown=' + Middletown.length); Monroe[Monroe.length] = createMarker(new GPoint(-74.19930000,41.30860000),"
Monroe Day School
Po Box 252 Lakes Laroe Roads
Monroe, NY 10950
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Monroe Day School",'Monroe=' + Monroe.length); Walden[Walden.length] = createMarker(new GPoint(-74.18554500,41.56913800),"
Most Precious Blood School
180 Ulster Avenue
Walden, NY 12586
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Most Precious Blood School",'Walden=' + Walden.length); Middletown[Middletown.length] = createMarker(new GPoint(-74.40905500,41.45017800),"
New Beginnings Montessori
33 Albert Street
Middletown, NY 10940
Co-ed school, K-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Beginnings Montessori",'Middletown=' + Middletown.length); Newburgh[Newburgh.length] = createMarker(new GPoint(-74.00934800,41.50844100),"
Newburgh Jabemacle Elementary School
251-9 Grand Street
Newburgh, NY 12550
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Newburgh Jabemacle Elementary School",'Newburgh=' + Newburgh.length); Middletown[Middletown.length] = createMarker(new GPoint(-74.44221700,41.46254900),"
Nysarc-orange Inc
28 Ingrassia Road
Middletown, NY 10940
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nysarc-orange Inc",'Middletown=' + Middletown.length); Middletown[Middletown.length] = createMarker(new GPoint(-74.43495800,41.43229000),"
Our Lady Of Mount Carmel School
205 Wawayanda Avenue
Middletown, NY 10940
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Mount Carmel School",'Middletown=' + Middletown.length); Highland_Falls[Highland_Falls.length] = createMarker(new GPoint(-73.96497100,41.37232900),"
Sacred Heart of Jesus School
7 Cozzens Avenue
Highland Falls, NY 10928
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart of Jesus School",'Highland_Falls=' + Highland_Falls.length); Monroe[Monroe.length] = createMarker(new GPoint(-74.17936100,41.31657400),"
Sacred Heart School
26 Still Road
Monroe, NY 10950
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart School",'Monroe=' + Monroe.length); Newburgh[Newburgh.length] = createMarker(new GPoint(-74.02166200,41.49958500),"
Sacred Heart School
24 S Robinson Avenue
Newburgh, NY 12550
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart School",'Newburgh=' + Newburgh.length); Goshen[Goshen.length] = createMarker(new GPoint(-74.32572900,41.40588500),"
St. John School
77 Murray Avenue
Goshen, NY 10924
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John School",'Goshen=' + Goshen.length); Cornwall_On_Hudson[Cornwall_On_Hudson.length] = createMarker(new GPoint(-74.02245700,41.44386400),"
St. Thomas Of Canterbury
336 Hudson Street
Cornwall On Hudson, NY 12520
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Thomas Of Canterbury",'Cornwall_On_Hudson=' + Cornwall_On_Hudson.length); Monroe[Monroe.length] = createMarker(new GPoint(-74.18712900,41.32812000),"
Sheri Torah, Inc. V'yoel Moshe
Po Box 2027
Monroe, NY 10949
All-boys school, PK-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sheri Torah, Inc. V'yoel Moshe",'Monroe=' + Monroe.length); New_Windsor[New_Windsor.length] = createMarker(new GPoint(-74.04062400,41.48014700),"
St Joseph School
148 Windsor Highway
New Windsor, NY 12553
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Joseph School",'New_Windsor=' + New_Windsor.length); Florida[Florida.length] = createMarker(new GPoint(-74.35527200,41.33252900),"
St Joseph School
21 Glenmere Avenue
Florida, NY 10921
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Joseph School",'Florida=' + Florida.length); Middletown[Middletown.length] = createMarker(new GPoint(-74.41146200,41.45203700),"
St Joseph School
113 Cottage Street
Middletown, NY 10940
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Joseph School",'Middletown=' + Middletown.length); Monroe[Monroe.length] = createMarker(new GPoint(-74.17874800,41.31822000),"
St Paul Christian Education Center
21 Still Road
Monroe, NY 10950
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Paul Christian Education Center",'Monroe=' + Monroe.length); Warwick[Warwick.length] = createMarker(new GPoint(-74.38808300,41.25641600),"
St Stephen St Edward School
75 Sanfordville Road
Warwick, NY 10990
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Stephen St Edward School",'Warwick=' + Warwick.length); Cornwall_On_Hudson[Cornwall_On_Hudson.length] = createMarker(new GPoint(-87.65601400,41.96984600),"
St Thomas Of Canterbury School
336 Hudson Street
Cornwall On Hudson, NY 12520
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Thomas Of Canterbury School",'Cornwall_On_Hudson=' + Cornwall_On_Hudson.length); Highland_Mills[Highland_Mills.length] = createMarker(new GPoint(-74.11897500,41.35904200),"
Thevenet Montessori School
21 Bethany Drive
Highland Mills, NY 10930
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Thevenet Montessori School",'Highland_Mills=' + Highland_Mills.length); Port_Jervis[Port_Jervis.length] = createMarker(new GPoint(-74.66020000,41.37590000),"
Trinity Catholic School
Po Box 1001
Port Jervis, NY 12771
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Catholic School",'Port_Jervis=' + Port_Jervis.length); Tuxedo_Park[Tuxedo_Park.length] = createMarker(new GPoint(-74.21250900,41.21346200),"
Tuxedo Park School
Mountain Farm Rd
Tuxedo Park, NY 10987
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tuxedo Park School",'Tuxedo_Park=' + Tuxedo_Park.length); New_Windsor[New_Windsor.length] = createMarker(new GPoint(-74.02763800,41.47050900),"
Windsor Academy
271 Quassaick Ave
New Windsor, NY 12553
Co-ed school, NS-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Windsor Academy",'New_Windsor=' + New_Windsor.length); New_Windsor[New_Windsor.length] = createMarker(new GPoint(-74.10355600,41.48312900),"
Woodland Montessori
1145 Little Britain Rd Sut 200
New Windsor, NY 12553
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodland Montessori",'New_Windsor=' + New_Windsor.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(Cornwall_On_Hudson); map.removeOverlays(Florida); map.removeOverlays(Goshen); map.removeOverlays(Highland_Falls); map.removeOverlays(Highland_Mills); map.removeOverlays(Middletown); map.removeOverlays(Monroe); map.removeOverlays(New_Windsor); map.removeOverlays(Newburgh); map.removeOverlays(Pine_Bush); map.removeOverlays(Port_Jervis); map.removeOverlays(Tuxedo_Park); map.removeOverlays(Walden); map.removeOverlays(Warwick); map.removeOverlays(Washingtonville); 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(Monroe);map.removeOverlays(Cornwall_On_Hudson); map.removeOverlays(Florida); map.removeOverlays(Goshen); map.removeOverlays(Highland_Falls); map.removeOverlays(Highland_Mills); map.removeOverlays(Middletown); map.removeOverlays(Monroe); map.removeOverlays(New_Windsor); map.removeOverlays(Newburgh); map.removeOverlays(Pine_Bush); map.removeOverlays(Port_Jervis); map.removeOverlays(Tuxedo_Park); map.removeOverlays(Walden); map.removeOverlays(Warwick); map.removeOverlays(Washingtonville); map.addOverlays(Cornwall_On_Hudson); centerByArray(Cornwall_On_Hudson, false, false); cntMarker += Cornwall_On_Hudson.length; map.addOverlays(Florida); centerByArray(Florida, false, false); cntMarker += Florida.length; map.addOverlays(Goshen); centerByArray(Goshen, false, false); cntMarker += Goshen.length; map.addOverlays(Highland_Falls); centerByArray(Highland_Falls, false, false); cntMarker += Highland_Falls.length; map.addOverlays(Highland_Mills); centerByArray(Highland_Mills, false, false); cntMarker += Highland_Mills.length; map.addOverlays(Middletown); centerByArray(Middletown, false, false); cntMarker += Middletown.length; map.addOverlays(Monroe); centerByArray(Monroe, false, false); cntMarker += Monroe.length; map.addOverlays(New_Windsor); centerByArray(New_Windsor, false, false); cntMarker += New_Windsor.length; map.addOverlays(Newburgh); centerByArray(Newburgh, false, false); cntMarker += Newburgh.length; map.addOverlays(Pine_Bush); centerByArray(Pine_Bush, false, false); cntMarker += Pine_Bush.length; map.addOverlays(Port_Jervis); centerByArray(Port_Jervis, false, false); cntMarker += Port_Jervis.length; map.addOverlays(Tuxedo_Park); centerByArray(Tuxedo_Park, false, false); cntMarker += Tuxedo_Park.length; map.addOverlays(Walden); centerByArray(Walden, false, false); cntMarker += Walden.length; map.addOverlays(Warwick); centerByArray(Warwick, false, false); cntMarker += Warwick.length; map.addOverlays(Washingtonville); centerByArray(Washingtonville, false, false); cntMarker += Washingtonville.length; centerByArray(Monroe,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; }