function addMarkers(){ mySelect = document.getElementById('selection'); Columbus = [];Gahanna = [];Blacklick = [];Worthington = [];Grove_City = [];Groveport = [];Brice = [];Westerville = [];Canal_Winchester = [];mySelect.options[mySelect.options.length] = new Option("Blacklick schools",'all=Blacklick'); mySelect.options[mySelect.options.length] = new Option("Brice schools",'all=Brice'); mySelect.options[mySelect.options.length] = new Option("Canal Winchester schools",'all=Canal_Winchester'); mySelect.options[mySelect.options.length] = new Option("Columbus schools",'all=Columbus'); mySelect.options[mySelect.options.length] = new Option("Gahanna schools",'all=Gahanna'); mySelect.options[mySelect.options.length] = new Option("Grove City schools",'all=Grove_City'); mySelect.options[mySelect.options.length] = new Option("Groveport schools",'all=Groveport'); mySelect.options[mySelect.options.length] = new Option("Westerville schools",'all=Westerville'); mySelect.options[mySelect.options.length] = new Option("Worthington schools",'all=Worthington'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Columbus[Columbus.length] = createMarker(new GPoint(-82.91084800,39.94485000),"
Bishop Hartley High School
1285 Zettler Road
Columbus, OH 43227
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bishop Hartley High School",'Columbus=' + Columbus.length); Columbus[Columbus.length] = createMarker(new GPoint(-83.07968000,39.94035600),"
Bishop Ready High School
707 Salisbury Road
Columbus, OH 43204
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bishop Ready High School",'Columbus=' + Columbus.length); Columbus[Columbus.length] = createMarker(new GPoint(-83.01663800,40.04930500),"
Bishop Watterson High School
99 E Cooke Road
Columbus, OH 43214
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bishop Watterson High School",'Columbus=' + Columbus.length); Columbus[Columbus.length] = createMarker(new GPoint(-83.05408800,39.91967700),"
Central Baptist School
1955 Frank Road
Columbus, OH 43223
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Baptist School",'Columbus=' + Columbus.length); Columbus[Columbus.length] = createMarker(new GPoint(-82.87638900,40.04299100),"
The Columbus Academy
Po Box 30745 4300 Cherry Bottom Road
Columbus, OH 43230
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Columbus Academy",'Columbus=' + Columbus.length); Columbus[Columbus.length] = createMarker(new GPoint(-82.93922000,39.96783800),"
Columbus School For Girls
56 S Columbia Avenue
Columbus, OH 43209
All-girls school, PK-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Columbus School For Girls",'Columbus=' + Columbus.length); Columbus[Columbus.length] = createMarker(new GPoint(-82.85359900,39.97228100),"
Columbus Torah Academy
181 Noe Bixby Road
Columbus, OH 43213
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Columbus Torah Academy",'Columbus=' + Columbus.length); Gahanna[Gahanna.length] = createMarker(new GPoint(-82.86509600,40.03940200),"
Gahanna Christian Academy
817 North Hamilton Road
Gahanna, OH 43230
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gahanna Christian Academy",'Gahanna=' + Gahanna.length); Blacklick[Blacklick.length] = createMarker(new GPoint(-82.79665100,39.98479000),"
Grace Christian School
7510 E Broad Street
Blacklick, OH 43004
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Christian School",'Blacklick=' + Blacklick.length); Worthington[Worthington.length] = createMarker(new GPoint(-83.00522200,40.08990500),"
Griswold Christian Academy
860 Griswold St
Worthington, OH 43085
Co-ed school, KG-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Griswold Christian Academy",'Worthington=' + Worthington.length); Grove_City[Grove_City.length] = createMarker(new GPoint(-83.07031800,39.86918800),"
Grove City Christian School
4750 Hoover Road
Grove City, OH 43123
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grove City Christian School",'Grove_City=' + Grove_City.length); Groveport[Groveport.length] = createMarker(new GPoint(-82.91036100,39.86846200),"
Madison Christian School
3565 Bixby Road
Groveport, OH 43125
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Madison Christian School",'Groveport=' + Groveport.length); Columbus[Columbus.length] = createMarker(new GPoint(-82.96796200,40.08070000),"
Marburn Academy
1860 Walden Dr
Columbus, OH 43229
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marburn Academy",'Columbus=' + Columbus.length); Brice[Brice.length] = createMarker(new GPoint(-82.83100000,39.91700000),"
New Hope Christian Academy
Po Box 353 3001 Brice Rd
Brice, OH 43109
Co-ed school, K-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Hope Christian Academy",'Brice=' + Brice.length); Westerville[Westerville.length] = createMarker(new GPoint(-82.94636900,40.11073300),"
Northside Christian School
2655 W Schrock Road
Westerville, OH 43081
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northside Christian School",'Westerville=' + Westerville.length); Columbus[Columbus.length] = createMarker(new GPoint(-82.94540400,40.01916700),"
Rosemont Center School
2440 Dawnlight Avenue
Columbus, OH 43211
Co-ed school, 6-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rosemont Center School",'Columbus=' + Columbus.length); Columbus[Columbus.length] = createMarker(new GPoint(-82.94737500,39.96844800),"
St. Charles Preparatory School
2010 E Broad Street
Columbus, OH 43209
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St. Charles Preparatory School",'Columbus=' + Columbus.length); Columbus[Columbus.length] = createMarker(new GPoint(-82.97628700,40.05313500),"
St. Francis De Sales High School
4212 Karl Road
Columbus, OH 43224
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Francis De Sales High School",'Columbus=' + Columbus.length); Columbus[Columbus.length] = createMarker(new GPoint(-82.99105900,40.04129000),"
Tree Of Life Christian School-northridge Branch
935 Northridge Road
Columbus, OH 43224
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tree Of Life Christian School-northridge Branch",'Columbus=' + Columbus.length); Columbus[Columbus.length] = createMarker(new GPoint(-82.99100900,40.04131100),"
Tree Of Life Christian Schools
935 Northridge Rd.
Columbus, OH 43224
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tree Of Life Christian Schools",'Columbus=' + Columbus.length); Columbus[Columbus.length] = createMarker(new GPoint(-83.06577200,40.03108300),"
The Wellington School
3650 Reed Rd
Columbus, OH 43220
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Wellington School",'Columbus=' + Columbus.length); Canal_Winchester[Canal_Winchester.length] = createMarker(new GPoint(-82.82530200,39.88904000),"
World Harvest Christian Academy
4595 Gender Rd.
Canal Winchester, OH 43110
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("World Harvest Christian Academy",'Canal_Winchester=' + Canal_Winchester.length); Worthington[Worthington.length] = createMarker(new GPoint(-83.01012200,40.10022100),"
Worthington Christian Schools
6670 Worthington Galena Road
Worthington, OH 43085
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Worthington Christian Schools",'Worthington=' + Worthington.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(Blacklick); map.removeOverlays(Brice); map.removeOverlays(Canal_Winchester); map.removeOverlays(Columbus); map.removeOverlays(Gahanna); map.removeOverlays(Grove_City); map.removeOverlays(Groveport); map.removeOverlays(Westerville); map.removeOverlays(Worthington); 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(Columbus);map.removeOverlays(Blacklick); map.removeOverlays(Brice); map.removeOverlays(Canal_Winchester); map.removeOverlays(Columbus); map.removeOverlays(Gahanna); map.removeOverlays(Grove_City); map.removeOverlays(Groveport); map.removeOverlays(Westerville); map.removeOverlays(Worthington); map.addOverlays(Blacklick); centerByArray(Blacklick, false, false); cntMarker += Blacklick.length; map.addOverlays(Brice); centerByArray(Brice, false, false); cntMarker += Brice.length; map.addOverlays(Canal_Winchester); centerByArray(Canal_Winchester, false, false); cntMarker += Canal_Winchester.length; map.addOverlays(Columbus); centerByArray(Columbus, false, false); cntMarker += Columbus.length; map.addOverlays(Gahanna); centerByArray(Gahanna, false, false); cntMarker += Gahanna.length; map.addOverlays(Grove_City); centerByArray(Grove_City, false, false); cntMarker += Grove_City.length; map.addOverlays(Groveport); centerByArray(Groveport, false, false); cntMarker += Groveport.length; map.addOverlays(Westerville); centerByArray(Westerville, false, false); cntMarker += Westerville.length; map.addOverlays(Worthington); centerByArray(Worthington, false, false); cntMarker += Worthington.length; centerByArray(Columbus,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; }