function addMarkers(){ mySelect = document.getElementById('selection'); Conroe = [];Pinehurst = [];The_Woodlands = [];Porter = [];Woodlands = [];Kingwood = [];Spring = [];Willis = [];mySelect.options[mySelect.options.length] = new Option("Conroe schools",'all=Conroe'); mySelect.options[mySelect.options.length] = new Option("Kingwood schools",'all=Kingwood'); mySelect.options[mySelect.options.length] = new Option("Pinehurst schools",'all=Pinehurst'); mySelect.options[mySelect.options.length] = new Option("Porter schools",'all=Porter'); 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("Willis schools",'all=Willis'); mySelect.options[mySelect.options.length] = new Option("Woodlands schools",'all=Woodlands'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Conroe[Conroe.length] = createMarker(new GPoint(-95.47309400,30.35481000),"
Calvary Baptist School
3401 N Frazier Street
Conroe, TX 77303
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Baptist School",'Conroe=' + Conroe.length); Pinehurst[Pinehurst.length] = createMarker(new GPoint(-95.66810000,30.15140000),"
Central Baptist Academy
Po Box 1380
Pinehurst, TX 77362
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Baptist Academy",'Pinehurst=' + Pinehurst.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); The_Woodlands[The_Woodlands.length] = createMarker(new GPoint(-95.45577600,30.15752000),"
Christ Community School
1488 Wellman Rd.
The Woodlands, TX 77384
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ Community School",'The_Woodlands=' + The_Woodlands.length); Porter[Porter.length] = createMarker(new GPoint(-95.25870000,30.10460000),"
Christian Academy & Child
Po Box 650
Porter, TX 77365
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Academy & Child",'Porter=' + Porter.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); Conroe[Conroe.length] = createMarker(new GPoint(-95.40356400,30.29669800),"
Conroe Sda School
3601 E. Loop 336 South
Conroe, TX 77301
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Conroe Sda School",'Conroe=' + Conroe.length); Conroe[Conroe.length] = createMarker(new GPoint(-95.40356400,30.29669800),"
Conroe Seventh Day Adventist
3601 E Loop 336 S
Conroe, TX 77301
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Conroe Seventh Day Adventist",'Conroe=' + Conroe.length); Conroe[Conroe.length] = createMarker(new GPoint(-95.40418700,30.29572500),"
Conroe Seventh Day Adventist Jr Academy
3601 S Loop 336 E
Conroe, TX 77301
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Conroe Seventh Day Adventist Jr Academy",'Conroe=' + Conroe.length); Conroe[Conroe.length] = createMarker(new GPoint(-95.50310000,30.32890000),"
Covenant Christian School
4503 Ih 45 North
Conroe, TX 77304
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Covenant Christian School",'Conroe=' + Conroe.length); The_Woodlands[The_Woodlands.length] = createMarker(new GPoint(-95.50069700,30.16755200),"
Esprit International School
4890 W Panther Creek Drive
The Woodlands, TX 77381
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Esprit International School",'The_Woodlands=' + The_Woodlands.length); Conroe[Conroe.length] = createMarker(new GPoint(-95.45691400,30.31351900),"
First Baptist Academy
600 N Main Street
Conroe, TX 77301
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Baptist Academy",'Conroe=' + Conroe.length); The_Woodlands[The_Woodlands.length] = createMarker(new GPoint(-95.46590000,30.14170000),"
First Baptist Child Development Center
11801 Grogans Mill Road
The Woodlands, TX 77380
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Baptist Child Development Center",'The_Woodlands=' + The_Woodlands.length); The_Woodlands[The_Woodlands.length] = createMarker(new GPoint(-95.46590000,30.14170000),"
Greystone House Montessori
1000 Evergreen Circle
The Woodlands, TX 77380
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greystone House Montessori",'The_Woodlands=' + The_Woodlands.length); Woodlands[Woodlands.length] = createMarker(new GPoint(-95.50400000,30.17770000),"
The Harvest Waldorf School
5125 Shadowbend Place
Woodlands, TX 77381
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Harvest Waldorf School",'Woodlands=' + Woodlands.length); The_Woodlands[The_Woodlands.length] = createMarker(new GPoint(-95.52104000,30.17227900),"
Interfaith Child Development Center
5630 Rush Haven Drive
The Woodlands, TX 77381
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Interfaith Child Development Center",'The_Woodlands=' + The_Woodlands.length); The_Woodlands[The_Woodlands.length] = createMarker(new GPoint(-95.52758800,30.17302800),"
The John Cooper School
1 John Cooper Drive
The Woodlands, TX 77381
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The John Cooper School",'The_Woodlands=' + The_Woodlands.length); Porter[Porter.length] = createMarker(new GPoint(-95.25495500,30.11454400),"
Joyful Sound Christian Academy
20721 Baldwin Lane
Porter, TX 77365
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Joyful Sound Christian Academy",'Porter=' + Porter.length); Kingwood[Kingwood.length] = createMarker(new GPoint(-95.23218000,30.06875200),"
Kingwood Christian Academy
1365 Northpark Drive
Kingwood, TX 77339
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kingwood Christian Academy",'Kingwood=' + Kingwood.length); Conroe[Conroe.length] = createMarker(new GPoint(-95.48509400,30.35939300),"
Lifestyle Christian School
3993 Interstate 45 North
Conroe, TX 77304
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lifestyle Christian School",'Conroe=' + Conroe.length); Conroe[Conroe.length] = createMarker(new GPoint(-95.43032700,30.29794300),"
Mims Christian Academy
1609 Porter Rd
Conroe, TX 77301
Co-ed school, 1-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mims Christian Academy",'Conroe=' + Conroe.length); Conroe[Conroe.length] = createMarker(new GPoint(-95.46351200,30.32462800),"
Montgomery County Christian School
601 W. Semands
Conroe, TX 77301
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montgomery County Christian School",'Conroe=' + Conroe.length); The_Woodlands[The_Woodlands.length] = createMarker(new GPoint(-95.44101900,30.15717000),"
Oak Ridge Christian Academy
27420 Robinson Road
The Woodlands, TX 77385
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oak Ridge Christian Academy",'The_Woodlands=' + The_Woodlands.length); Spring[Spring.length] = createMarker(new GPoint(-95.44974000,30.12647600),"
The Oakwood School
417 Sawdust Road
Spring, TX 77380
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Oakwood School",'Spring=' + Spring.length); Spring[Spring.length] = createMarker(new GPoint(-95.50050700,30.18174000),"
Parkway Christian School
22 Mallard Glen Place
Spring, TX 77381
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parkway Christian School",'Spring=' + Spring.length); The_Woodlands[The_Woodlands.length] = createMarker(new GPoint(-95.53046700,30.23201800),"
The Rubicon Academy
14211 Horseshoe Bend
The Woodlands, TX 77384
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Rubicon Academy",'The_Woodlands=' + The_Woodlands.length); Conroe[Conroe.length] = createMarker(new GPoint(-95.46084300,30.30855900),"
Sacred Heart Catholic School
615 Mcdade St
Conroe, TX 77301
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Catholic School",'Conroe=' + Conroe.length); Conroe[Conroe.length] = createMarker(new GPoint(-95.52080600,30.34120400),"
St. James Episcopal School
1803 Highland Hollow Drive
Conroe, TX 77304
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. James Episcopal School",'Conroe=' + Conroe.length); Conroe[Conroe.length] = createMarker(new GPoint(-95.45969100,30.33617200),"
St. Mark Lutheran School
2100 Tickner Street
Conroe, TX 77301
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mark Lutheran School",'Conroe=' + Conroe.length); The_Woodlands[The_Woodlands.length] = createMarker(new GPoint(-95.52977100,30.20656000),"
St Anthony Of Padua Catholic School
7901 Bay Branch Drive
The Woodlands, TX 77382
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Anthony Of Padua Catholic School",'The_Woodlands=' + The_Woodlands.length); Willis[Willis.length] = createMarker(new GPoint(-95.43450000,30.44210000),"
Todds School Of Merit
Po Box 1646
Willis, TX 77378
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Todds School Of Merit",'Willis=' + Willis.length); Spring[Spring.length] = createMarker(new GPoint(-95.54792600,30.15898200),"
The Woodlands Preparatory School
27440 Kuykendahl Rd.
Spring, TX 77389
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Woodlands Preparatory School",'Spring=' + Spring.length); Spring[Spring.length] = createMarker(new GPoint(-95.53968900,30.09869000),"
The Woodlands Academy Preparatory School
27440 Kuykendahl Road
Spring, TX 77389
Co-ed school, K-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Woodlands Academy Preparatory School",'Spring=' + Spring.length); The_Woodlands[The_Woodlands.length] = createMarker(new GPoint(-95.48038300,30.22292100),"
Woodlands Christian Academy
5800 Academy Way
The Woodlands, TX 77384
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodlands Christian Academy",'The_Woodlands=' + The_Woodlands.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); } // 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/////3/' + showArray); map.removeOverlays(Conroe); map.removeOverlays(Kingwood); map.removeOverlays(Pinehurst); map.removeOverlays(Porter); map.removeOverlays(Spring); map.removeOverlays(The_Woodlands); map.removeOverlays(Willis); map.removeOverlays(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(Conroe);map.removeOverlays(Conroe); map.removeOverlays(Kingwood); map.removeOverlays(Pinehurst); map.removeOverlays(Porter); map.removeOverlays(Spring); map.removeOverlays(The_Woodlands); map.removeOverlays(Willis); map.removeOverlays(Woodlands); map.addOverlays(Conroe); centerByArray(Conroe, false, false); cntMarker += Conroe.length; map.addOverlays(Kingwood); centerByArray(Kingwood, false, false); cntMarker += Kingwood.length; map.addOverlays(Pinehurst); centerByArray(Pinehurst, false, false); cntMarker += Pinehurst.length; map.addOverlays(Porter); centerByArray(Porter, false, false); cntMarker += Porter.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(Willis); centerByArray(Willis, false, false); cntMarker += Willis.length; map.addOverlays(Woodlands); centerByArray(Woodlands, false, false); cntMarker += Woodlands.length; centerByArray(Conroe,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=1&schools=&school_level=3&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; }