function addMarkers(){ mySelect = document.getElementById('selection'); Saint_Charles = [];Saint_Peters = [];OFallon = [];Foristell = [];Lake_Saint_Louis = [];Dardenne_Prairie = [];Wentzville = [];Weldon_Spring = [];Saint_Paul = [];mySelect.options[mySelect.options.length] = new Option("Dardenne Prairie schools",'all=Dardenne_Prairie'); mySelect.options[mySelect.options.length] = new Option("Foristell schools",'all=Foristell'); mySelect.options[mySelect.options.length] = new Option("Lake Saint Louis schools",'all=Lake_Saint_Louis'); mySelect.options[mySelect.options.length] = new Option("OFallon schools",'all=OFallon'); mySelect.options[mySelect.options.length] = new Option("Saint Charles schools",'all=Saint_Charles'); mySelect.options[mySelect.options.length] = new Option("Saint Paul schools",'all=Saint_Paul'); mySelect.options[mySelect.options.length] = new Option("Saint Peters schools",'all=Saint_Peters'); mySelect.options[mySelect.options.length] = new Option("Weldon Spring schools",'all=Weldon_Spring'); mySelect.options[mySelect.options.length] = new Option("Wentzville schools",'all=Wentzville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-90.48023800,38.78632100),"
Academy Of The Sacred Heart
619 N 2nd Street
Saint Charles, MO 63301
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Academy Of The Sacred Heart",'Saint_Charles=' + Saint_Charles.length); Saint_Peters[Saint_Peters.length] = createMarker(new GPoint(-90.62902100,38.79663400),"
All Saints School
5 Mcmenamy Road
Saint Peters, MO 63376
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("All Saints School",'Saint_Peters=' + Saint_Peters.length); OFallon[OFallon.length] = createMarker(new GPoint(-90.70180400,38.81303700),"
Assumption School
203 W 3rd Street
O'Fallon, MO 63366
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Assumption School",'OFallon=' + OFallon.length); Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-90.57059900,38.80333000),"
Campbell Montessori School
3880 Shady Springs Ln
Saint Charles, MO 63301
Co-ed school, NS-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Campbell Montessori School",'Saint_Charles=' + Saint_Charles.length); Saint_Peters[Saint_Peters.length] = createMarker(new GPoint(-90.62182400,38.77274900),"
Childrens Edu Care Center
100 Vantage Drive
Saint Peters, MO 63376
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Childrens Edu Care Center",'Saint_Peters=' + Saint_Peters.length); Saint_Peters[Saint_Peters.length] = createMarker(new GPoint(-90.62230000,38.77880000),"
Church On The Rock Christian
Po Box 1668
Saint Peters, MO 63376
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Church On The Rock Christian",'Saint_Peters=' + Saint_Peters.length); OFallon[OFallon.length] = createMarker(new GPoint(-90.71721100,38.81356500),"
First Baptist Christian
8750 Veterans Memorial Pkwy
O'Fallon, MO 63366
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Baptist Christian",'OFallon=' + OFallon.length); Foristell[Foristell.length] = createMarker(new GPoint(-90.94880000,38.81930000),"
Foristell Baptist Academy
Po Box 70
Foristell, MO 63348
Co-ed school, K-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Foristell Baptist Academy",'Foristell=' + Foristell.length); Lake_Saint_Louis[Lake_Saint_Louis.length] = createMarker(new GPoint(-90.76072600,38.80138300),"
Hope Montessori Academy
1799 Lk St Louis Blvd
Lake Saint Louis, MO 63367
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hope Montessori Academy",'Lake_Saint_Louis=' + Lake_Saint_Louis.length); Dardenne_Prairie[Dardenne_Prairie.length] = createMarker(new GPoint(-90.75637500,38.76665100),"
Immaculate Conception School
2089 Hanley Road
Dardenne Prairie, MO 63368
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Immaculate Conception School",'Dardenne_Prairie=' + Dardenne_Prairie.length); Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-90.48866500,38.78331900),"
Immanuel Lutheran School
115 S 6th St
Saint Charles, MO 63301
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Immanuel Lutheran School",'Saint_Charles=' + Saint_Charles.length); Wentzville[Wentzville.length] = createMarker(new GPoint(-90.85680300,38.81111500),"
Immanuel Lutheran School
317 W Pearce Blvd
Wentzville, MO 63385
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Immanuel Lutheran School",'Wentzville=' + Wentzville.length); OFallon[OFallon.length] = createMarker(new GPoint(-90.75391100,38.76586300),"
Kid's Academy
7767 Highway N
O'Fallon, MO 63366
Co-ed school, NS-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kid's Academy",'OFallon=' + OFallon.length); Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-90.51395500,38.81900400),"
Little Guppy Child Dev Center
3151 Elm Pointe Industrial Dr
Saint Charles, MO 63301
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Guppy Child Dev Center",'Saint_Charles=' + Saint_Charles.length); Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-90.59767300,38.74675800),"
Living Word Christian School - Harvester Elementary Campus
4075 S. Highway 94
Saint Charles, MO 63304
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Living Word Christian School - Harvester Elementary Campus",'Saint_Charles=' + Saint_Charles.length); Saint_Peters[Saint_Peters.length] = createMarker(new GPoint(-90.62633800,38.79682500),"
Living Word Christian School - Mid Rivers Elementary Campus
310 Cardinal Place
Saint Peters, MO 63376
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Living Word Christian School - Mid Rivers Elementary Campus",'Saint_Peters=' + Saint_Peters.length); OFallon[OFallon.length] = createMarker(new GPoint(-90.71721100,38.81356500),"
Living Word Christian Schools
1145 Tom Ginnever Ave.
O'Fallon, MO 63366
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Living Word Christian Schools",'OFallon=' + OFallon.length); Weldon_Spring[Weldon_Spring.length] = createMarker(new GPoint(-90.67421000,38.71662900),"
Messiah Lutheran School
5911 South Highway 94
Weldon Spring, MO 63304
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Messiah Lutheran School",'Weldon_Spring=' + Weldon_Spring.length); Saint_Peters[Saint_Peters.length] = createMarker(new GPoint(-90.66021100,38.79096500),"
Mid Rivers Sda School
600 Salt Lick Rd
Saint Peters, MO 63376
Co-ed school, 3-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mid Rivers Sda School",'Saint_Peters=' + Saint_Peters.length); Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-90.48250600,38.78782400),"
St. Charles Borromeo School
431 Decatur Street
Saint Charles, MO 63301
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Charles Borromeo School",'Saint_Charles=' + Saint_Charles.length); Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-90.53551400,38.80128100),"
St. Cletus School
2721 Zumbehl Road
Saint Charles, MO 63301
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Cletus School",'Saint_Charles=' + Saint_Charles.length); Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-90.54194700,38.77693700),"
St. Elizabeth St. Robert Regional School
1 Seton Court
Saint Charles, MO 63303
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Elizabeth St. Robert Regional School",'Saint_Charles=' + Saint_Charles.length); Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-90.65248500,38.74332500),"
St. Joseph School
1351 Motherhead Road
Saint Charles, MO 63304
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph School",'Saint_Charles=' + Saint_Charles.length); Saint_Paul[Saint_Paul.length] = createMarker(new GPoint(-90.71630000,38.81480000),"
St. Paul Elementary School
Po Box 66070 1235 Church Road
Saint Paul, MO 63366
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Paul Elementary School",'Saint_Paul=' + Saint_Paul.length); Wentzville[Wentzville.length] = createMarker(new GPoint(-90.79678900,38.84374700),"
St Joseph School-josephville
1410 Josephville Road
Wentzville, MO 63385
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Joseph School-josephville",'Wentzville=' + Wentzville.length); Wentzville[Wentzville.length] = createMarker(new GPoint(-90.85426400,38.80754400),"
St Patrick Elementary School
701 S Church Street
Wentzville, MO 63385
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Patrick Elementary School",'Wentzville=' + Wentzville.length); Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-90.48417900,38.77932400),"
St Peter Catholic School
222 Jackson Street
Saint Charles, MO 63301
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Peter Catholic School",'Saint_Charles=' + Saint_Charles.length); Wentzville[Wentzville.length] = createMarker(new GPoint(-90.86353600,38.85476300),"
St Theodore School
5059 Highway P
Wentzville, MO 63385
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Theodore School",'Wentzville=' + Wentzville.length); Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-90.59858900,38.75626900),"
Sts Joachim & Ann School
4110 Mcclay Road
Saint Charles, MO 63304
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sts Joachim & Ann School",'Saint_Charles=' + Saint_Charles.length); Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-90.44912200,38.86471600),"
Trinity Lutheran School
4689 N Highway 94
Saint Charles, MO 63301
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Saint_Charles=' + Saint_Charles.length); OFallon[OFallon.length] = createMarker(new GPoint(-90.70002300,38.76222000),"
Tutor Time
2688 Highway K
O'Fallon, MO 63368
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tutor Time",'OFallon=' + OFallon.length); Saint_Peters[Saint_Peters.length] = createMarker(new GPoint(-90.66489700,38.80261100),"
Westgate Christian Academy
1913 Trade Center Dr.
Saint Peters, MO 63376
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westgate Christian Academy",'Saint_Peters=' + Saint_Peters.length); Saint_Peters[Saint_Peters.length] = createMarker(new GPoint(-90.59472300,38.77588600),"
Willott Road Christian Academy
1610 Willott Road
Saint Peters, MO 63376
Co-ed school, NS-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Willott Road Christian Academy",'Saint_Peters=' + Saint_Peters.length); Saint_Charles[Saint_Charles.length] = createMarker(new GPoint(-90.58449400,38.74303900),"
Zion Lutheran School
3866 Harvester Road
Saint Charles, MO 63304
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zion Lutheran School",'Saint_Charles=' + Saint_Charles.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(Dardenne_Prairie); map.removeOverlays(Foristell); map.removeOverlays(Lake_Saint_Louis); map.removeOverlays(OFallon); map.removeOverlays(Saint_Charles); map.removeOverlays(Saint_Paul); map.removeOverlays(Saint_Peters); map.removeOverlays(Weldon_Spring); map.removeOverlays(Wentzville); 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(Saint_Charles);map.removeOverlays(Dardenne_Prairie); map.removeOverlays(Foristell); map.removeOverlays(Lake_Saint_Louis); map.removeOverlays(OFallon); map.removeOverlays(Saint_Charles); map.removeOverlays(Saint_Paul); map.removeOverlays(Saint_Peters); map.removeOverlays(Weldon_Spring); map.removeOverlays(Wentzville); map.addOverlays(Dardenne_Prairie); centerByArray(Dardenne_Prairie, false, false); cntMarker += Dardenne_Prairie.length; map.addOverlays(Foristell); centerByArray(Foristell, false, false); cntMarker += Foristell.length; map.addOverlays(Lake_Saint_Louis); centerByArray(Lake_Saint_Louis, false, false); cntMarker += Lake_Saint_Louis.length; map.addOverlays(OFallon); centerByArray(OFallon, false, false); cntMarker += OFallon.length; map.addOverlays(Saint_Charles); centerByArray(Saint_Charles, false, false); cntMarker += Saint_Charles.length; map.addOverlays(Saint_Paul); centerByArray(Saint_Paul, false, false); cntMarker += Saint_Paul.length; map.addOverlays(Saint_Peters); centerByArray(Saint_Peters, false, false); cntMarker += Saint_Peters.length; map.addOverlays(Weldon_Spring); centerByArray(Weldon_Spring, false, false); cntMarker += Weldon_Spring.length; map.addOverlays(Wentzville); centerByArray(Wentzville, false, false); cntMarker += Wentzville.length; centerByArray(Saint_Charles,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; }