function addMarkers(){ mySelect = document.getElementById('selection'); Dupo = [];Fairview_Heights = [];Belleville = [];East_Saint_Louis = [];Fairview_Hgts = [];Caseyville = [];Cahokia = [];Ofallon = [];East_St_Louis = [];Mascoutah = [];Fairmont_City = [];Smithton = [];Freeburg = [];New_Athens = [];Millstadt = [];mySelect.options[mySelect.options.length] = new Option("Belleville schools",'all=Belleville'); mySelect.options[mySelect.options.length] = new Option("Cahokia schools",'all=Cahokia'); mySelect.options[mySelect.options.length] = new Option("Caseyville schools",'all=Caseyville'); mySelect.options[mySelect.options.length] = new Option("Dupo schools",'all=Dupo'); mySelect.options[mySelect.options.length] = new Option("East Saint Louis schools",'all=East_Saint_Louis'); mySelect.options[mySelect.options.length] = new Option("East St Louis schools",'all=East_St_Louis'); mySelect.options[mySelect.options.length] = new Option("Fairmont City schools",'all=Fairmont_City'); mySelect.options[mySelect.options.length] = new Option("Fairview Heights schools",'all=Fairview_Heights'); mySelect.options[mySelect.options.length] = new Option("Fairview Hgts schools",'all=Fairview_Hgts'); mySelect.options[mySelect.options.length] = new Option("Freeburg schools",'all=Freeburg'); mySelect.options[mySelect.options.length] = new Option("Mascoutah schools",'all=Mascoutah'); mySelect.options[mySelect.options.length] = new Option("Millstadt schools",'all=Millstadt'); mySelect.options[mySelect.options.length] = new Option("New Athens schools",'all=New_Athens'); mySelect.options[mySelect.options.length] = new Option("Ofallon schools",'all=Ofallon'); mySelect.options[mySelect.options.length] = new Option("Smithton schools",'all=Smithton'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Dupo[Dupo.length] = createMarker(new GPoint(-90.20917300,38.51574300),"
Apostolic Learning Academy
400 Louisa Avenue
Dupo, IL 62239
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Apostolic Learning Academy",'Dupo=' + Dupo.length); Fairview_Heights[Fairview_Heights.length] = createMarker(new GPoint(-89.98469400,38.57735900),"
Berean Christian School
5100 North Illinois St.
Fairview Heights, IL 62208
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Berean Christian School",'Fairview_Heights=' + Fairview_Heights.length); Belleville[Belleville.length] = createMarker(new GPoint(-90.05363000,38.57210800),"
Blessed Sacrament Elementary School
8809 West Main Street
Belleville, IL 62223
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blessed Sacrament Elementary School",'Belleville=' + Belleville.length); Belleville[Belleville.length] = createMarker(new GPoint(-89.96919100,38.52313500),"
Calvary Baptist Academy
423 Lucinda Avenue
Belleville, IL 62221
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Baptist Academy",'Belleville=' + Belleville.length); Belleville[Belleville.length] = createMarker(new GPoint(-89.98672400,38.51156200),"
Cathedral Grade School
200 S 2nd Street
Belleville, IL 62220
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cathedral Grade School",'Belleville=' + Belleville.length); East_Saint_Louis[East_Saint_Louis.length] = createMarker(new GPoint(-90.14993900,38.63021400),"
Catholic Daycare Center
617 Summit Avenue
East Saint Louis, IL 62201
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Catholic Daycare Center",'East_Saint_Louis=' + East_Saint_Louis.length); East_Saint_Louis[East_Saint_Louis.length] = createMarker(new GPoint(-90.06873500,38.58438800),"
Childrens Center For Behavioral Development
353 N 88th Street
East Saint Louis, IL 62203
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Childrens Center For Behavioral Development",'East_Saint_Louis=' + East_Saint_Louis.length); Fairview_Hgts[Fairview_Hgts.length] = createMarker(new GPoint(-90.02008200,38.60939000),"
Cornerstone Christian School
9815 Bunkum Rd
Fairview Hgts, IL 62208
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone Christian School",'Fairview_Hgts=' + Fairview_Hgts.length); Caseyville[Caseyville.length] = createMarker(new GPoint(-90.02737500,38.63956400),"
Cornerstone Christian School
111 S 2nd Street
Caseyville, IL 62232
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone Christian School",'Caseyville=' + Caseyville.length); Cahokia[Cahokia.length] = createMarker(new GPoint(-90.18834500,38.57051300),"
Corpus Christi Elementary School
116 E 1st Street
Cahokia, IL 62206
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Corpus Christi Elementary School",'Cahokia=' + Cahokia.length); East_Saint_Louis[East_Saint_Louis.length] = createMarker(new GPoint(-90.16314400,38.62622000),"
Crossroads Preparatory Academy
Po Box 2405
East Saint Louis, IL 62202
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crossroads Preparatory Academy",'East_Saint_Louis=' + East_Saint_Louis.length); Ofallon[Ofallon.length] = createMarker(new GPoint(-89.92643200,38.59950100),"
Discovery School
810 Obernuefemann Road
O''fallon, IL 62269
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Discovery School",'Ofallon=' + Ofallon.length); Fairview_Hgts[Fairview_Hgts.length] = createMarker(new GPoint(-90.01611100,38.60410300),"
Elizabeth Ann Seton Catholic
9940 Bunkum Rd
Fairview Hgts, IL 62208
Co-ed school, KG-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elizabeth Ann Seton Catholic",'Fairview_Hgts=' + Fairview_Hgts.length); Belleville[Belleville.length] = createMarker(new GPoint(-89.97880600,38.51373700),"
Faith Baptist School
405 E Main Street
Belleville, IL 62220
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Baptist School",'Belleville=' + Belleville.length); Ofallon[Ofallon.length] = createMarker(new GPoint(-89.89265100,38.58106900),"
First Baptist Academy
1111 E Highway 50
O''fallon, IL 62269
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Baptist Academy",'Ofallon=' + Ofallon.length); Belleville[Belleville.length] = createMarker(new GPoint(-89.98088700,38.50260000),"
The Governor French Academy
219 West Main Street
Belleville, IL 62220
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Governor French Academy",'Belleville=' + Belleville.length); East_St_Louis[East_St_Louis.length] = createMarker(new GPoint(-90.12397900,38.61430700),"
Hazel Bland Promise Center
2900 State St
East St Louis, IL 62205
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hazel Bland Promise Center",'East_St_Louis=' + East_St_Louis.length); Mascoutah[Mascoutah.length] = createMarker(new GPoint(-89.79147400,38.49195000),"
Holy Childhood School
215 N John Street
Mascoutah, IL 62258
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Childhood School",'Mascoutah=' + Mascoutah.length); Fairmont_City[Fairmont_City.length] = createMarker(new GPoint(-90.10537500,38.64600000),"
Holy Rosary School
2727 N 43rd Street
Fairmont City, IL 62201
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Rosary School",'Fairmont_City=' + Fairmont_City.length); Fairview_Heights[Fairview_Heights.length] = createMarker(new GPoint(-89.98433000,38.59293700),"
Holy Trinity Catholic School
9940 Bunkum Road
Fairview Heights, IL 62208
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Trinity Catholic School",'Fairview_Heights=' + Fairview_Heights.length); Belleville[Belleville.length] = createMarker(new GPoint(-89.86018300,38.52634100),"
Hope Christian School
4101 E Highway 161
Belleville, IL 62221
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hope Christian School",'Belleville=' + Belleville.length); Fairview_Hgts[Fairview_Hgts.length] = createMarker(new GPoint(-89.99435200,38.58220400),"
Illinois Center For Autism
548 S Ruby Lane
Fairview Hgts, IL 62208
Co-ed school, NS-NS
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Illinois Center For Autism",'Fairview_Hgts=' + Fairview_Hgts.length); Belleville[Belleville.length] = createMarker(new GPoint(-89.96689100,38.49978600),"
Mamie O Stookey School
1306 Wabash Ave
Belleville, IL 62220
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mamie O Stookey School",'Belleville=' + Belleville.length); Belleville[Belleville.length] = createMarker(new GPoint(-89.94482700,38.54826500),"
Montessori School-st. Clair
2360 Country Road
Belleville, IL 62221
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori School-st. Clair",'Belleville=' + Belleville.length); Belleville[Belleville.length] = createMarker(new GPoint(-90.03810500,38.54190100),"
Our Lady Queen Of Peace School
5915 N Belt W
Belleville, IL 62223
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Queen Of Peace School",'Belleville=' + Belleville.length); Smithton[Smithton.length] = createMarker(new GPoint(-89.99412400,38.40842000),"
St. John The Baptist School
10 S Lincoln Street
Smithton, IL 62285
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John The Baptist School",'Smithton=' + Smithton.length); Freeburg[Freeburg.length] = createMarker(new GPoint(-89.90984000,38.42665500),"
St. Joseph School
2 N Alton Street
Freeburg, IL 62243
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph School",'Freeburg=' + Freeburg.length); Belleville[Belleville.length] = createMarker(new GPoint(-90.00677400,38.53986300),"
St. Mary - St. Augustine Catholic School
1900 W Belle Street
Belleville, IL 62226
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary - St. Augustine Catholic School",'Belleville=' + Belleville.length); Belleville[Belleville.length] = createMarker(new GPoint(-89.97256600,38.52800900),"
St. Teresa Catholic School
1108 Lebanon Avenue
Belleville, IL 62221
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Teresa Catholic School",'Belleville=' + Belleville.length); East_Saint_Louis[East_Saint_Louis.length] = createMarker(new GPoint(-90.06226000,38.60033500),"
Sister Thea Bowman Catholic School
8213 Church Lane
East Saint Louis, IL 62203
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sister Thea Bowman Catholic School",'East_Saint_Louis=' + East_Saint_Louis.length); New_Athens[New_Athens.length] = createMarker(new GPoint(-89.87590100,38.32347200),"
St Agatha Elementary School
207 S Market Street
New Athens, IL 62264
Co-ed school, K-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Agatha Elementary School",'New_Athens=' + New_Athens.length); Ofallon[Ofallon.length] = createMarker(new GPoint(-89.91283600,38.59036200),"
St Clare Catholic School
214 W 3rd Street
O''fallon, IL 62269
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Clare Catholic School",'Ofallon=' + Ofallon.length); Millstadt[Millstadt.length] = createMarker(new GPoint(-90.09608900,38.46136300),"
St James School
412 West Washington Street
Millstadt, IL 62260
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St James School",'Millstadt=' + Millstadt.length); East_Saint_Louis[East_Saint_Louis.length] = createMarker(new GPoint(-90.10614300,38.63054400),"
Unity Lutheran Christian Elementary School
4200 Caseyville Avenue
East Saint Louis, IL 62204
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Unity Lutheran Christian Elementary School",'East_Saint_Louis=' + East_Saint_Louis.length); East_St_Louis[East_St_Louis.length] = createMarker(new GPoint(-90.15400000,38.62230000),"
Vincent Gray Alternative H School
P O Box 428
East St Louis, IL 62202
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Vincent Gray Alternative H School",'East_St_Louis=' + East_St_Louis.length); East_Saint_Louis[East_Saint_Louis.length] = createMarker(new GPoint(-90.06554200,38.58605800),"
White Oak Academy
463 N 88th Street
East Saint Louis, IL 62203
Co-ed school, 3-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("White Oak Academy",'East_Saint_Louis=' + East_Saint_Louis.length); Belleville[Belleville.length] = createMarker(new GPoint(-89.95886500,38.51419700),"
Zion Lutheran School
1810 Mcclintock Avenue
Belleville, IL 62221
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zion Lutheran School",'Belleville=' + Belleville.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(Belleville); map.removeOverlays(Cahokia); map.removeOverlays(Caseyville); map.removeOverlays(Dupo); map.removeOverlays(East_Saint_Louis); map.removeOverlays(East_St_Louis); map.removeOverlays(Fairmont_City); map.removeOverlays(Fairview_Heights); map.removeOverlays(Fairview_Hgts); map.removeOverlays(Freeburg); map.removeOverlays(Mascoutah); map.removeOverlays(Millstadt); map.removeOverlays(New_Athens); map.removeOverlays(Ofallon); map.removeOverlays(Smithton); 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(Dupo);map.removeOverlays(Belleville); map.removeOverlays(Cahokia); map.removeOverlays(Caseyville); map.removeOverlays(Dupo); map.removeOverlays(East_Saint_Louis); map.removeOverlays(East_St_Louis); map.removeOverlays(Fairmont_City); map.removeOverlays(Fairview_Heights); map.removeOverlays(Fairview_Hgts); map.removeOverlays(Freeburg); map.removeOverlays(Mascoutah); map.removeOverlays(Millstadt); map.removeOverlays(New_Athens); map.removeOverlays(Ofallon); map.removeOverlays(Smithton); map.addOverlays(Belleville); centerByArray(Belleville, false, false); cntMarker += Belleville.length; map.addOverlays(Cahokia); centerByArray(Cahokia, false, false); cntMarker += Cahokia.length; map.addOverlays(Caseyville); centerByArray(Caseyville, false, false); cntMarker += Caseyville.length; map.addOverlays(Dupo); centerByArray(Dupo, false, false); cntMarker += Dupo.length; map.addOverlays(East_Saint_Louis); centerByArray(East_Saint_Louis, false, false); cntMarker += East_Saint_Louis.length; map.addOverlays(East_St_Louis); centerByArray(East_St_Louis, false, false); cntMarker += East_St_Louis.length; map.addOverlays(Fairmont_City); centerByArray(Fairmont_City, false, false); cntMarker += Fairmont_City.length; map.addOverlays(Fairview_Heights); centerByArray(Fairview_Heights, false, false); cntMarker += Fairview_Heights.length; map.addOverlays(Fairview_Hgts); centerByArray(Fairview_Hgts, false, false); cntMarker += Fairview_Hgts.length; map.addOverlays(Freeburg); centerByArray(Freeburg, false, false); cntMarker += Freeburg.length; map.addOverlays(Mascoutah); centerByArray(Mascoutah, false, false); cntMarker += Mascoutah.length; map.addOverlays(Millstadt); centerByArray(Millstadt, false, false); cntMarker += Millstadt.length; map.addOverlays(New_Athens); centerByArray(New_Athens, false, false); cntMarker += New_Athens.length; map.addOverlays(Ofallon); centerByArray(Ofallon, false, false); cntMarker += Ofallon.length; map.addOverlays(Smithton); centerByArray(Smithton, false, false); cntMarker += Smithton.length; centerByArray(Dupo,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; }