function addMarkers(){ mySelect = document.getElementById('selection'); Sugar_Land = [];Stafford = [];Richmond = [];Katy = [];Missouri_City = [];Houston = [];Rosenberg = [];Fresno = [];Simonton = [];mySelect.options[mySelect.options.length] = new Option("Fresno schools",'all=Fresno'); 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("Missouri City schools",'all=Missouri_City'); mySelect.options[mySelect.options.length] = new Option("Richmond schools",'all=Richmond'); mySelect.options[mySelect.options.length] = new Option("Rosenberg schools",'all=Rosenberg'); mySelect.options[mySelect.options.length] = new Option("Simonton schools",'all=Simonton'); mySelect.options[mySelect.options.length] = new Option("Stafford schools",'all=Stafford'); mySelect.options[mySelect.options.length] = new Option("Sugar Land schools",'all=Sugar_Land'); 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); Stafford[Stafford.length] = createMarker(new GPoint(-95.56543900,29.64592000),"
Baker's Preparatory School
504 Murphy Road
Stafford, TX 77477
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Baker's Preparatory School",'Stafford=' + Stafford.length); Stafford[Stafford.length] = createMarker(new GPoint(-95.52728900,29.60864500),"
Bearrington Academy for Success and Excellence
1250 Texas Parkway Suite F
Stafford, TX 77477
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bearrington Academy for Success and Excellence",'Stafford=' + Stafford.length); Richmond[Richmond.length] = createMarker(new GPoint(-95.76617700,29.57590100),"
Calvary Episcopal School, Inc.
1201 Austin Street
Richmond, TX 77469
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Episcopal School, Inc.",'Richmond=' + Richmond.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.66221400,29.60744200),"
Cambridge Montessori School
6380 Highway 90a
Sugar Land, TX 77478
Co-ed school, 1-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cambridge Montessori School",'Sugar_Land=' + Sugar_Land.length); Katy[Katy.length] = createMarker(new GPoint(-95.76765600,29.73466300),"
Children's Lighthouse
23060 Westheimer Parkway
Katy, TX 77494
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Children's Lighthouse",'Katy=' + Katy.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); Missouri_City[Missouri_City.length] = createMarker(new GPoint(-95.52032900,29.57996000),"
Christian Bible Academy
3710 Texas Parkway
Missouri City, TX 77489
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Bible Academy",'Missouri_City=' + Missouri_City.length); Katy[Katy.length] = createMarker(new GPoint(-95.76846300,29.74639900),"
Cinco Ranch Montessori
2530 S Peek Road
Katy, TX 77450
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cinco Ranch Montessori",'Katy=' + Katy.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.63715900,29.59648000),"
Cornerstone Christian Academy
2140 First Colony Blvd
Sugar Land, TX 77479
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone Christian Academy",'Sugar_Land=' + Sugar_Land.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.61796600,29.66478300),"
Dar Ul Arqam School
10415 Synott Road
Sugar Land, TX 77478
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dar Ul Arqam School",'Sugar_Land=' + Sugar_Land.length); Missouri_City[Missouri_City.length] = createMarker(new GPoint(-95.56439900,29.60537000),"
East Wind Christian Academy
980 Fm 1092 Road
Missouri City, TX 77459
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Wind Christian Academy",'Missouri_City=' + Missouri_City.length); Missouri_City[Missouri_City.length] = createMarker(new GPoint(-95.54180000,29.54820000),"
Excel Adventist Academy
Po Box 2240
Missouri City, TX 77459
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Excel Adventist Academy",'Missouri_City=' + Missouri_City.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.63500900,29.61107200),"
Faith Lutheran School
800 Brooks St
Sugar Land, TX 77478
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Lutheran School",'Sugar_Land=' + Sugar_Land.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.59371800,29.59344800),"
First Colony Montessori
2229 Settlers Way Blvd
Sugar Land, TX 77478
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Colony Montessori",'Sugar_Land=' + Sugar_Land.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.60496100,29.59135200),"
First Colony Montessori South
2511 Williams Trace Blvd
Sugar Land, TX 77479
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Colony Montessori South",'Sugar_Land=' + Sugar_Land.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.61597200,29.63081700),"
Fort Bend Baptist Academy
1250 Seventh Street
Sugar Land, TX 77478
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fort Bend Baptist Academy",'Sugar_Land=' + Sugar_Land.length); Houston[Houston.length] = createMarker(new GPoint(-95.60144500,29.66105200),"
Fort Bend Montessori School
12500 W Bellfort Avenue
Houston, TX 77099
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fort Bend Montessori School",'Houston=' + Houston.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.61471200,29.65157400),"
God's Rainbow Christian Academy
13131 Alston Road
Sugar Land, TX 77478
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("God's Rainbow Christian Academy",'Sugar_Land=' + Sugar_Land.length); Missouri_City[Missouri_City.length] = createMarker(new GPoint(-95.52682400,29.60653800),"
Good News Christian Academy
1521 Texas Parkway
Missouri City, TX 77489
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Good News Christian Academy",'Missouri_City=' + Missouri_City.length); Richmond[Richmond.length] = createMarker(new GPoint(-95.65594100,29.68434700),"
Grand Parkway Christian Academy
12000 Fm 1464 Road
Richmond, TX 77469
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grand Parkway Christian Academy",'Richmond=' + Richmond.length); Rosenberg[Rosenberg.length] = createMarker(new GPoint(-95.81765700,29.55376100),"
Holy Rosary Catholic School
1408 James Street
Rosenberg, TX 77471
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Rosary Catholic School",'Rosenberg=' + Rosenberg.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.62906700,29.57578900),"
Honor Roll School Ii
4111 Sweetwater Boulevard
Sugar Land, TX 77479
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Honor Roll School Ii",'Sugar_Land=' + Sugar_Land.length); Stafford[Stafford.length] = createMarker(new GPoint(-95.56942900,29.63601500),"
Houston Learning Academy
3964 Bluebonnet Drive
Stafford, TX 77477
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Houston Learning Academy",'Stafford=' + Stafford.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.62443100,29.63130900),"
Kent Academy Inc
14031 Southwest Fwy Ste 620
Sugar Land, TX 77478
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kent Academy Inc",'Sugar_Land=' + Sugar_Land.length); Fresno[Fresno.length] = createMarker(new GPoint(-95.47914700,29.51655500),"
Kidacious Academy
12402 Highway 6
Fresno, TX 77545
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kidacious Academy",'Fresno=' + Fresno.length); Katy[Katy.length] = createMarker(new GPoint(-95.75596600,29.73373400),"
Learning Center The
3700 S Mason Road
Katy, TX 77450
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Learning Center The",'Katy=' + Katy.length); Stafford[Stafford.length] = createMarker(new GPoint(-95.58233600,29.63305700),"
Learning Stages
12780 S Kirkwood Road
Stafford, TX 77477
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Learning Stages",'Stafford=' + Stafford.length); Missouri_City[Missouri_City.length] = createMarker(new GPoint(-95.53588500,29.61661700),"
Lil' Harvard First Step Private Learning Center
514 12 Texas Parkway
Missouri City, TX 77489
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lil' Harvard First Step Private Learning Center",'Missouri_City=' + Missouri_City.length); Missouri_City[Missouri_City.length] = createMarker(new GPoint(-95.58098800,29.60080500),"
Little Wonders Learning Center
4743 Lexington Blvd
Missouri City, TX 77459
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Wonders Learning Center",'Missouri_City=' + Missouri_City.length); Rosenberg[Rosenberg.length] = createMarker(new GPoint(-95.77685000,29.54276000),"
Living Water College Preparatory
4808 Airport Avenue
Rosenberg, TX 77471
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Living Water College Preparatory",'Rosenberg=' + Rosenberg.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); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.68545000,29.56071800),"
Montessori-greatwood
6633 Greatwood Pkwy
Sugar Land, TX 77469
Co-ed school, -
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori-greatwood",'Sugar_Land=' + Sugar_Land.length); Stafford[Stafford.length] = createMarker(new GPoint(-95.56548400,29.64425900),"
New Beginnings Academy
12240 Murphy Road Suite Q
Stafford, TX 77477
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Beginnings Academy",'Stafford=' + Stafford.length); Missouri_City[Missouri_City.length] = createMarker(new GPoint(-95.56439900,29.60537000),"
New Millennium Montessori School
980 Fm 1092 Road
Missouri City, TX 77459
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Millennium Montessori School",'Missouri_City=' + Missouri_City.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.60708100,29.65307500),"
New Southwest Montessori Center
12707 Alston Road
Sugar Land, TX 77478
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Southwest Montessori Center",'Sugar_Land=' + Sugar_Land.length); Missouri_City[Missouri_City.length] = createMarker(new GPoint(-95.55244100,29.58310000),"
Oak Point Academy Montessori
3130 N Pebble Beach Drive
Missouri City, TX 77459
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oak Point Academy Montessori",'Missouri_City=' + Missouri_City.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.64342900,29.67325000),"
Park Point Montessori
11124 S Highway 6
Sugar Land, TX 77498
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Park Point Montessori",'Sugar_Land=' + Sugar_Land.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.58476800,29.57813600),"
Primrose School First Colony
4605 Austin Parkway
Sugar Land, TX 77479
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Primrose School First Colony",'Sugar_Land=' + Sugar_Land.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.68635500,29.56150200),"
Primrose School Of Greatwood
6550 Greatwood Parkway
Sugar Land, TX 77479
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Primrose School Of Greatwood",'Sugar_Land=' + Sugar_Land.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.63127300,29.57548100),"
Riverbend Montessori School
4225 Elkins Road
Sugar Land, TX 77479
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Riverbend Montessori School",'Sugar_Land=' + Sugar_Land.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.61034100,29.57929500),"
St. Laurence Catholic School
2630 Austin Parkway
Sugar Land, TX 77479
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Laurence Catholic School",'Sugar_Land=' + Sugar_Land.length); Richmond[Richmond.length] = createMarker(new GPoint(-95.76128400,29.57950800),"
Shady Oak Christian School
503 Main Street
Richmond, TX 77469
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shady Oak Christian School",'Richmond=' + Richmond.length); Simonton[Simonton.length] = createMarker(new GPoint(-95.97698400,29.67549800),"
Simonton Christian Academy
9703 FM 1489
Simonton, TX 77476
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Simonton Christian Academy",'Simonton=' + Simonton.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); 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); Stafford[Stafford.length] = createMarker(new GPoint(-95.58243900,29.61872500),"
Sugar Creek Montessori School
615 Dulles Avenue
Stafford, TX 77477
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sugar Creek Montessori School",'Stafford=' + Stafford.length); Stafford[Stafford.length] = createMarker(new GPoint(-95.57975800,29.64719000),"
Sugar Grove Christian School
11600 W Airport Blvd
Stafford, TX 77477
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sugar Grove Christian School",'Stafford=' + Stafford.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.63743800,29.63305400),"
Sugar Mill Montessori School
1120 Burney Road
Sugar Land, TX 77478
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sugar Mill Montessori School",'Sugar_Land=' + Sugar_Land.length); Missouri_City[Missouri_City.length] = createMarker(new GPoint(-95.54675900,29.54271000),"
Tree Of Life Christian Academy
7707 Highway 6
Missouri City, TX 77459
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tree Of Life Christian Academy",'Missouri_City=' + Missouri_City.length); Sugar_Land[Sugar_Land.length] = createMarker(new GPoint(-95.61579700,29.59404600),"
Trent InternationalE School
2555 Cordes Drive
Sugar Land, TX 77479
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trent InternationalE School",'Sugar_Land=' + Sugar_Land.length); Stafford[Stafford.length] = createMarker(new GPoint(-95.55733400,29.61480200),"
Willowridge Day Care & Learning Center
2803 S Main Street
Stafford, TX 77477
Co-ed school, K-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Willowridge Day Care & Learning Center",'Stafford=' + Stafford.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/////1/' + showArray); map.removeOverlays(Fresno); map.removeOverlays(Houston); map.removeOverlays(Katy); map.removeOverlays(Missouri_City); map.removeOverlays(Richmond); map.removeOverlays(Rosenberg); map.removeOverlays(Simonton); map.removeOverlays(Stafford); map.removeOverlays(Sugar_Land); 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(Fresno); map.removeOverlays(Houston); map.removeOverlays(Katy); map.removeOverlays(Missouri_City); map.removeOverlays(Richmond); map.removeOverlays(Rosenberg); map.removeOverlays(Simonton); map.removeOverlays(Stafford); map.removeOverlays(Sugar_Land); map.addOverlays(Fresno); centerByArray(Fresno, false, false); cntMarker += Fresno.length; map.addOverlays(Houston); centerByArray(Houston, false, false); cntMarker += Houston.length; map.addOverlays(Katy); centerByArray(Katy, false, false); cntMarker += Katy.length; map.addOverlays(Missouri_City); centerByArray(Missouri_City, false, false); cntMarker += Missouri_City.length; map.addOverlays(Richmond); centerByArray(Richmond, false, false); cntMarker += Richmond.length; map.addOverlays(Rosenberg); centerByArray(Rosenberg, false, false); cntMarker += Rosenberg.length; map.addOverlays(Simonton); centerByArray(Simonton, false, false); cntMarker += Simonton.length; map.addOverlays(Stafford); centerByArray(Stafford, false, false); cntMarker += Stafford.length; map.addOverlays(Sugar_Land); centerByArray(Sugar_Land, false, false); cntMarker += Sugar_Land.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////all'); //window.open('/map.php?type=1&schools=&school_level=1&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; }