function addMarkers(){ mySelect = document.getElementById('selection'); Saint_Louis = [];Kansas_City = [];Saint_Charles = [];Chesterfield = [];Bridgeton = [];Saint_Peters = [];Columbia = [];Liberty = [];Eldon = [];Lake_Saint_Louis = [];Ellisville = [];Jefferson_City = [];Kirkwood = [];Lees_Summit = [];Ballwin = [];Washington = [];mySelect.options[mySelect.options.length] = new Option("Ballwin schools",'all=Ballwin'); mySelect.options[mySelect.options.length] = new Option("Bridgeton schools",'all=Bridgeton'); mySelect.options[mySelect.options.length] = new Option("Chesterfield schools",'all=Chesterfield'); mySelect.options[mySelect.options.length] = new Option("Columbia schools",'all=Columbia'); mySelect.options[mySelect.options.length] = new Option("Eldon schools",'all=Eldon'); mySelect.options[mySelect.options.length] = new Option("Ellisville schools",'all=Ellisville'); 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("Kirkwood schools",'all=Kirkwood'); mySelect.options[mySelect.options.length] = new Option("Lake Saint Louis schools",'all=Lake_Saint_Louis'); mySelect.options[mySelect.options.length] = new Option("Lees Summit schools",'all=Lees_Summit'); mySelect.options[mySelect.options.length] = new Option("Liberty schools",'all=Liberty'); 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("Saint Peters schools",'all=Saint_Peters'); mySelect.options[mySelect.options.length] = new Option("Washington schools",'all=Washington'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Saint_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.33679100,38.65184700),"
A Growing Place Montessori School
101 N Bemiston Avenue
Saint Louis, MO 63105
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("A Growing Place Montessori School",'Saint_Louis=' + Saint_Louis.length); Kansas_City[Kansas_City.length] = createMarker(new GPoint(-94.60782300,38.90252100),"
Academy Montessori Internationale
12501 State Line Road
Kansas City, MO 64145
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Academy Montessori Internationale",'Kansas_City=' + Kansas_City.length); Kansas_City[Kansas_City.length] = createMarker(new GPoint(-94.59321600,38.91963900),"
Alpha Montessori School, Inc.
11430 Wornall Road
Kansas City, MO 64114
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alpha Montessori School, Inc.",'Kansas_City=' + Kansas_City.length); Kansas_City[Kansas_City.length] = createMarker(new GPoint(-94.57830000,39.09970000),"
Belmont Schools, Inc
Po Box 482053
Kansas City, MO 64148
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Belmont Schools, Inc",'Kansas_City=' + Kansas_City.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_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.40862200,38.57583000),"
Casa Dia Montessori
424 S Clay Avenue
Saint Louis, MO 63122
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Casa Dia Montessori",'Saint_Louis=' + Saint_Louis.length); Chesterfield[Chesterfield.length] = createMarker(new GPoint(-90.50813900,38.66131000),"
Chesterfield Montessori School
14000 Ladue Road
Chesterfield, MO 63017
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chesterfield Montessori School",'Chesterfield=' + Chesterfield.length); Bridgeton[Bridgeton.length] = createMarker(new GPoint(-90.40263300,38.73991000),"
Children Of Promise Christian Montessori School
11339 Saint Charles Rock Road
Bridgeton, MO 63044
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Children Of Promise Christian Montessori School",'Bridgeton=' + Bridgeton.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); Columbia[Columbia.length] = createMarker(new GPoint(-92.33051600,38.94065000),"
Childrens House Montessori Of Columbia
915 Maryland Avenue
Columbia, MO 65201
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Childrens House Montessori Of Columbia",'Columbia=' + Columbia.length); Liberty[Liberty.length] = createMarker(new GPoint(-94.41690000,39.26010000),"
Childrens Montessori Center
Po Box 426
Liberty, MO 64069
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Childrens Montessori Center",'Liberty=' + Liberty.length); Columbia[Columbia.length] = createMarker(new GPoint(-92.34946600,38.95197200),"
Columbia Montessori School
3 Anderson Ave
Columbia, MO 65203
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Columbia Montessori School",'Columbia=' + Columbia.length); Saint_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.45536000,38.65536300),"
Countryside Montessori School
12226 Ladue Road
Saint Louis, MO 63141
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Countryside Montessori School",'Saint_Louis=' + Saint_Louis.length); Saint_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.42183400,38.63333700),"
Des Peres Montessori
11155 Clayton Road
Saint Louis, MO 63131
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Des Peres Montessori",'Saint_Louis=' + Saint_Louis.length); Eldon[Eldon.length] = createMarker(new GPoint(-92.56599900,38.35183700),"
Eldon Montessori Children's House
1110 Jones Avenue
Eldon, MO 65026
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eldon Montessori Children's House",'Eldon=' + Eldon.length); Saint_Louis[Saint_Louis.length] = createMarker(new GPoint(-90.35952300,38.59445200),"
Faith Academy
44 N Gore Avenue
Saint Louis, MO 63119
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Academy",'Saint_Louis=' + Saint_Louis.length); Kansas_City[Kansas_City.length] = createMarker(new GPoint(-94.59763400,39.04236300),"
Global Montessori Academy
707 W 47th Street
Kansas City, MO 64112
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Global Montessori Academy",'Kansas_City=' + Kansas_City.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); Ellisville[Ellisville.length] = createMarker(new GPoint(-90.61859800,38.60544600),"
Hope Montessori Academy West
48 Strecker Road
Ellisville, MO 63011
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hope Montessori Academy West",'Ellisville=' + Ellisville.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.19028800,38.52406300),"
Kim School Montessori
1022 Tara Road
Jefferson City, MO 65101
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kim School Montessori",'Jefferson_City=' + Jefferson_City.length); Kirkwood[Kirkwood.length] = createMarker(new GPoint(-90.41883000,38.56676300),"
Kirkwood Children's House Inc.
11232 Big Bend Road
Kirkwood, MO 63122
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kirkwood Children's House Inc.",'Kirkwood=' + Kirkwood.length); Lees_Summit[Lees_Summit.length] = createMarker(new GPoint(-94.35538400,39.00106700),"
Lakewood Montessori School
951 Ne Wildwood Drive
Lees Summit, MO 64064
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lakewood Montessori School",'Lees_Summit=' + Lees_Summit.length); Lees_Summit[Lees_Summit.length] = createMarker(new GPoint(-94.42477100,38.90548900),"
Lavonna Peterson Early School 3
812 Sw Forestpark Lane
Lees Summit, MO 64081
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lavonna Peterson Early School 3",'Lees_Summit=' + Lees_Summit.length); Chesterfield[Chesterfield.length] = createMarker(new GPoint(-90.56476600,38.60593300),"
Linda Vista Catholic School
1633 Kehrs Mill Road
Chesterfield, MO 63005
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Linda Vista Catholic School",'Chesterfield=' + Chesterfield.length); Kansas_City[Kansas_City.length] = createMarker(new GPoint(-94.57746400,39.07361700),"
Montessori Academy
2939 Cherry
Kansas City, MO 64108
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Academy",'Kansas_City=' + Kansas_City.length); Ballwin[Ballwin.length] = createMarker(new GPoint(-90.46548200,38.57956700),"
Montessori Childrens Academy
2809 Barrett Station Rd
Ballwin, MO 63021
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Childrens Academy",'Ballwin=' + Ballwin.length); Jefferson_City[Jefferson_City.length] = createMarker(new GPoint(-92.16630700,38.56130500),"
Moreau Montessori School
900 Moreau Drive
Jefferson City, MO 65101
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Moreau Montessori School",'Jefferson_City=' + Jefferson_City.length); Kansas_City[Kansas_City.length] = createMarker(new GPoint(-94.58498000,39.07437700),"
Union Hill Day School
2911 Main Street
Kansas City, MO 64108
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Union Hill Day School",'Kansas_City=' + Kansas_City.length); Kirkwood[Kirkwood.length] = createMarker(new GPoint(-90.41412300,38.60234700),"
Villa Di Maria Montessori Center
1280 Simmons Ave
Kirkwood, MO 63122
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Villa Di Maria Montessori Center",'Kirkwood=' + Kirkwood.length); Washington[Washington.length] = createMarker(new GPoint(-91.02284500,38.56363000),"
Washington Montessori School
210 High Street
Washington, MO 63090
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Washington Montessori School",'Washington=' + Washington.length); map.removeOverlays(Ballwin); map.removeOverlays(Bridgeton); map.removeOverlays(Chesterfield); map.removeOverlays(Columbia); map.removeOverlays(Eldon); map.removeOverlays(Ellisville); map.removeOverlays(Jefferson_City); map.removeOverlays(Kansas_City); map.removeOverlays(Kirkwood); map.removeOverlays(Lake_Saint_Louis); map.removeOverlays(Lees_Summit); map.removeOverlays(Liberty); map.removeOverlays(Saint_Charles); map.removeOverlays(Saint_Louis); map.removeOverlays(Saint_Peters); map.removeOverlays(Washington); setTimeout(function(){map.addOverlays(Ballwin)},1000); setTimeout(function(){map.addOverlays(Bridgeton)},1000); setTimeout(function(){map.addOverlays(Chesterfield)},1000); setTimeout(function(){map.addOverlays(Columbia)},1000); setTimeout(function(){map.addOverlays(Eldon)},1000); setTimeout(function(){map.addOverlays(Ellisville)},1000); setTimeout(function(){map.addOverlays(Jefferson_City)},1000); setTimeout(function(){map.addOverlays(Kansas_City)},1000); setTimeout(function(){map.addOverlays(Kirkwood)},1000); setTimeout(function(){map.addOverlays(Lake_Saint_Louis)},1000); setTimeout(function(){map.addOverlays(Lees_Summit)},1000); setTimeout(function(){map.addOverlays(Liberty)},1000); setTimeout(function(){map.addOverlays(Saint_Charles)},1000); setTimeout(function(){map.addOverlays(Saint_Louis)},1000); setTimeout(function(){map.addOverlays(Saint_Peters)},1000); setTimeout(function(){map.addOverlays(Washington)},1000); maxLng = -90.33679100; maxLat = 39.26010000; minLng = -94.60782300; minLat = 38.35183700; 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(Ballwin); map.removeOverlays(Bridgeton); map.removeOverlays(Chesterfield); map.removeOverlays(Columbia); map.removeOverlays(Eldon); map.removeOverlays(Ellisville); map.removeOverlays(Jefferson_City); map.removeOverlays(Kansas_City); map.removeOverlays(Kirkwood); map.removeOverlays(Lake_Saint_Louis); map.removeOverlays(Lees_Summit); map.removeOverlays(Liberty); map.removeOverlays(Saint_Charles); map.removeOverlays(Saint_Louis); map.removeOverlays(Saint_Peters); map.removeOverlays(Washington); 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_Louis);map.removeOverlays(Ballwin); map.removeOverlays(Bridgeton); map.removeOverlays(Chesterfield); map.removeOverlays(Columbia); map.removeOverlays(Eldon); map.removeOverlays(Ellisville); map.removeOverlays(Jefferson_City); map.removeOverlays(Kansas_City); map.removeOverlays(Kirkwood); map.removeOverlays(Lake_Saint_Louis); map.removeOverlays(Lees_Summit); map.removeOverlays(Liberty); map.removeOverlays(Saint_Charles); map.removeOverlays(Saint_Louis); map.removeOverlays(Saint_Peters); map.removeOverlays(Washington); map.addOverlays(Ballwin); centerByArray(Ballwin, false, false); cntMarker += Ballwin.length; map.addOverlays(Bridgeton); centerByArray(Bridgeton, false, false); cntMarker += Bridgeton.length; map.addOverlays(Chesterfield); centerByArray(Chesterfield, false, false); cntMarker += Chesterfield.length; map.addOverlays(Columbia); centerByArray(Columbia, false, false); cntMarker += Columbia.length; map.addOverlays(Eldon); centerByArray(Eldon, false, false); cntMarker += Eldon.length; map.addOverlays(Ellisville); centerByArray(Ellisville, false, false); cntMarker += Ellisville.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(Kirkwood); centerByArray(Kirkwood, false, false); cntMarker += Kirkwood.length; map.addOverlays(Lake_Saint_Louis); centerByArray(Lake_Saint_Louis, false, false); cntMarker += Lake_Saint_Louis.length; map.addOverlays(Lees_Summit); centerByArray(Lees_Summit, false, false); cntMarker += Lees_Summit.length; map.addOverlays(Liberty); centerByArray(Liberty, false, false); cntMarker += Liberty.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(Saint_Peters); centerByArray(Saint_Peters, false, false); cntMarker += Saint_Peters.length; map.addOverlays(Washington); centerByArray(Washington, false, false); cntMarker += Washington.length; centerByArray(Saint_Louis,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///16214,35441,15839,15809,15666,15689,15715,15768,34775,15665,15610,16196,15632,15735,16209,16221,15804,16169,34592,16211,16212,16200,15650,15609,34776,15696,15706,15721,16199,16177,/all'); //window.open('/map.php?type=2&schools=16214,35441,15839,15809,15666,15689,15715,15768,34775,15665,15610,16196,15632,15735,16209,16221,15804,16169,34592,16211,16212,16200,15650,15609,34776,15696,15706,15721,16199,16177,&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; }