function addMarkers(){ mySelect = document.getElementById('selection'); Columbia = [];Crystal_City = [];Florissant = [];Jefferson_City = [];Kansas_City = [];OFallon = [];Platte_Woods = [];Raytown = [];Saint_Charles = [];Saint_Louis = [];Sikeston = [];Springfield = [];St_Louis = [];Washington = [];Wildwood = [];mySelect.options[mySelect.options.length] = new Option("Columbia schools",'all=Columbia'); mySelect.options[mySelect.options.length] = new Option("Crystal City schools",'all=Crystal_City'); mySelect.options[mySelect.options.length] = new Option("Florissant schools",'all=Florissant'); mySelect.options[mySelect.options.length] = new Option("Jefferson City schools",'all=Jefferson_City'); mySelect.options[mySelect.options.length] = new Option("Kansas City schools",'all=Kansas_City'); mySelect.options[mySelect.options.length] = new Option("OFallon schools",'all=OFallon'); mySelect.options[mySelect.options.length] = new Option("Platte Woods schools",'all=Platte_Woods'); mySelect.options[mySelect.options.length] = new Option("Raytown schools",'all=Raytown'); mySelect.options[mySelect.options.length] = new Option("Saint Charles schools",'all=Saint_Charles'); mySelect.options[mySelect.options.length] = new Option("Saint Louis schools",'all=Saint_Louis'); mySelect.options[mySelect.options.length] = new Option("Sikeston schools",'all=Sikeston'); mySelect.options[mySelect.options.length] = new Option("Springfield schools",'all=Springfield'); mySelect.options[mySelect.options.length] = new Option("St Louis schools",'all=St_Louis'); mySelect.options[mySelect.options.length] = new Option("Washington schools",'all=Washington'); mySelect.options[mySelect.options.length] = new Option("Wildwood schools",'all=Wildwood'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Columbia[Columbia.length] = createMarker(new GPoint(-92.33593500,38.89293800),"
Apple School
5155 S Providence Road
Columbia, MO 65203
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Apple School",'Columbia=' + Columbia.length); Crystal_City[Crystal_City.length] = createMarker(new GPoint(-90.38250000,38.22810000),"
Wee Care Learning Center
P.o. Box 680
Crystal City, MO 63019
Co-ed school, KG-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wee Care Learning Center",'Crystal_City=' + Crystal_City.length); Florissant[Florissant.length] = createMarker(new GPoint(-90.32594500,38.79477700),"
Sacred Heart Kindergarten
751 N Jefferson Street
Florissant, MO 63031
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Kindergarten",'Florissant=' + Florissant.length); Florissant[Florissant.length] = createMarker(new GPoint(-90.33567500,38.81449100),"
Clara Belle Nursery School
1165 Humes Lane
Florissant, MO 63031
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clara Belle Nursery School",'Florissant=' + Florissant.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.18622300,38.57931000),"
Kindergarten Connection
623 Ohio Street
Jefferson City, MO 65109
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kindergarten Connection",'Jefferson_City=' + Jefferson_City.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.18595000,38.56730300),"
Trinity Lutheran Early Childhood
809 Swifts Highway
Jefferson City, MO 65109
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran Early Childhood",'Jefferson_City=' + Jefferson_City.length); Kansas_City[Kansas_City.length] = createMarker(new GPoint(-94.59738300,39.04596900),"
Plaza Preschool
4500-04 Madison Avenue
Kansas City, MO 64111
Co-ed school, -
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Plaza Preschool",'Kansas_City=' + Kansas_City.length); Kansas_City[Kansas_City.length] = createMarker(new GPoint(-94.56705300,39.18005900),"
Covenant Memorial Baptist Day School
1115 Ne 47th Street
Kansas City, MO 64116
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Covenant Memorial Baptist Day School",'Kansas_City=' + Kansas_City.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); 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); Platte_Woods[Platte_Woods.length] = createMarker(new GPoint(-94.65833900,39.22533900),"
Christ Lutheran Pre-kindergart
6700 Nw 72nd St
Platte Woods, MO 64151
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ Lutheran Pre-kindergart",'Platte_Woods=' + Platte_Woods.length); Raytown[Raytown.length] = createMarker(new GPoint(-94.44112000,39.02755500),"
Small World Montessori
5201 Blue Ridge Blvd
Raytown, MO 64133
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Small World Montessori",'Raytown=' + Raytown.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_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.33282400,38.54355300),"
Christ Memorial Child Care Cen
9712 Tesson Ferry Rd
Saint Louis, MO 63123
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ Memorial Child Care Cen",'Saint_Louis=' + Saint_Louis.length); Saint_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.30395500,38.72465400),"
Faith Child World
1610 S. Florissant Rd.
Saint Louis, MO 63121
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Child World",'Saint_Louis=' + Saint_Louis.length); Saint_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.28855800,38.66422200),"
Transformation Christian School
5890 Etzel Avenue
Saint Louis, MO 63112
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Transformation Christian School",'Saint_Louis=' + Saint_Louis.length); Saint_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.35233600,38.68087500),"
City Of Life Child Care Center
8333 Fullerton Avenue
Saint Louis, MO 63132
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("City Of Life Child Care Center",'Saint_Louis=' + Saint_Louis.length); Saint_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.23908500,38.77600600),"
Christian Hospital Child Development Center
11133 Dunn Road Pfd First Floor
Saint Louis, MO 63136
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Hospital Child Development Center",'Saint_Louis=' + Saint_Louis.length); Saint_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.22222300,38.63498900),"
Explorers Ii Day Care Center
3007 Olive Street
Saint Louis, MO 63103
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Explorers Ii Day Care Center",'Saint_Louis=' + Saint_Louis.length); Saint_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.33367500,38.75275900),"
St. Martins Child Center
6315 Garfield
Saint Louis, MO 63140
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Martins Child Center",'Saint_Louis=' + Saint_Louis.length); Saint_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.50912000,38.64923500),"
The Center At Conway
13725 Conway Road
Saint Louis, MO 63141
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Center At Conway",'Saint_Louis=' + Saint_Louis.length); Saint_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.30633000,38.66182000),"
University City Childrens Cent
6646 Vernon Avenue
Saint Louis, MO 63130
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("University City Childrens Cent",'Saint_Louis=' + Saint_Louis.length); Sikeston[Sikeston.length] = createMarker(new GPoint(-89.56288400,36.87675400),"
Southeast Missouri Christian Academy
1440 Ables Road
Sikeston, MO 63801
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southeast Missouri Christian Academy",'Sikeston=' + Sikeston.length); Springfield[Springfield.length] = createMarker(new GPoint(-93.25764200,37.15897000),"
Developmental Learning Center
2020 E Battlefield Street
Springfield, MO 65804
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Developmental Learning Center",'Springfield=' + Springfield.length); Springfield[Springfield.length] = createMarker(new GPoint(-93.32409500,37.13820800),"
St Elizabeth Ann Seton School
2200 W Republic Road
Springfield, MO 65807
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Elizabeth Ann Seton School",'Springfield=' + Springfield.length); St_Louis[St_Louis.length] = createMarker(new GPoint(-90.38642300,38.58133900),"
Kirkwood Early Childhood Center
100 North Sappington Rd
St Louis, MO 63122
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kirkwood Early Childhood Center",'St_Louis=' + St_Louis.length); Washington[Washington.length] = createMarker(new GPoint(-90.98724500,38.54266700),"
Small Wonder Early Childhood
1890 E 9th St
Washington, MO 63090
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Small Wonder Early Childhood",'Washington=' + Washington.length); Wildwood[Wildwood.length] = createMarker(new GPoint(-90.61507300,38.60863100),"
Elegant Child Early Learning Center
513 Strecker Road
Wildwood, MO 63011
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elegant Child Early Learning Center",'Wildwood=' + Wildwood.length); map.removeOverlays(Columbia); map.removeOverlays(Crystal_City); map.removeOverlays(Florissant); map.removeOverlays(Jefferson_City); map.removeOverlays(Kansas_City); map.removeOverlays(OFallon); map.removeOverlays(Platte_Woods); map.removeOverlays(Raytown); map.removeOverlays(Saint_Charles); map.removeOverlays(Saint_Louis); map.removeOverlays(Sikeston); map.removeOverlays(Springfield); map.removeOverlays(St_Louis); map.removeOverlays(Washington); map.removeOverlays(Wildwood); setTimeout(function(){map.addOverlays(Columbia)},1000); setTimeout(function(){map.addOverlays(Crystal_City)},1000); setTimeout(function(){map.addOverlays(Florissant)},1000); setTimeout(function(){map.addOverlays(Jefferson_City)},1000); setTimeout(function(){map.addOverlays(Kansas_City)},1000); setTimeout(function(){map.addOverlays(OFallon)},1000); setTimeout(function(){map.addOverlays(Platte_Woods)},1000); setTimeout(function(){map.addOverlays(Raytown)},1000); setTimeout(function(){map.addOverlays(Saint_Charles)},1000); setTimeout(function(){map.addOverlays(Saint_Louis)},1000); setTimeout(function(){map.addOverlays(Sikeston)},1000); setTimeout(function(){map.addOverlays(Springfield)},1000); setTimeout(function(){map.addOverlays(St_Louis)},1000); setTimeout(function(){map.addOverlays(Washington)},1000); setTimeout(function(){map.addOverlays(Wildwood)},1000); maxLng = -89.56288400; maxLat = 39.22533900; minLng = -94.65833900; minLat = 36.87675400; reCenterMap(); } // 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//////' + showArray); map.removeOverlays(Columbia); map.removeOverlays(Crystal_City); map.removeOverlays(Florissant); map.removeOverlays(Jefferson_City); map.removeOverlays(Kansas_City); map.removeOverlays(OFallon); map.removeOverlays(Platte_Woods); map.removeOverlays(Raytown); map.removeOverlays(Saint_Charles); map.removeOverlays(Saint_Louis); map.removeOverlays(Sikeston); map.removeOverlays(Springfield); map.removeOverlays(St_Louis); map.removeOverlays(Washington); map.removeOverlays(Wildwood); 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(Columbia);map.removeOverlays(Columbia); map.removeOverlays(Crystal_City); map.removeOverlays(Florissant); map.removeOverlays(Jefferson_City); map.removeOverlays(Kansas_City); map.removeOverlays(OFallon); map.removeOverlays(Platte_Woods); map.removeOverlays(Raytown); map.removeOverlays(Saint_Charles); map.removeOverlays(Saint_Louis); map.removeOverlays(Sikeston); map.removeOverlays(Springfield); map.removeOverlays(St_Louis); map.removeOverlays(Washington); map.removeOverlays(Wildwood); map.addOverlays(Columbia); centerByArray(Columbia, false, false); cntMarker += Columbia.length; map.addOverlays(Crystal_City); centerByArray(Crystal_City, false, false); cntMarker += Crystal_City.length; map.addOverlays(Florissant); centerByArray(Florissant, false, false); cntMarker += Florissant.length; map.addOverlays(Jefferson_City); centerByArray(Jefferson_City, false, false); cntMarker += Jefferson_City.length; map.addOverlays(Kansas_City); centerByArray(Kansas_City, false, false); cntMarker += Kansas_City.length; map.addOverlays(OFallon); centerByArray(OFallon, false, false); cntMarker += OFallon.length; map.addOverlays(Platte_Woods); centerByArray(Platte_Woods, false, false); cntMarker += Platte_Woods.length; map.addOverlays(Raytown); centerByArray(Raytown, false, false); cntMarker += Raytown.length; map.addOverlays(Saint_Charles); centerByArray(Saint_Charles, false, false); cntMarker += Saint_Charles.length; map.addOverlays(Saint_Louis); centerByArray(Saint_Louis, false, false); cntMarker += Saint_Louis.length; map.addOverlays(Sikeston); centerByArray(Sikeston, false, false); cntMarker += Sikeston.length; map.addOverlays(Springfield); centerByArray(Springfield, false, false); cntMarker += Springfield.length; map.addOverlays(St_Louis); centerByArray(St_Louis, false, false); cntMarker += St_Louis.length; map.addOverlays(Washington); centerByArray(Washington, false, false); cntMarker += Washington.length; map.addOverlays(Wildwood); centerByArray(Wildwood, false, false); cntMarker += Wildwood.length; centerByArray(Columbia,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=2&schools=&school_level=&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; }