function addMarkers(){ mySelect = document.getElementById('selection'); Sugar_Land = [];Pasadena = [];Houston = [];Plainview = [];Carrollton = [];The_Woodlands = [];San_Antonio = [];Garland = [];Richardson = [];El_Paso = [];Missouri_City = [];Terrell = [];Austin = [];Lubbock = [];Dallas = [];Richmond = [];Mesquite = [];Katy = [];Stephenville = [];Irving = [];mySelect.options[mySelect.options.length] = new Option("Austin schools",'all=Austin'); mySelect.options[mySelect.options.length] = new Option("Carrollton schools",'all=Carrollton'); mySelect.options[mySelect.options.length] = new Option("Dallas schools",'all=Dallas'); mySelect.options[mySelect.options.length] = new Option("El Paso schools",'all=El_Paso'); mySelect.options[mySelect.options.length] = new Option("Garland schools",'all=Garland'); mySelect.options[mySelect.options.length] = new Option("Houston schools",'all=Houston'); mySelect.options[mySelect.options.length] = new Option("Irving schools",'all=Irving'); mySelect.options[mySelect.options.length] = new Option("Katy schools",'all=Katy'); mySelect.options[mySelect.options.length] = new Option("Lubbock schools",'all=Lubbock'); mySelect.options[mySelect.options.length] = new Option("Mesquite schools",'all=Mesquite'); 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("Plainview schools",'all=Plainview'); mySelect.options[mySelect.options.length] = new Option("Richardson schools",'all=Richardson'); mySelect.options[mySelect.options.length] = new Option("Richmond schools",'all=Richmond'); mySelect.options[mySelect.options.length] = new Option("San Antonio schools",'all=San_Antonio'); mySelect.options[mySelect.options.length] = new Option("Stephenville schools",'all=Stephenville'); mySelect.options[mySelect.options.length] = new Option("Sugar Land schools",'all=Sugar_Land'); mySelect.options[mySelect.options.length] = new Option("Terrell schools",'all=Terrell'); mySelect.options[mySelect.options.length] = new Option("The Woodlands schools",'all=The_Woodlands'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.61885700,29.62845200),"
1st United Methd Ch School Little
431 Eldridge Rd
Sugar Land, TX 77478
Co-ed school, KG-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("1st United Methd Ch School Little",'Sugar_Land=' + Sugar_Land.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-95.14305700,29.63271400),"
Asbury Methodist Day School
5354 Space Center Blvd
Pasadena, TX 77505
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Asbury Methodist Day School",'Pasadena=' + Pasadena.length); Houston[Houston.length] = createMarker(new GPoint(-95.64084400,29.84702000),"
Bear Creek United Methodist Church School
16000 Rippling Water Drive
Houston, TX 77084
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bear Creek United Methodist Church School",'Houston=' + Houston.length); Plainview[Plainview.length] = createMarker(new GPoint(-101.71445800,34.18674900),"
Calico Caboose
1001 W 7th
Plainview, TX 79072
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calico Caboose",'Plainview=' + Plainview.length); Carrollton[Carrollton.length] = createMarker(new GPoint(-96.86628700,33.02486900),"
Carrollton Christian Academy
2205 East Hebron Pkwy
Carrollton, TX 75010
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carrollton Christian Academy",'Carrollton=' + Carrollton.length); Houston[Houston.length] = createMarker(new GPoint(-95.51028800,29.76269500),"
Chapelwood School
11140 Greenbay Street
Houston, TX 77024
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chapelwood School",'Houston=' + Houston.length); The_Woodlands[The_Woodlands.length] = createMarker(new GPoint(-95.46855500,30.16660700),"
Children Of The Woodlands
2200 Lake Woodlands Drive
The Woodlands, TX 77380
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Children Of The Woodlands",'The_Woodlands=' + The_Woodlands.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.60371500,29.57350500),"
Christ Church School
3300 Austin Parkway
Sugar Land, TX 77479
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ Church School",'Sugar_Land=' + Sugar_Land.length); San_Antonio[San_Antonio.length] = createMarker(new GPoint(-98.54010500,29.52836800),"
Colonial Hills United Methodist School
5247 Vance Jackson Road
San Antonio, TX 78230
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Colonial Hills United Methodist School",'San_Antonio=' + San_Antonio.length); Houston[Houston.length] = createMarker(new GPoint(-95.54444100,29.79251300),"
Fair Haven Methodist Day School
1330 Gessner Drive
Houston, TX 77055
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fair Haven Methodist Day School",'Houston=' + Houston.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-95.19362700,29.65127800),"
First Umc & First Friends Day School
1062 Fairmont Parkway
Pasadena, TX 77504
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Umc & First Friends Day School",'Pasadena=' + Pasadena.length); Garland[Garland.length] = createMarker(new GPoint(-96.64020000,32.91090000),"
First Umc Day School
801 W Avenue B
Garland, TX 75040
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Umc Day School",'Garland=' + Garland.length); Richardson[Richardson.length] = createMarker(new GPoint(-96.73750600,32.95103700),"
First Umc Preschool & Kindergarten
534 W Belt Line Road
Richardson, TX 75080
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Umc Preschool & Kindergarten",'Richardson=' + Richardson.length); Houston[Houston.length] = createMarker(new GPoint(-95.19403700,29.78173700),"
Holy Trinity Day School
13207 Orleans Street
Houston, TX 77015
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Trinity Day School",'Houston=' + Houston.length); Houston[Houston.length] = createMarker(new GPoint(-95.46344100,29.64700100),"
The Imani School
12401 S Post Oak Road
Houston, TX 77045
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Imani School",'Houston=' + Houston.length); Houston[Houston.length] = createMarker(new GPoint(-95.52232900,29.98575700),"
Jwumc Child Development Program
5830 Bermuda Dunes Drive
Houston, TX 77069
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jwumc Child Development Program",'Houston=' + Houston.length); El_Paso[El_Paso.length] = createMarker(new GPoint(-106.48180000,31.75544700),"
Lydia Patterson Institute
517 S Florence Street
El Paso, TX 79901
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lydia Patterson Institute",'El_Paso=' + El_Paso.length); Houston[Houston.length] = createMarker(new GPoint(-95.56462400,29.77258300),"
Memorial Dr United Methodist Church Kids
12955 Memorial Drive
Houston, TX 77079
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Memorial Dr United Methodist Church Kids",'Houston=' + Houston.length); Missouri_City[Missouri_City.length] = createMarker(new GPoint(-95.56452100,29.60199400),"
Methodist Day School
3900 Lexington Blvd
Missouri City, TX 77459
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Methodist Day School",'Missouri_City=' + Missouri_City.length); Terrell[Terrell.length] = createMarker(new GPoint(-96.28160200,32.73968500),"
Methodist Day School
503 W College Street
Terrell, TX 75160
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Methodist Day School",'Terrell=' + Terrell.length); Houston[Houston.length] = createMarker(new GPoint(-95.64441800,29.71765700),"
Mission Bend Christian Academy
3710 Highway 6 South
Houston, TX 77082
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mission Bend Christian Academy",'Houston=' + Houston.length); Austin[Austin.length] = createMarker(new GPoint(-97.66772200,30.28618300),"
Praise Christian Academy
5800 E Martin Luther King Jr
Austin, TX 78721
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Praise Christian Academy",'Austin=' + Austin.length); Lubbock[Lubbock.length] = createMarker(new GPoint(-101.89461000,33.55336600),"
St. Luke's Pre-school
3708 45th Street
Lubbock, TX 79413
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Luke's Pre-school",'Lubbock=' + Lubbock.length); El_Paso[El_Paso.length] = createMarker(new GPoint(-106.58547000,31.84045100),"
St. Mark's Elementary School
5005 Love Rd
El Paso, TX 79922
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mark's Elementary School",'El_Paso=' + El_Paso.length); Houston[Houston.length] = createMarker(new GPoint(-95.38887500,29.72640100),"
St. Paul School
5501 South Main
Houston, TX 77004
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Paul School",'Houston=' + Houston.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); Houston[Houston.length] = createMarker(new GPoint(-95.45543100,30.01149200),"
Spring Woods Weekday Ministrie
1711 Fm 1960 Rd West
Houston, TX 77090
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Spring Woods Weekday Ministrie",'Houston=' + Houston.length); San_Antonio[San_Antonio.length] = createMarker(new GPoint(-98.45055600,29.49854200),"
St Andrews Umc Weekday School
722 Robinhood Place
San Antonio, TX 78209
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Andrews Umc Weekday School",'San_Antonio=' + San_Antonio.length); Richmond[Richmond.length] = createMarker(new GPoint(-95.76154900,29.58215900),"
St John's Methodist School For Little Children
400 Jackson Street
Richmond, TX 77469
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John's Methodist School For Little Children",'Richmond=' + Richmond.length); Houston[Houston.length] = createMarker(new GPoint(-95.43650000,29.73920000),"
St Luke's Day School
Po Box 22013
Houston, TX 77227
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Luke's Day School",'Houston=' + Houston.length); Mesquite[Mesquite.length] = createMarker(new GPoint(-96.64900800,32.80479300),"
St Marks United Methodist Child Development Center
3117 Motley Drive
Mesquite, TX 75150
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Marks United Methodist Child Development Center",'Mesquite=' + Mesquite.length); Houston[Houston.length] = createMarker(new GPoint(-95.38887500,29.72640100),"
St Paul's School
5501 Main Street
Houston, TX 77004
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Paul's School",'Houston=' + Houston.length); Katy[Katy.length] = createMarker(new GPoint(-95.73258200,29.77565700),"
St Peters Early Childhood Development Center
20775 Kingsland Blvd
Katy, TX 77450
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Peters Early Childhood Development Center",'Katy=' + Katy.length); Stephenville[Stephenville.length] = createMarker(new GPoint(-98.20590000,32.21900000),"
Stepping Stones Day School
Po Box 173
Stephenville, TX 76401
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Stepping Stones Day School",'Stephenville=' + Stephenville.length); San_Antonio[San_Antonio.length] = createMarker(new GPoint(-98.59081400,29.49643700),"
Trinity United Methodist School
5319 Newcome
San Antonio, TX 78229
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity United Methodist School",'San_Antonio=' + San_Antonio.length); Dallas[Dallas.length] = createMarker(new GPoint(-96.83798400,32.74653700),"
Tyler Street Christian Academy
915 West 9th St
Dallas, TX 75208
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tyler Street Christian Academy",'Dallas=' + Dallas.length); Houston[Houston.length] = createMarker(new GPoint(-95.55518300,29.72241100),"
Wesley Academy
10570 Westpark Drive
Houston, TX 77042
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wesley Academy",'Houston=' + Houston.length); Dallas[Dallas.length] = createMarker(new GPoint(-96.82199200,32.86660800),"
Wesley Prep
9200 Inwood Road
Dallas, TX 75220
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wesley Prep",'Dallas=' + Dallas.length); Irving[Irving.length] = createMarker(new GPoint(-96.96714600,32.83743700),"
Wesleyan Academy
1615 W Airport Freeway
Irving, TX 75062
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wesleyan Academy",'Irving=' + Irving.length); Houston[Houston.length] = createMarker(new GPoint(-95.53506500,29.73715500),"
West Chase Methodist School
9603 Westheimer Road
Houston, TX 77063
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Chase Methodist School",'Houston=' + Houston.length); Houston[Houston.length] = createMarker(new GPoint(-95.46925600,29.66608800),"
Westbury Methodist Day School
5200 Willowbend Blvd
Houston, TX 77096
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westbury Methodist Day School",'Houston=' + Houston.length); map.removeOverlays(Austin); map.removeOverlays(Carrollton); map.removeOverlays(Dallas); map.removeOverlays(El_Paso); map.removeOverlays(Garland); map.removeOverlays(Houston); map.removeOverlays(Irving); map.removeOverlays(Katy); map.removeOverlays(Lubbock); map.removeOverlays(Mesquite); map.removeOverlays(Missouri_City); map.removeOverlays(Pasadena); map.removeOverlays(Plainview); map.removeOverlays(Richardson); map.removeOverlays(Richmond); map.removeOverlays(San_Antonio); map.removeOverlays(Stephenville); map.removeOverlays(Sugar_Land); map.removeOverlays(Terrell); map.removeOverlays(The_Woodlands); setTimeout(function(){map.addOverlays(Austin)},1000); setTimeout(function(){map.addOverlays(Carrollton)},1000); setTimeout(function(){map.addOverlays(Dallas)},1000); setTimeout(function(){map.addOverlays(El_Paso)},1000); setTimeout(function(){map.addOverlays(Garland)},1000); setTimeout(function(){map.addOverlays(Houston)},1000); setTimeout(function(){map.addOverlays(Irving)},1000); setTimeout(function(){map.addOverlays(Katy)},1000); setTimeout(function(){map.addOverlays(Lubbock)},1000); setTimeout(function(){map.addOverlays(Mesquite)},1000); setTimeout(function(){map.addOverlays(Missouri_City)},1000); setTimeout(function(){map.addOverlays(Pasadena)},1000); setTimeout(function(){map.addOverlays(Plainview)},1000); setTimeout(function(){map.addOverlays(Richardson)},1000); setTimeout(function(){map.addOverlays(Richmond)},1000); setTimeout(function(){map.addOverlays(San_Antonio)},1000); setTimeout(function(){map.addOverlays(Stephenville)},1000); setTimeout(function(){map.addOverlays(Sugar_Land)},1000); setTimeout(function(){map.addOverlays(Terrell)},1000); setTimeout(function(){map.addOverlays(The_Woodlands)},1000); maxLng = -95.14305700; maxLat = 34.18674900; minLng = -106.58547000; minLat = 29.49643700; 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(Austin); map.removeOverlays(Carrollton); map.removeOverlays(Dallas); map.removeOverlays(El_Paso); map.removeOverlays(Garland); map.removeOverlays(Houston); map.removeOverlays(Irving); map.removeOverlays(Katy); map.removeOverlays(Lubbock); map.removeOverlays(Mesquite); map.removeOverlays(Missouri_City); map.removeOverlays(Pasadena); map.removeOverlays(Plainview); map.removeOverlays(Richardson); map.removeOverlays(Richmond); map.removeOverlays(San_Antonio); map.removeOverlays(Stephenville); map.removeOverlays(Sugar_Land); map.removeOverlays(Terrell); map.removeOverlays(The_Woodlands); 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(Sugar_Land);map.removeOverlays(Austin); map.removeOverlays(Carrollton); map.removeOverlays(Dallas); map.removeOverlays(El_Paso); map.removeOverlays(Garland); map.removeOverlays(Houston); map.removeOverlays(Irving); map.removeOverlays(Katy); map.removeOverlays(Lubbock); map.removeOverlays(Mesquite); map.removeOverlays(Missouri_City); map.removeOverlays(Pasadena); map.removeOverlays(Plainview); map.removeOverlays(Richardson); map.removeOverlays(Richmond); map.removeOverlays(San_Antonio); map.removeOverlays(Stephenville); map.removeOverlays(Sugar_Land); map.removeOverlays(Terrell); map.removeOverlays(The_Woodlands); map.addOverlays(Austin); centerByArray(Austin, false, false); cntMarker += Austin.length; map.addOverlays(Carrollton); centerByArray(Carrollton, false, false); cntMarker += Carrollton.length; map.addOverlays(Dallas); centerByArray(Dallas, false, false); cntMarker += Dallas.length; map.addOverlays(El_Paso); centerByArray(El_Paso, false, false); cntMarker += El_Paso.length; map.addOverlays(Garland); centerByArray(Garland, false, false); cntMarker += Garland.length; map.addOverlays(Houston); centerByArray(Houston, false, false); cntMarker += Houston.length; map.addOverlays(Irving); centerByArray(Irving, false, false); cntMarker += Irving.length; map.addOverlays(Katy); centerByArray(Katy, false, false); cntMarker += Katy.length; map.addOverlays(Lubbock); centerByArray(Lubbock, false, false); cntMarker += Lubbock.length; map.addOverlays(Mesquite); centerByArray(Mesquite, false, false); cntMarker += Mesquite.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(Plainview); centerByArray(Plainview, false, false); cntMarker += Plainview.length; map.addOverlays(Richardson); centerByArray(Richardson, false, false); cntMarker += Richardson.length; map.addOverlays(Richmond); centerByArray(Richmond, false, false); cntMarker += Richmond.length; map.addOverlays(San_Antonio); centerByArray(San_Antonio, false, false); cntMarker += San_Antonio.length; map.addOverlays(Stephenville); centerByArray(Stephenville, false, false); cntMarker += Stephenville.length; map.addOverlays(Sugar_Land); centerByArray(Sugar_Land, false, false); cntMarker += Sugar_Land.length; map.addOverlays(Terrell); centerByArray(Terrell, false, false); cntMarker += Terrell.length; map.addOverlays(The_Woodlands); centerByArray(The_Woodlands, false, false); cntMarker += The_Woodlands.length; centerByArray(Sugar_Land,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///26608,27648,27027,27191,26608,27763,27648,36306,27765,27742,26552,26629,26766,26923,27589,26972,27043,27065,27463,27311,27521,27258,27679,27307,27686,27774,35262,27764,27766,27054,26532,36097,27720,27743,27381,27729,27324,27644,27767,26467,31851,27754,26634,/all'); //window.open('/map.php?type=2&schools=26608,27648,27027,27191,26608,27763,27648,36306,27765,27742,26552,26629,26766,26923,27589,26972,27043,27065,27463,27311,27521,27258,27679,27307,27686,27774,35262,27764,27766,27054,26532,36097,27720,27743,27381,27729,27324,27644,27767,26467,31851,27754,26634,&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; }