function addMarkers(){ mySelect = document.getElementById('selection'); Houston = [];Fort_Worth = [];Conroe = [];Pilot_Point = [];Liberty = [];Dallas = [];Kingwood = [];Denison = [];Bryan = [];Missouri_City = [];Brownsville = [];San_Antonio = [];Pasadena = [];mySelect.options[mySelect.options.length] = new Option("Brownsville schools",'all=Brownsville'); mySelect.options[mySelect.options.length] = new Option("Bryan schools",'all=Bryan'); mySelect.options[mySelect.options.length] = new Option("Conroe schools",'all=Conroe'); mySelect.options[mySelect.options.length] = new Option("Dallas schools",'all=Dallas'); mySelect.options[mySelect.options.length] = new Option("Denison schools",'all=Denison'); mySelect.options[mySelect.options.length] = new Option("Fort Worth schools",'all=Fort_Worth'); mySelect.options[mySelect.options.length] = new Option("Houston schools",'all=Houston'); mySelect.options[mySelect.options.length] = new Option("Kingwood schools",'all=Kingwood'); mySelect.options[mySelect.options.length] = new Option("Liberty schools",'all=Liberty'); mySelect.options[mySelect.options.length] = new Option("Missouri City schools",'all=Missouri_City'); mySelect.options[mySelect.options.length] = new Option("Pasadena schools",'all=Pasadena'); mySelect.options[mySelect.options.length] = new Option("Pilot Point schools",'all=Pilot_Point'); mySelect.options[mySelect.options.length] = new Option("San Antonio schools",'all=San_Antonio'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Houston[Houston.length] = createMarker(new GPoint(-95.45779600,29.83003300),"
British School Of Houston
4211 Watonga Blvd
Houston, TX 77092
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("British School Of Houston",'Houston=' + Houston.length); Fort_Worth[Fort_Worth.length] = createMarker(new GPoint(-97.34006200,32.74693700),"
Child Study Center School
1300 West Lancaster Ave
Fort Worth, TX 76102
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Child Study Center School",'Fort_Worth=' + Fort_Worth.length); Houston[Houston.length] = createMarker(new GPoint(-95.11087000,29.57474000),"
Clear Lake Montessori School
2486 Falcon Pass
Houston, TX 77062
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clear Lake Montessori School",'Houston=' + Houston.length); Conroe[Conroe.length] = createMarker(new GPoint(-95.46365800,30.32523600),"
Conroe Christian School
1615 Oddfellow
Conroe, TX 77301
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Conroe Christian School",'Conroe=' + Conroe.length); Pilot_Point[Pilot_Point.length] = createMarker(new GPoint(-96.96828300,33.38870100),"
Education Plus+ Ministries
616 W. Georgia Ave.
Pilot Point, TX 76258
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Education Plus+ Ministries",'Pilot_Point=' + Pilot_Point.length); Houston[Houston.length] = createMarker(new GPoint(-95.37180000,29.66390000),"
Gennys Learning Tree Academy 2
4341 Reed Road T
Houston, TX 77051
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gennys Learning Tree Academy 2",'Houston=' + Houston.length); Liberty[Liberty.length] = createMarker(new GPoint(-94.79555900,30.06500600),"
Great Beginnings
1002 Main St
Liberty, TX 77575
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Great Beginnings",'Liberty=' + Liberty.length); Dallas[Dallas.length] = createMarker(new GPoint(-96.83924300,32.75949200),"
Kessler School, The
1215 Turner Ave
Dallas, TX 75208
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kessler School, The",'Dallas=' + Dallas.length); Houston[Houston.length] = createMarker(new GPoint(-95.38795000,29.72806300),"
Montessori Country Day School
30 Oakdale St
Houston, TX 77006
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Country Day School",'Houston=' + Houston.length); Dallas[Dallas.length] = createMarker(new GPoint(-96.84091300,32.93501200),"
Parish Episcopal School
4101 Sigma Road
Dallas, TX 75244
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parish Episcopal School",'Dallas=' + Dallas.length); Kingwood[Kingwood.length] = createMarker(new GPoint(-95.20139600,30.05441200),"
Pines Montessori School
3535 Cedar Knolls Drive
Kingwood, TX 77339
Co-ed school, NS-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pines Montessori School",'Kingwood=' + Kingwood.length); Denison[Denison.length] = createMarker(new GPoint(-96.54039700,33.75657200),"
St. Lukes Episcopal School
427 W Woodard St
Denison, TX 75020
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Lukes Episcopal School",'Denison=' + Denison.length); Bryan[Bryan.length] = createMarker(new GPoint(-96.36252800,30.64529300),"
St. Michaels Episcopal School
2500 College Ave
Bryan, TX 77801
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Michaels Episcopal School",'Bryan=' + Bryan.length); Houston[Houston.length] = createMarker(new GPoint(-95.48515700,29.79339100),"
School Of The Woods
1321 Wirt Road
Houston, TX 77055
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("School Of The Woods",'Houston=' + Houston.length); Houston[Houston.length] = createMarker(new GPoint(-95.21299700,29.58494600),"
Southbelt Country Meadows Mont
10904 Scarsdale Blvd 225
Houston, TX 77089
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southbelt Country Meadows Mont",'Houston=' + Houston.length); Missouri_City[Missouri_City.length] = createMarker(new GPoint(-95.57104700,29.58263700),"
Southminster School
4200 Cartwright Road
Missouri City, TX 77459
Co-ed school, NS-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southminster School",'Missouri_City=' + Missouri_City.length); Dallas[Dallas.length] = createMarker(new GPoint(-96.77283500,32.93976300),"
Spring Valley United Methodist
7700 Spring Valley Rd
Dallas, TX 75254
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Spring Valley United Methodist",'Dallas=' + Dallas.length); Brownsville[Brownsville.length] = createMarker(new GPoint(-97.50839100,25.93067700),"
Sunnyside Day School, Inc
1914 N. Coria St
Brownsville, TX 78520
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sunnyside Day School, Inc",'Brownsville=' + Brownsville.length); Houston[Houston.length] = createMarker(new GPoint(-95.65690000,29.90470000),"
Thee Heritage Christian School
7934 State Hwy 6 N
Houston, TX 77095
school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Thee Heritage Christian School",'Houston=' + Houston.length); San_Antonio[San_Antonio.length] = createMarker(new GPoint(-98.63578600,29.36690500),"
Valley-hi Baptist Academy
6623 S.w. Loop 410
San Antonio, TX 78227
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valley-hi Baptist Academy",'San_Antonio=' + San_Antonio.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-95.14723900,29.68156300),"
Zion Lutheran School
4116 Pasadena Boulevard
Pasadena, TX 77503
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zion Lutheran School",'Pasadena=' + Pasadena.length); map.removeOverlays(Brownsville); map.removeOverlays(Bryan); map.removeOverlays(Conroe); map.removeOverlays(Dallas); map.removeOverlays(Denison); map.removeOverlays(Fort_Worth); map.removeOverlays(Houston); map.removeOverlays(Kingwood); map.removeOverlays(Liberty); map.removeOverlays(Missouri_City); map.removeOverlays(Pasadena); map.removeOverlays(Pilot_Point); map.removeOverlays(San_Antonio); setTimeout(function(){map.addOverlays(Brownsville)},1000); setTimeout(function(){map.addOverlays(Bryan)},1000); setTimeout(function(){map.addOverlays(Conroe)},1000); setTimeout(function(){map.addOverlays(Dallas)},1000); setTimeout(function(){map.addOverlays(Denison)},1000); setTimeout(function(){map.addOverlays(Fort_Worth)},1000); setTimeout(function(){map.addOverlays(Houston)},1000); setTimeout(function(){map.addOverlays(Kingwood)},1000); setTimeout(function(){map.addOverlays(Liberty)},1000); setTimeout(function(){map.addOverlays(Missouri_City)},1000); setTimeout(function(){map.addOverlays(Pasadena)},1000); setTimeout(function(){map.addOverlays(Pilot_Point)},1000); setTimeout(function(){map.addOverlays(San_Antonio)},1000); maxLng = -94.79555900; maxLat = 33.75657200; minLng = -98.63578600; minLat = 25.93067700; 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(Brownsville); map.removeOverlays(Bryan); map.removeOverlays(Conroe); map.removeOverlays(Dallas); map.removeOverlays(Denison); map.removeOverlays(Fort_Worth); map.removeOverlays(Houston); map.removeOverlays(Kingwood); map.removeOverlays(Liberty); map.removeOverlays(Missouri_City); map.removeOverlays(Pasadena); map.removeOverlays(Pilot_Point); map.removeOverlays(San_Antonio); 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(Houston);map.removeOverlays(Brownsville); map.removeOverlays(Bryan); map.removeOverlays(Conroe); map.removeOverlays(Dallas); map.removeOverlays(Denison); map.removeOverlays(Fort_Worth); map.removeOverlays(Houston); map.removeOverlays(Kingwood); map.removeOverlays(Liberty); map.removeOverlays(Missouri_City); map.removeOverlays(Pasadena); map.removeOverlays(Pilot_Point); map.removeOverlays(San_Antonio); map.addOverlays(Brownsville); centerByArray(Brownsville, false, false); cntMarker += Brownsville.length; map.addOverlays(Bryan); centerByArray(Bryan, false, false); cntMarker += Bryan.length; map.addOverlays(Conroe); centerByArray(Conroe, false, false); cntMarker += Conroe.length; map.addOverlays(Dallas); centerByArray(Dallas, false, false); cntMarker += Dallas.length; map.addOverlays(Denison); centerByArray(Denison, false, false); cntMarker += Denison.length; map.addOverlays(Fort_Worth); centerByArray(Fort_Worth, false, false); cntMarker += Fort_Worth.length; map.addOverlays(Houston); centerByArray(Houston, false, false); cntMarker += Houston.length; map.addOverlays(Kingwood); centerByArray(Kingwood, false, false); cntMarker += Kingwood.length; map.addOverlays(Liberty); centerByArray(Liberty, false, false); cntMarker += Liberty.length; map.addOverlays(Missouri_City); centerByArray(Missouri_City, false, false); cntMarker += Missouri_City.length; map.addOverlays(Pasadena); centerByArray(Pasadena, false, false); cntMarker += Pasadena.length; map.addOverlays(Pilot_Point); centerByArray(Pilot_Point, false, false); cntMarker += Pilot_Point.length; map.addOverlays(San_Antonio); centerByArray(San_Antonio, false, false); cntMarker += San_Antonio.length; centerByArray(Houston,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///27444,26688,27599,26449,27279,30620,27542,27444,26688,30412,27599,27763,27408,26633,26449,26672,26837,27078,27279,26446,27610,27187,27744,246,27709,30620,27659,/all'); //window.open('/map.php?type=2&schools=27444,26688,27599,26449,27279,30620,27542,27444,26688,30412,27599,27763,27408,26633,26449,26672,26837,27078,27279,26446,27610,27187,27744,246,27709,30620,27659,&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; }