function addMarkers(){ mySelect = document.getElementById('selection'); Broken_Arrow = [];Tulsa = [];Sperry = [];Glenpool = [];Sand_Springs = [];Owasso = [];mySelect.options[mySelect.options.length] = new Option("Broken Arrow schools",'all=Broken_Arrow'); mySelect.options[mySelect.options.length] = new Option("Glenpool schools",'all=Glenpool'); mySelect.options[mySelect.options.length] = new Option("Owasso schools",'all=Owasso'); mySelect.options[mySelect.options.length] = new Option("Sand Springs schools",'all=Sand_Springs'); mySelect.options[mySelect.options.length] = new Option("Sperry schools",'all=Sperry'); mySelect.options[mySelect.options.length] = new Option("Tulsa schools",'all=Tulsa'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Broken_Arrow[Broken_Arrow.length] = createMarker(new GPoint(-95.77944400,36.05038200),"
All Saints Catholic School
299 S 9th Street
Broken Arrow, OK 74012
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("All Saints Catholic School",'Broken_Arrow=' + Broken_Arrow.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.90568500,36.12095200),"
Augustine Christian Academy
6310 E 30th Street
Tulsa, OK 74114
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Augustine Christian Academy",'Tulsa=' + Tulsa.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-96.01362900,36.09115300),"
Bible Fellowship School
4915 S Waco Avenue
Tulsa, OK 74107
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bible Fellowship School",'Tulsa=' + Tulsa.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.91306800,36.10632200),"
Bishop Kelley High School
3905 S Hudson Avenue
Tulsa, OK 74135
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bishop Kelley High School",'Tulsa=' + Tulsa.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.99035900,36.15139000),"
Cascia Hall Preparatory School
2520 S Yorktown Ave, Pob 52247
Tulsa, OK 74152
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cascia Hall Preparatory School",'Tulsa=' + Tulsa.length); Sperry[Sperry.length] = createMarker(new GPoint(-95.92003900,36.26600300),"
Cornerstone Christian Academy
7770 N Whirlpool Drive
Sperry, OK 74073
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone Christian Academy",'Sperry=' + Sperry.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.97489600,36.08443700),"
Evangelistic Temple School
1339 E 55th Street
Tulsa, OK 74105
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Evangelistic Temple School",'Tulsa=' + Tulsa.length); Broken_Arrow[Broken_Arrow.length] = createMarker(new GPoint(-95.85108900,36.02305600),"
Grace Christian School
9610 S Garnett Road
Broken Arrow, OK 74012
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Christian School",'Broken_Arrow=' + Broken_Arrow.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.85108900,36.02305600),"
Grace Christian School
9610 S Garnett Rd
Tulsa, OK 74136
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Christian School",'Tulsa=' + Tulsa.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.89548500,36.14093600),"
Greater Tulsa Christian Acadmy
7301 East 15th
Tulsa, OK 74112
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greater Tulsa Christian Acadmy",'Tulsa=' + Tulsa.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.91321100,36.04614400),"
Holland Hall
5666 E 81st
Tulsa, OK 74137
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holland Hall",'Tulsa=' + Tulsa.length); Glenpool[Glenpool.length] = createMarker(new GPoint(-96.00740000,35.95400000),"
Hope Christian Academy
P.o. Box 976
Glenpool, OK 74033
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hope Christian Academy",'Glenpool=' + Glenpool.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.96892900,36.07189600),"
Metro Christian Academy
6363 S Trenton Avenue
Tulsa, OK 74136
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Metro Christian Academy",'Tulsa=' + Tulsa.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.87960100,36.07526300),"
Mingo Valley Christian School
8720 E 61st Street
Tulsa, OK 74133
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mingo Valley Christian School",'Tulsa=' + Tulsa.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.95836200,36.13130800),"
Monte Cassino School
2206 South Lewis
Tulsa, OK 74114
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Monte Cassino School",'Tulsa=' + Tulsa.length); Sand_Springs[Sand_Springs.length] = createMarker(new GPoint(-96.10618400,36.10448300),"
Moriah Christian Academy
680 E 41st Street
Sand Springs, OK 74063
Co-ed school, 2-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Moriah Christian Academy",'Sand_Springs=' + Sand_Springs.length); Broken_Arrow[Broken_Arrow.length] = createMarker(new GPoint(-95.72220000,36.05390000),"
New Covenant Academy Inc
11045 S.State Highway 51
Broken Arrow, OK 74014
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Covenant Academy Inc",'Broken_Arrow=' + Broken_Arrow.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.95804600,36.17066500),"
Oklahoma Job Corps Academy
1133 N Lewis Avenue
Tulsa, OK 74110
Co-ed school, 12-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oklahoma Job Corps Academy",'Tulsa=' + Tulsa.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.91126900,36.09616300),"
Peace Academy
4620 S Irvington Avenue
Tulsa, OK 74135
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Peace Academy",'Tulsa=' + Tulsa.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.91126900,36.09616300),"
Peace Elementary Academy
4620 South Irvington Avenue
Tulsa, OK 74135
Co-ed school, PK-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Peace Elementary Academy",'Tulsa=' + Tulsa.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.88593400,36.04023900),"
Regent Preparatory School
8621 S. Memorial Dr.
Tulsa, OK 74133
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Regent Preparatory School",'Tulsa=' + Tulsa.length); Owasso[Owasso.length] = createMarker(new GPoint(-95.82418500,36.30769900),"
Rejoice Christian School
13413 E 106th St North
Owasso, OK 74055
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rejoice Christian School",'Owasso=' + Owasso.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-96.01865900,36.07543800),"
Riverfield Country Day School
2433 W 61st Street
Tulsa, OK 74132
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Riverfield Country Day School",'Tulsa=' + Tulsa.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.91970900,36.01719400),"
Town & Country School, Inc.
5150 E 101st St
Tulsa, OK 74137
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Town & Country School, Inc.",'Tulsa=' + Tulsa.length); Broken_Arrow[Broken_Arrow.length] = createMarker(new GPoint(-95.78307000,36.06383200),"
Trinity Christian School
1108 North Sixth Street
Broken Arrow, OK 74012
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Christian School",'Broken_Arrow=' + Broken_Arrow.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.93378100,36.14947400),"
Tulsa Adventist Academy
900 S New Haven Ave
Tulsa, OK 74112
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tulsa Adventist Academy",'Tulsa=' + Tulsa.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.95809300,36.05161400),"
Victory Christian School
7700 South Lewis Avenue
Tulsa, OK 74136
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Victory Christian School",'Tulsa=' + Tulsa.length); Tulsa[Tulsa.length] = createMarker(new GPoint(-95.84882100,36.16079400),"
Wright Christian Academy
11391 E Admiral Place
Tulsa, OK 74116
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wright Christian Academy",'Tulsa=' + Tulsa.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/////2/' + showArray); map.removeOverlays(Broken_Arrow); map.removeOverlays(Glenpool); map.removeOverlays(Owasso); map.removeOverlays(Sand_Springs); map.removeOverlays(Sperry); map.removeOverlays(Tulsa); 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(Broken_Arrow);map.removeOverlays(Broken_Arrow); map.removeOverlays(Glenpool); map.removeOverlays(Owasso); map.removeOverlays(Sand_Springs); map.removeOverlays(Sperry); map.removeOverlays(Tulsa); map.addOverlays(Broken_Arrow); centerByArray(Broken_Arrow, false, false); cntMarker += Broken_Arrow.length; map.addOverlays(Glenpool); centerByArray(Glenpool, false, false); cntMarker += Glenpool.length; map.addOverlays(Owasso); centerByArray(Owasso, false, false); cntMarker += Owasso.length; map.addOverlays(Sand_Springs); centerByArray(Sand_Springs, false, false); cntMarker += Sand_Springs.length; map.addOverlays(Sperry); centerByArray(Sperry, false, false); cntMarker += Sperry.length; map.addOverlays(Tulsa); centerByArray(Tulsa, false, false); cntMarker += Tulsa.length; centerByArray(Broken_Arrow,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=2&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; }