function addMarkers(){ mySelect = document.getElementById('selection'); South_Roxana = [];Alton = [];Granite_City = [];Collinsville = [];Godfrey = [];Glen_Carbon = [];Bethalto = [];Wood_River = [];Maryville = [];Edwardsville = [];Highland = [];Troy = [];Dorsey = [];East_Alton = [];Worden = [];mySelect.options[mySelect.options.length] = new Option("Alton schools",'all=Alton'); mySelect.options[mySelect.options.length] = new Option("Bethalto schools",'all=Bethalto'); mySelect.options[mySelect.options.length] = new Option("Collinsville schools",'all=Collinsville'); mySelect.options[mySelect.options.length] = new Option("Dorsey schools",'all=Dorsey'); mySelect.options[mySelect.options.length] = new Option("East Alton schools",'all=East_Alton'); mySelect.options[mySelect.options.length] = new Option("Edwardsville schools",'all=Edwardsville'); mySelect.options[mySelect.options.length] = new Option("Glen Carbon schools",'all=Glen_Carbon'); mySelect.options[mySelect.options.length] = new Option("Godfrey schools",'all=Godfrey'); mySelect.options[mySelect.options.length] = new Option("Granite City schools",'all=Granite_City'); mySelect.options[mySelect.options.length] = new Option("Highland schools",'all=Highland'); mySelect.options[mySelect.options.length] = new Option("Maryville schools",'all=Maryville'); mySelect.options[mySelect.options.length] = new Option("South Roxana schools",'all=South_Roxana'); mySelect.options[mySelect.options.length] = new Option("Troy schools",'all=Troy'); mySelect.options[mySelect.options.length] = new Option("Wood River schools",'all=Wood_River'); mySelect.options[mySelect.options.length] = new Option("Worden schools",'all=Worden'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); South_Roxana[South_Roxana.length] = createMarker(new GPoint(-90.05870000,38.82810000),"
Bethel Christian Academy
Po Box 535 1417 Herbert St
South Roxana, IL 62087
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethel Christian Academy",'South_Roxana=' + South_Roxana.length); Alton[Alton.length] = createMarker(new GPoint(-90.19393000,38.90427300),"
Catholic Childrens Home
1400 State Street
Alton, IL 62002
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Catholic Childrens Home",'Alton=' + Alton.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.07070300,38.72975400),"
Central Baptist School
3940 Highway 111
Granite City, IL 62040
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Baptist School",'Granite_City=' + Granite_City.length); Collinsville[Collinsville.length] = createMarker(new GPoint(-89.97793600,38.68248700),"
Collinsville Christian Academy
1203 Vandalia Street
Collinsville, IL 62234
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Collinsville Christian Academy",'Collinsville=' + Collinsville.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.14603100,38.69978200),"
Coordinated Youth & Human Services
2016 Madison Avenue
Granite City, IL 62040
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Coordinated Youth & Human Services",'Granite_City=' + Granite_City.length); Godfrey[Godfrey.length] = createMarker(new GPoint(-90.21476100,38.94824800),"
Evangelical School
1212 H Adams Pkwy W
Godfrey, IL 62035
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Evangelical School",'Godfrey=' + Godfrey.length); Glen_Carbon[Glen_Carbon.length] = createMarker(new GPoint(-89.97077400,38.76467700),"
Faith Baptist Academy
3899 S State Rt 139
Glen Carbon, IL 62034
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Baptist Academy",'Glen_Carbon=' + Glen_Carbon.length); Godfrey[Godfrey.length] = createMarker(new GPoint(-90.19341200,38.96906800),"
Faith Lutheran School
6809 Godfrey Road
Godfrey, IL 62035
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Lutheran School",'Godfrey=' + Godfrey.length); Collinsville[Collinsville.length] = createMarker(new GPoint(-89.99198000,38.69125200),"
Good Shepherd Lutheran School
1300 Belt Line Road
Collinsville, IL 62234
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Good Shepherd Lutheran School",'Collinsville=' + Collinsville.length); Collinsville[Collinsville.length] = createMarker(new GPoint(-89.98827500,38.66561500),"
Holy Cross Lutheran School
413 S Seminary Street
Collinsville, IL 62234
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Cross Lutheran School",'Collinsville=' + Collinsville.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.11732300,38.71686300),"
Holy Family
1900 Saint Clair Avenue
Granite City, IL 62040
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Family",'Granite_City=' + Granite_City.length); South_Roxana[South_Roxana.length] = createMarker(new GPoint(-90.05970000,38.82620000),"
Hope Christian Academy
Box 518
South Roxana, IL 62087
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hope Christian Academy",'South_Roxana=' + South_Roxana.length); Glen_Carbon[Glen_Carbon.length] = createMarker(new GPoint(-89.97099600,38.76185300),"
Lahr-well Academy
131 N Main St, PO Box 401
Glen Carbon, IL 62034
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lahr-well Academy",'Glen_Carbon=' + Glen_Carbon.length); Alton[Alton.length] = createMarker(new GPoint(-90.14527700,38.90721700),"
Mississippi Valley Christian School
2009 Seminary Street
Alton, IL 62002
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mississippi Valley Christian School",'Alton=' + Alton.length); Godfrey[Godfrey.length] = createMarker(new GPoint(-90.19097500,38.95113900),"
Montessori Children's House
5800 Godfrey Road
Godfrey, IL 62035
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Children's House",'Godfrey=' + Godfrey.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.06122800,38.72554100),"
Montessori School
4405 State Route 162
Granite City, IL 62040
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori School",'Granite_City=' + Granite_City.length); Bethalto[Bethalto.length] = createMarker(new GPoint(-90.04081800,38.91290100),"
Our Lady Queen-peace School
618 N Prairie Street
Bethalto, IL 62010
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Queen-peace School",'Bethalto=' + Bethalto.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.12175000,38.76197400),"
Rivers of Life Christian School
3237 W Chain of Rocks
Granite City, IL 62040
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rivers of Life Christian School",'Granite_City=' + Granite_City.length); Wood_River[Wood_River.length] = createMarker(new GPoint(-90.08997500,38.86294000),"
St. Bernard School
200 N Fourth St
Wood River, IL 62095
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Bernard School",'Wood_River=' + Wood_River.length); Maryville[Maryville.length] = createMarker(new GPoint(-89.95904900,38.71047200),"
St. John Neumann Catholic School
142 Wilma Drive
Maryville, IL 62062
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John Neumann Catholic School",'Maryville=' + Maryville.length); Edwardsville[Edwardsville.length] = createMarker(new GPoint(-89.94742200,38.79284600),"
St. Mary Elementary School
1802 Madison Avenue
Edwardsville, IL 62025
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary Elementary School",'Edwardsville=' + Edwardsville.length); Alton[Alton.length] = createMarker(new GPoint(-90.17824800,38.89060000),"
St. Mary School
536 E 3rd Street
Alton, IL 62002
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary School",'Alton=' + Alton.length); Highland[Highland.length] = createMarker(new GPoint(-89.67357000,38.74036300),"
St. Paul Catholic School
1416 Main St.
Highland, IL 62249
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Paul Catholic School",'Highland=' + Highland.length); Troy[Troy.length] = createMarker(new GPoint(-89.88518000,38.73045700),"
St. Paul Lutheran School
112 N Border Street
Troy, IL 62294
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Paul Lutheran School",'Troy=' + Troy.length); Dorsey[Dorsey.length] = createMarker(new GPoint(-89.92588300,38.96626200),"
St. Peters Lutheran School
7182 Renken Road
Dorsey, IL 62021
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Peters Lutheran School",'Dorsey=' + Dorsey.length); Alton[Alton.length] = createMarker(new GPoint(-90.19049300,38.89559700),"
Ss Peter & Paul Elementary School
801 State Street
Alton, IL 62002
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ss Peter & Paul Elementary School",'Alton=' + Alton.length); Collinsville[Collinsville.length] = createMarker(new GPoint(-89.98529900,38.67168700),"
Ss Peter & Paul School
210 N Morrison Avenue
Collinsville, IL 62234
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ss Peter & Paul School",'Collinsville=' + Collinsville.length); Godfrey[Godfrey.length] = createMarker(new GPoint(-90.19470000,38.92488500),"
St Ambrose School
822 W Homer M Adams Parkway
Godfrey, IL 62035
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Ambrose School",'Godfrey=' + Godfrey.length); Edwardsville[Edwardsville.length] = createMarker(new GPoint(-89.95308200,38.81245200),"
St Boniface Catholic School
128 N Buchanan Street
Edwardsville, IL 62025
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Boniface Catholic School",'Edwardsville=' + Edwardsville.length); Granite_City[Granite_City.length] = createMarker(new GPoint(-90.10802300,38.73146300),"
St Elizabeth Elementary School
2300 Pontoon Road
Granite City, IL 62040
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Elizabeth Elementary School",'Granite_City=' + Granite_City.length); East_Alton[East_Alton.length] = createMarker(new GPoint(-90.09793300,38.87778800),"
Toddle Towne Learning Center
229 Whitelaw Avenue
East Alton, IL 62024
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Toddle Towne Learning Center",'East_Alton=' + East_Alton.length); Alton[Alton.length] = createMarker(new GPoint(-90.15172700,38.93000100),"
Toddle Towne Learning Center
3839 Humbert Road
Alton, IL 62002
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Toddle Towne Learning Center",'Alton=' + Alton.length); Edwardsville[Edwardsville.length] = createMarker(new GPoint(-89.95284900,38.81676300),"
Trinity Lutheran School
600 Water Street
Edwardsville, IL 62025
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Edwardsville=' + Edwardsville.length); Worden[Worden.length] = createMarker(new GPoint(-89.82488800,38.90787700),"
Trinity St Paul Lutheran School
6961 W Frontage Road
Worden, IL 62097
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity St Paul Lutheran School",'Worden=' + Worden.length); Alton[Alton.length] = createMarker(new GPoint(-90.09859000,38.86543000),"
Westminster Christian Academy-river Bend
1145 College Avenue
Alton, IL 62002
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westminster Christian Academy-river Bend",'Alton=' + Alton.length); Wood_River[Wood_River.length] = createMarker(new GPoint(-90.10303400,38.85593700),"
Wm Bedell Achiev/resource Center
400 S Main St
Wood River, IL 62095
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wm Bedell Achiev/resource Center",'Wood_River=' + Wood_River.length); Bethalto[Bethalto.length] = createMarker(new GPoint(-90.03188000,38.90011700),"
Zion Lutheran School
625 Church Drive
Bethalto, IL 62010
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zion Lutheran School",'Bethalto=' + Bethalto.length); Bethalto[Bethalto.length] = createMarker(new GPoint(-90.03184100,38.90014700),"
Zion Lutheran School And Preschool
625 Church Drive
Bethalto, IL 62010
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zion Lutheran School And Preschool",'Bethalto=' + Bethalto.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(Alton); map.removeOverlays(Bethalto); map.removeOverlays(Collinsville); map.removeOverlays(Dorsey); map.removeOverlays(East_Alton); map.removeOverlays(Edwardsville); map.removeOverlays(Glen_Carbon); map.removeOverlays(Godfrey); map.removeOverlays(Granite_City); map.removeOverlays(Highland); map.removeOverlays(Maryville); map.removeOverlays(South_Roxana); map.removeOverlays(Troy); map.removeOverlays(Wood_River); map.removeOverlays(Worden); 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(South_Roxana);map.removeOverlays(Alton); map.removeOverlays(Bethalto); map.removeOverlays(Collinsville); map.removeOverlays(Dorsey); map.removeOverlays(East_Alton); map.removeOverlays(Edwardsville); map.removeOverlays(Glen_Carbon); map.removeOverlays(Godfrey); map.removeOverlays(Granite_City); map.removeOverlays(Highland); map.removeOverlays(Maryville); map.removeOverlays(South_Roxana); map.removeOverlays(Troy); map.removeOverlays(Wood_River); map.removeOverlays(Worden); map.addOverlays(Alton); centerByArray(Alton, false, false); cntMarker += Alton.length; map.addOverlays(Bethalto); centerByArray(Bethalto, false, false); cntMarker += Bethalto.length; map.addOverlays(Collinsville); centerByArray(Collinsville, false, false); cntMarker += Collinsville.length; map.addOverlays(Dorsey); centerByArray(Dorsey, false, false); cntMarker += Dorsey.length; map.addOverlays(East_Alton); centerByArray(East_Alton, false, false); cntMarker += East_Alton.length; map.addOverlays(Edwardsville); centerByArray(Edwardsville, false, false); cntMarker += Edwardsville.length; map.addOverlays(Glen_Carbon); centerByArray(Glen_Carbon, false, false); cntMarker += Glen_Carbon.length; map.addOverlays(Godfrey); centerByArray(Godfrey, false, false); cntMarker += Godfrey.length; map.addOverlays(Granite_City); centerByArray(Granite_City, false, false); cntMarker += Granite_City.length; map.addOverlays(Highland); centerByArray(Highland, false, false); cntMarker += Highland.length; map.addOverlays(Maryville); centerByArray(Maryville, false, false); cntMarker += Maryville.length; map.addOverlays(South_Roxana); centerByArray(South_Roxana, false, false); cntMarker += South_Roxana.length; map.addOverlays(Troy); centerByArray(Troy, false, false); cntMarker += Troy.length; map.addOverlays(Wood_River); centerByArray(Wood_River, false, false); cntMarker += Wood_River.length; map.addOverlays(Worden); centerByArray(Worden, false, false); cntMarker += Worden.length; centerByArray(South_Roxana,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; }