function addMarkers(){ mySelect = document.getElementById('selection'); Cedar_Park = [];Georgetown = [];Austin = [];Leander = [];Round_Rock = [];Taylor = [];Granger = [];mySelect.options[mySelect.options.length] = new Option("Austin schools",'all=Austin'); mySelect.options[mySelect.options.length] = new Option("Cedar Park schools",'all=Cedar_Park'); mySelect.options[mySelect.options.length] = new Option("Georgetown schools",'all=Georgetown'); mySelect.options[mySelect.options.length] = new Option("Granger schools",'all=Granger'); mySelect.options[mySelect.options.length] = new Option("Leander schools",'all=Leander'); mySelect.options[mySelect.options.length] = new Option("Round Rock schools",'all=Round_Rock'); mySelect.options[mySelect.options.length] = new Option("Taylor schools",'all=Taylor'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Cedar_Park[Cedar_Park.length] = createMarker(new GPoint(-97.82607800,30.52207100),"
Cedar Park Montessori School
400 E Whitestone Blvd
Cedar Park, TX 78613
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cedar Park Montessori School",'Cedar_Park=' + Cedar_Park.length); Georgetown[Georgetown.length] = createMarker(new GPoint(-97.67695900,30.61667000),"
Community Montessori School
500 Pleasant Valley Drive
Georgetown, TX 78626
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Community Montessori School",'Georgetown=' + Georgetown.length); Georgetown[Georgetown.length] = createMarker(new GPoint(-97.71204900,30.65462000),"
Covenant Community Schools
See website for campus locations
Georgetown, TX 78628
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Covenant Community Schools",'Georgetown=' + Georgetown.length); Cedar_Park[Cedar_Park.length] = createMarker(new GPoint(-97.83735500,30.47545700),"
Cypress Creek Montessori
2006 Sunchase Blvd
Cedar Park, TX 78613
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cypress Creek Montessori",'Cedar_Park=' + Cedar_Park.length); Georgetown[Georgetown.length] = createMarker(new GPoint(-97.68839800,30.68412800),"
Grace Academy
302 Serenada Drive
Georgetown, TX 78628
Co-ed school, K-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Academy",'Georgetown=' + Georgetown.length); Austin[Austin.length] = createMarker(new GPoint(-97.78986400,30.47026600),"
Hill Country Christian /Austin
12124 Ranch Rd 620 North
Austin, TX 78750
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hill Country Christian /Austin",'Austin=' + Austin.length); Austin[Austin.length] = createMarker(new GPoint(-97.76024400,30.48873300),"
Holy Family Catholic School
9400 Neenah Avenue
Austin, TX 78717
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Family Catholic School",'Austin=' + Austin.length); Leander[Leander.length] = createMarker(new GPoint(-97.85270000,30.57860000),"
Lifesprings Academy
Po Box 769
Leander, TX 78641
Co-ed school, KG-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lifesprings Academy",'Leander=' + Leander.length); Round_Rock[Round_Rock.length] = createMarker(new GPoint(-97.69435500,30.50787200),"
Round Rock Christian Academy
301 N Lake Creek Drive
Round Rock, TX 78681
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Round Rock Christian Academy",'Round_Rock=' + Round_Rock.length); Taylor[Taylor.length] = createMarker(new GPoint(-97.40736900,30.57209800),"
St. Marys School
520 Washburn Street
Taylor, TX 76574
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Marys School",'Taylor=' + Taylor.length); Taylor[Taylor.length] = createMarker(new GPoint(-97.41349200,30.57308800),"
St. Paul Lutheran School
401 West 7th
Taylor, TX 76574
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Paul Lutheran School",'Taylor=' + Taylor.length); Granger[Granger.length] = createMarker(new GPoint(-97.43630000,30.71630000),"
Ss Cyril & Methodius School
Po Box 248
Granger, TX 76530
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ss Cyril & Methodius School",'Granger=' + Granger.length); Georgetown[Georgetown.length] = createMarker(new GPoint(-97.64721800,30.63775200),"
St Helen Catholic School
2700 E University Avenue
Georgetown, TX 78626
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Helen Catholic School",'Georgetown=' + Georgetown.length); Cedar_Park[Cedar_Park.length] = createMarker(new GPoint(-97.84155300,30.47512500),"
Summit Christian Academy - Cedar Park
2121 Cypress Creek Road
Cedar Park, TX 78613
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Summit Christian Academy - Cedar Park",'Cedar_Park=' + Cedar_Park.length); Leander[Leander.length] = createMarker(new GPoint(-97.84237200,30.56266500),"
Summit Christian Academy - Leander
1303 Leander Drive
Leander, TX 78641
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Summit Christian Academy - Leander",'Leander=' + Leander.length); Georgetown[Georgetown.length] = createMarker(new GPoint(-97.59925900,30.74286800),"
Zion Lutheran School
6101 Fm 1105
Georgetown, TX 78626
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zion Lutheran School",'Georgetown=' + Georgetown.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(Austin); map.removeOverlays(Cedar_Park); map.removeOverlays(Georgetown); map.removeOverlays(Granger); map.removeOverlays(Leander); map.removeOverlays(Round_Rock); map.removeOverlays(Taylor); 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(Cedar_Park);map.removeOverlays(Austin); map.removeOverlays(Cedar_Park); map.removeOverlays(Georgetown); map.removeOverlays(Granger); map.removeOverlays(Leander); map.removeOverlays(Round_Rock); map.removeOverlays(Taylor); map.addOverlays(Austin); centerByArray(Austin, false, false); cntMarker += Austin.length; map.addOverlays(Cedar_Park); centerByArray(Cedar_Park, false, false); cntMarker += Cedar_Park.length; map.addOverlays(Georgetown); centerByArray(Georgetown, false, false); cntMarker += Georgetown.length; map.addOverlays(Granger); centerByArray(Granger, false, false); cntMarker += Granger.length; map.addOverlays(Leander); centerByArray(Leander, false, false); cntMarker += Leander.length; map.addOverlays(Round_Rock); centerByArray(Round_Rock, false, false); cntMarker += Round_Rock.length; map.addOverlays(Taylor); centerByArray(Taylor, false, false); cntMarker += Taylor.length; centerByArray(Cedar_Park,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; }