function addMarkers(){ mySelect = document.getElementById('selection'); Rockford = [];Machesney_Park = [];Loves_Park = [];South_Beloit = [];mySelect.options[mySelect.options.length] = new Option("Loves Park schools",'all=Loves_Park'); mySelect.options[mySelect.options.length] = new Option("Machesney Park schools",'all=Machesney_Park'); mySelect.options[mySelect.options.length] = new Option("Rockford schools",'all=Rockford'); mySelect.options[mySelect.options.length] = new Option("South Beloit schools",'all=South_Beloit'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Rockford[Rockford.length] = createMarker(new GPoint(-89.02881400,42.26797700),"
Alpine Christian School
325 North Alpine Road
Rockford, IL 61107
Co-ed school, -
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alpine Christian School",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.14768900,42.30245900),"
Berean Baptist Christian School
5626 Safford Road
Rockford, IL 61101
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Berean Baptist Christian School",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.00064000,42.29693700),"
Christian Life Schools
5950 Spring Creek Road
Rockford, IL 61114
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Life Schools",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.10378400,42.29049800),"
Christian Union Child Care Academy
1705 Kilburn Av
Rockford, IL 61101
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Union Child Care Academy",'Rockford=' + Rockford.length); Machesney_Park[Machesney_Park.length] = createMarker(new GPoint(-89.05548200,42.33274000),"
Concordia Lutheran School
7424 North 2nd Street
Machesney Park, IL 61115
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Concordia Lutheran School",'Machesney_Park=' + Machesney_Park.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.12714400,42.22301000),"
Faith Academy
4000 Prairie Rd
Rockford, IL 61102
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Academy",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.05731400,42.21833600),"
Faith Tabernacle Christian School
4312 20th Street
Rockford, IL 61109
Co-ed school, 5-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Tabernacle Christian School",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.03097500,42.28535500),"
Holy Family Catholic School
4407 Highcrest Road
Rockford, IL 61107
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Family Catholic School",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.09413800,42.27653000),"
House Of Grace Christian School
518 N Court St
Rockford, IL 61103
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("House Of Grace Christian School",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.06063500,42.28612900),"
Keith Country Day School
1 Jacoby Place
Rockford, IL 61107
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Keith Country Day School",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-88.99983900,42.27101000),"
Kindercare Learning Center
308 N. Mulford
Rockford, IL 61107
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kindercare Learning Center",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-88.99054300,42.31855800),"
KinderCare Learning Center
6473 E Riverside Blvd
Rockford, IL 61114
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("KinderCare Learning Center",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.01630200,42.25016300),"
Luther Academy At Alpine
5001 Forest View Ave
Rockford, IL 61108
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Luther Academy At Alpine",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.02898000,42.30880500),"
Lutheran High School
3411 N Alpine Road
Rockford, IL 61114
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lutheran High School",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.10419100,42.33203700),"
The Mill School
3445 Elmwood Road
Rockford, IL 61101
Co-ed school, 4-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Mill School",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.08801600,42.26933100),"
Montessori Learning Path Ltd
200 N 1st Street
Rockford, IL 61107
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Learning Path Ltd",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.00070800,42.23636300),"
Montessori Private Academy
5925 Darlene Drive
Rockford, IL 61109
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Private Academy",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.11848600,42.27637000),"
Mt Sinai Learning Academy
1901 W State Street
Rockford, IL 61102
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mt Sinai Learning Academy",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.01451900,42.31836300),"
North Love Christian
5301 E Riverside Blvd
Rockford, IL 61114
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Love Christian",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.03552100,42.31524000),"
Rainbow Academy
6413 Forest Hills Road
Rockford, IL 61114
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rainbow Academy",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.17381900,42.28389300),"
Regents Christian Academy
7007 Flora Road
Rockford, IL 61101
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Regents Christian Academy",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-88.97015400,42.28553900),"
Rockford Christian Schools
1401 N Bell School Road
Rockford, IL 61107
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rockford Christian Schools",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.10249700,42.30096300),"
Rockford Health System Children
2918 Glenwood Avenue
Rockford, IL 61101
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rockford Health System Children",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.00082400,42.23637100),"
Rockford Iqra School
5921 Darlene Dr
Rockford, IL 61109
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rockford Iqra School",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.02516700,42.28609900),"
Rockford Lutheran Academy
4700 Augustana Drive
Rockford, IL 61107
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rockford Lutheran Academy",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.09405800,42.29828900),"
St. Bernadette Elementary School
2300 North Bell Avenue
Rockford, IL 61103
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Bernadette Elementary School",'Rockford=' + Rockford.length); Loves_Park[Loves_Park.length] = createMarker(new GPoint(-89.05405200,42.31797900),"
St. Bridget School
604 Clifford Avenue
Loves Park, IL 61111
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Bridget School",'Loves_Park=' + Loves_Park.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.07697200,42.30447000),"
Spectrum School
2909 N Main St
Rockford, IL 61103
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Spectrum School",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.07201400,42.22995800),"
St Edward School
3020 11th Street
Rockford, IL 61109
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Edward School",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.08608800,42.27110000),"
St James Catholic School
409 N 1st Street
Rockford, IL 61107
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St James Catholic School",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.11186500,42.25363700),"
St Paul Academy
1001 Bishop Washington Avenue
Rockford, IL 61102
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Paul Academy",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.09838900,42.27843700),"
St Paul Lutheran School
811 Locust Street
Rockford, IL 61101
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Paul Lutheran School",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.08422700,42.28504000),"
St Peter Cathedral
1231 N Court Street
Rockford, IL 61103
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Peter Cathedral",'Rockford=' + Rockford.length); South_Beloit[South_Beloit.length] = createMarker(new GPoint(-89.03978900,42.48910800),"
St Peter Catholic School
320 Elmwood Avenue
South Beloit, IL 61080
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Peter Catholic School",'South_Beloit=' + South_Beloit.length); Rockford[Rockford.length] = createMarker(new GPoint(-88.99337100,42.23564700),"
St Rita Catholic School
6284 Valley Knoll Drive
Rockford, IL 61109
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Rita Catholic School",'Rockford=' + Rockford.length); Loves_Park[Loves_Park.length] = createMarker(new GPoint(-89.02830200,42.34076400),"
Walter Lawson Childrens Home
1820 Walter Lawson Dr
Loves Park, IL 61111
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Walter Lawson Childrens Home",'Loves_Park=' + Loves_Park.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.07305800,42.26679100),"
Wee Care Child Care Center
1421 E State Street
Rockford, IL 61104
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wee Care Child Care Center",'Rockford=' + Rockford.length); Rockford[Rockford.length] = createMarker(new GPoint(-89.11739800,42.26350300),"
Westside Christian Academy
1523 Morgan Street
Rockford, IL 61102
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westside Christian Academy",'Rockford=' + Rockford.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(Loves_Park); map.removeOverlays(Machesney_Park); map.removeOverlays(Rockford); map.removeOverlays(South_Beloit); 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(Rockford);map.removeOverlays(Loves_Park); map.removeOverlays(Machesney_Park); map.removeOverlays(Rockford); map.removeOverlays(South_Beloit); map.addOverlays(Loves_Park); centerByArray(Loves_Park, false, false); cntMarker += Loves_Park.length; map.addOverlays(Machesney_Park); centerByArray(Machesney_Park, false, false); cntMarker += Machesney_Park.length; map.addOverlays(Rockford); centerByArray(Rockford, false, false); cntMarker += Rockford.length; map.addOverlays(South_Beloit); centerByArray(South_Beloit, false, false); cntMarker += South_Beloit.length; centerByArray(Rockford,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; }