function addMarkers(){ mySelect = document.getElementById('selection'); Pasadena = [];El_Paso = [];Houston = [];Webster = [];Abilene = [];Katy = [];Big_Spring = [];Marble_Falls = [];Spring = [];Ft_Worth = [];Lewisville = [];The_Woodlands = [];mySelect.options[mySelect.options.length] = new Option("Abilene schools",'all=Abilene'); mySelect.options[mySelect.options.length] = new Option("Big Spring schools",'all=Big_Spring'); mySelect.options[mySelect.options.length] = new Option("El Paso schools",'all=El_Paso'); mySelect.options[mySelect.options.length] = new Option("Ft Worth schools",'all=Ft_Worth'); mySelect.options[mySelect.options.length] = new Option("Houston schools",'all=Houston'); mySelect.options[mySelect.options.length] = new Option("Katy schools",'all=Katy'); mySelect.options[mySelect.options.length] = new Option("Lewisville schools",'all=Lewisville'); mySelect.options[mySelect.options.length] = new Option("Marble Falls schools",'all=Marble_Falls'); mySelect.options[mySelect.options.length] = new Option("Pasadena schools",'all=Pasadena'); mySelect.options[mySelect.options.length] = new Option("Spring schools",'all=Spring'); mySelect.options[mySelect.options.length] = new Option("The Woodlands schools",'all=The_Woodlands'); mySelect.options[mySelect.options.length] = new Option("Webster schools",'all=Webster'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Pasadena[Pasadena.length] = createMarker(new GPoint(-95.21059900,29.68993700),"
Agape Christian Academy
103 E. Bird
Pasadena, TX 77502
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Agape Christian Academy",'Pasadena=' + Pasadena.length); El_Paso[El_Paso.length] = createMarker(new GPoint(-106.53842300,31.85917000),"
Ascension Lutheran Day School
6520 Loma De Cristo
El Paso, TX 79912
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ascension Lutheran Day School",'El_Paso=' + El_Paso.length); Houston[Houston.length] = createMarker(new GPoint(-95.41739900,29.70594600),"
Beresford School
2501 W Holcombe Blvd
Houston, TX 77030
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beresford School",'Houston=' + Houston.length); Webster[Webster.length] = createMarker(new GPoint(-95.12251200,29.53659400),"
The Bruk Academy Of Developmen
421 Slossen St
Webster, TX 77598
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Bruk Academy Of Developmen",'Webster=' + Webster.length); Houston[Houston.length] = createMarker(new GPoint(-95.41012500,29.70526200),"
Children's Hour Montessori
2227 Dorrington
Houston, TX 77030
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Children's Hour Montessori",'Houston=' + Houston.length); Houston[Houston.length] = createMarker(new GPoint(-95.36643400,29.74883600),"
Crayon Club
1804 Austin
Houston, TX 77002
Co-ed school, KG-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crayon Club",'Houston=' + Houston.length); Houston[Houston.length] = createMarker(new GPoint(-95.64590000,29.69190000),"
God's Rainbow Christian Academy
9437 Hwy. 65
Houston, TX 77083
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("God's Rainbow Christian Academy",'Houston=' + Houston.length); Abilene[Abilene.length] = createMarker(new GPoint(-99.74783600,32.42558500),"
Happy Days School
1957 Sayles
Abilene, TX 79605
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Happy Days School",'Abilene=' + Abilene.length); Houston[Houston.length] = createMarker(new GPoint(-95.29103100,29.88323700),"
Helon's Academy
6619 Annunciation
Houston, TX 77016
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Helon's Academy",'Houston=' + Houston.length); Houston[Houston.length] = createMarker(new GPoint(-95.38905900,29.73051200),"
The Joy School
One Chelsea
Houston, TX 77006
Co-ed school, 1-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Joy School",'Houston=' + Houston.length); Houston[Houston.length] = createMarker(new GPoint(-95.51659700,29.70199400),"
Kids Arena Montessori School
7324 Sw Frwy Ste 100
Houston, TX 77074
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kids Arena Montessori School",'Houston=' + Houston.length); Houston[Houston.length] = createMarker(new GPoint(-95.21188600,29.80570200),"
Kingdom Kids
13334 Wallsville
Houston, TX 77049
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kingdom Kids",'Houston=' + Houston.length); Houston[Houston.length] = createMarker(new GPoint(-95.60583100,29.74599000),"
Memorial School Of The Oaks
1907 S. Dairy Ashford
Houston, TX 77077
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Memorial School Of The Oaks",'Houston=' + Houston.length); Houston[Houston.length] = createMarker(new GPoint(-95.32719900,29.77126300),"
Neighborhood Educational Cen
4308 12 Sondick
Houston, TX 77020
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Neighborhood Educational Cen",'Houston=' + Houston.length); Katy[Katy.length] = createMarker(new GPoint(-95.75164000,29.78944800),"
New Hope Child Dev Center
1350 N. Mason Rd
Katy, TX 77449
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Hope Child Dev Center",'Katy=' + Katy.length); Houston[Houston.length] = createMarker(new GPoint(-95.42984100,29.74325700),"
St. John's Upper
2401 Claremont Lane
Houston, TX 77019
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John's Upper",'Houston=' + Houston.length); Big_Spring[Big_Spring.length] = createMarker(new GPoint(-101.48070900,32.23667700),"
St. Mary's Episcopal School
118 Cedar
Big Spring, TX 79720
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary's Episcopal School",'Big_Spring=' + Big_Spring.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); Marble_Falls[Marble_Falls.length] = createMarker(new GPoint(-98.34676800,30.60157500),"
St. Peters Lutheran Presch & Kindergarten
1803 Hwy 1431 W
Marble Falls, TX 78654
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Peters Lutheran Presch & Kindergarten",'Marble_Falls=' + Marble_Falls.length); Spring[Spring.length] = createMarker(new GPoint(-95.43855600,30.03928100),"
School In The Pines
19027 Joan Leigh
Spring, TX 77388
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("School In The Pines",'Spring=' + Spring.length); Ft_Worth[Ft_Worth.length] = createMarker(new GPoint(-97.37025800,32.74692800),"
Trinity Lutheran Childrens Center
3621 Tulsa Way
Ft Worth, TX 76107
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran Childrens Center",'Ft_Worth=' + Ft_Worth.length); Lewisville[Lewisville.length] = createMarker(new GPoint(-97.00504400,33.04653700),"
Windmill Private School
531 W.main
Lewisville, TX 75057
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Windmill Private School",'Lewisville=' + Lewisville.length); The_Woodlands[The_Woodlands.length] = createMarker(new GPoint(-95.46590000,30.14170000),"
The Woodlands School For Young Scholars
25162 Grogans Park Drive
The Woodlands, TX 77380
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Woodlands School For Young Scholars",'The_Woodlands=' + The_Woodlands.length); map.removeOverlays(Abilene); map.removeOverlays(Big_Spring); map.removeOverlays(El_Paso); map.removeOverlays(Ft_Worth); map.removeOverlays(Houston); map.removeOverlays(Katy); map.removeOverlays(Lewisville); map.removeOverlays(Marble_Falls); map.removeOverlays(Pasadena); map.removeOverlays(Spring); map.removeOverlays(The_Woodlands); map.removeOverlays(Webster); setTimeout(function(){map.addOverlays(Abilene)},1000); setTimeout(function(){map.addOverlays(Big_Spring)},1000); setTimeout(function(){map.addOverlays(El_Paso)},1000); setTimeout(function(){map.addOverlays(Ft_Worth)},1000); setTimeout(function(){map.addOverlays(Houston)},1000); setTimeout(function(){map.addOverlays(Katy)},1000); setTimeout(function(){map.addOverlays(Lewisville)},1000); setTimeout(function(){map.addOverlays(Marble_Falls)},1000); setTimeout(function(){map.addOverlays(Pasadena)},1000); setTimeout(function(){map.addOverlays(Spring)},1000); setTimeout(function(){map.addOverlays(The_Woodlands)},1000); setTimeout(function(){map.addOverlays(Webster)},1000); maxLng = -95.12251200; maxLat = 33.04653700; minLng = -106.53842300; minLat = 29.53659400; 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(Abilene); map.removeOverlays(Big_Spring); map.removeOverlays(El_Paso); map.removeOverlays(Ft_Worth); map.removeOverlays(Houston); map.removeOverlays(Katy); map.removeOverlays(Lewisville); map.removeOverlays(Marble_Falls); map.removeOverlays(Pasadena); map.removeOverlays(Spring); map.removeOverlays(The_Woodlands); map.removeOverlays(Webster); 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(Pasadena);map.removeOverlays(Abilene); map.removeOverlays(Big_Spring); map.removeOverlays(El_Paso); map.removeOverlays(Ft_Worth); map.removeOverlays(Houston); map.removeOverlays(Katy); map.removeOverlays(Lewisville); map.removeOverlays(Marble_Falls); map.removeOverlays(Pasadena); map.removeOverlays(Spring); map.removeOverlays(The_Woodlands); map.removeOverlays(Webster); map.addOverlays(Abilene); centerByArray(Abilene, false, false); cntMarker += Abilene.length; map.addOverlays(Big_Spring); centerByArray(Big_Spring, false, false); cntMarker += Big_Spring.length; map.addOverlays(El_Paso); centerByArray(El_Paso, false, false); cntMarker += El_Paso.length; map.addOverlays(Ft_Worth); centerByArray(Ft_Worth, false, false); cntMarker += Ft_Worth.length; map.addOverlays(Houston); centerByArray(Houston, false, false); cntMarker += Houston.length; map.addOverlays(Katy); centerByArray(Katy, false, false); cntMarker += Katy.length; map.addOverlays(Lewisville); centerByArray(Lewisville, false, false); cntMarker += Lewisville.length; map.addOverlays(Marble_Falls); centerByArray(Marble_Falls, false, false); cntMarker += Marble_Falls.length; map.addOverlays(Pasadena); centerByArray(Pasadena, false, false); cntMarker += Pasadena.length; map.addOverlays(Spring); centerByArray(Spring, false, false); cntMarker += Spring.length; map.addOverlays(The_Woodlands); centerByArray(The_Woodlands, false, false); cntMarker += The_Woodlands.length; map.addOverlays(Webster); centerByArray(Webster, false, false); cntMarker += Webster.length; centerByArray(Pasadena,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///34915,27382,26483,27745,27427,26534,27633,34915,26636,26714,26840,26403,27591,26980,26422,27047,27106,27382,27463,27110,27776,27471,26483,27276,27609,27719,/all'); //window.open('/map.php?type=2&schools=34915,27382,26483,27745,27427,26534,27633,34915,26636,26714,26840,26403,27591,26980,26422,27047,27106,27382,27463,27110,27776,27471,26483,27276,27609,27719,&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; }