function addMarkers(){ mySelect = document.getElementById('selection'); Cincinnati = [];Wakeman = [];Columbus = [];Defiance = [];Westerville = [];Worthington = [];Amelia = [];Chesterland = [];Lancaster = [];Mansfield = [];Uniontown = [];Mount_Vernon = [];Heath = [];Oberlin = [];Piqua = [];Cleveland = [];Dayton = [];Girard = [];Toledo = [];Springfield = [];Zanesville = [];mySelect.options[mySelect.options.length] = new Option("Amelia schools",'all=Amelia'); mySelect.options[mySelect.options.length] = new Option("Chesterland schools",'all=Chesterland'); mySelect.options[mySelect.options.length] = new Option("Cincinnati schools",'all=Cincinnati'); mySelect.options[mySelect.options.length] = new Option("Cleveland schools",'all=Cleveland'); mySelect.options[mySelect.options.length] = new Option("Columbus schools",'all=Columbus'); mySelect.options[mySelect.options.length] = new Option("Dayton schools",'all=Dayton'); mySelect.options[mySelect.options.length] = new Option("Defiance schools",'all=Defiance'); mySelect.options[mySelect.options.length] = new Option("Girard schools",'all=Girard'); mySelect.options[mySelect.options.length] = new Option("Heath schools",'all=Heath'); mySelect.options[mySelect.options.length] = new Option("Lancaster schools",'all=Lancaster'); mySelect.options[mySelect.options.length] = new Option("Mansfield schools",'all=Mansfield'); mySelect.options[mySelect.options.length] = new Option("Mount Vernon schools",'all=Mount_Vernon'); mySelect.options[mySelect.options.length] = new Option("Oberlin schools",'all=Oberlin'); mySelect.options[mySelect.options.length] = new Option("Piqua schools",'all=Piqua'); mySelect.options[mySelect.options.length] = new Option("Springfield schools",'all=Springfield'); mySelect.options[mySelect.options.length] = new Option("Toledo schools",'all=Toledo'); mySelect.options[mySelect.options.length] = new Option("Uniontown schools",'all=Uniontown'); mySelect.options[mySelect.options.length] = new Option("Wakeman schools",'all=Wakeman'); 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("Zanesville schools",'all=Zanesville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Cincinnati[Cincinnati.length] = createMarker(new GPoint(-84.51804400,39.15272800),"
Cincinnati Junior Academy
3798 Clifton Avenue
Cincinnati, OH 45220
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cincinnati Junior Academy",'Cincinnati=' + Cincinnati.length); Cincinnati[Cincinnati.length] = createMarker(new GPoint(-84.49428800,39.15066900),"
Cincinnati Shiloh Prepatory School
3660 Washington Avenue
Cincinnati, OH 45229
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cincinnati Shiloh Prepatory School",'Cincinnati=' + Cincinnati.length); Wakeman[Wakeman.length] = createMarker(new GPoint(-82.40810600,41.19452800),"
Clarksfield Seventh-day Adventist School
5001 Zen Road
Wakeman, OH 44889
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clarksfield Seventh-day Adventist School",'Wakeman=' + Wakeman.length); Columbus[Columbus.length] = createMarker(new GPoint(-82.93208000,40.03511400),"
Columbus Adventist Academy
3650 Sunbury Road
Columbus, OH 43219
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Columbus Adventist Academy",'Columbus=' + Columbus.length); Defiance[Defiance.length] = createMarker(new GPoint(-84.34221400,41.28256300),"
Defiance Seventh Day Adventist
1201 E. Second Street
Defiance, OH 43512
Co-ed school, 4-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Defiance Seventh Day Adventist",'Defiance=' + Defiance.length); Columbus[Columbus.length] = createMarker(new GPoint(-82.90589900,39.96718100),"
Eastwood Jr. Academy
270 S Napoleon Avenue
Columbus, OH 43213
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eastwood Jr. Academy",'Columbus=' + Columbus.length); Westerville[Westerville.length] = createMarker(new GPoint(-82.89501300,40.08686600),"
Eastwood SDA Jr. Academy
6350 S Sunbury Road
Westerville, OH 43081
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eastwood SDA Jr. Academy",'Westerville=' + Westerville.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); Amelia[Amelia.length] = createMarker(new GPoint(-84.20653000,39.01533900),"
Hamlet S D A Elementary School
3353 State Route 132
Amelia, OH 45102
Co-ed school, 1-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hamlet S D A Elementary School",'Amelia=' + Amelia.length); Chesterland[Chesterland.length] = createMarker(new GPoint(-81.37357600,41.52268500),"
Kaleidoscope Christian School
7480 Mayfield Road
Chesterland, OH 44026
Co-ed school, 5-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kaleidoscope Christian School",'Chesterland=' + Chesterland.length); Lancaster[Lancaster.length] = createMarker(new GPoint(-82.54595600,39.76138900),"
Lancaster Sda Elementary School
2640 Lancaster Thornville Road Ne
Lancaster, OH 43130
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lancaster Sda Elementary School",'Lancaster=' + Lancaster.length); Mansfield[Mansfield.length] = createMarker(new GPoint(-82.55067600,40.72698900),"
Mansfield Sda School
1040 W Cook Road
Mansfield, OH 44906
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mansfield Sda School",'Mansfield=' + Mansfield.length); Uniontown[Uniontown.length] = createMarker(new GPoint(-81.44822000,40.95594700),"
Mayfair Junior Academy
2350 Graybill Road
Uniontown, OH 44685
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mayfair Junior Academy",'Uniontown=' + Uniontown.length); Mount_Vernon[Mount_Vernon.length] = createMarker(new GPoint(-82.48035900,40.39103000),"
Mount Vernon Academy
Po Box 311
Mount Vernon, OH 43050
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount Vernon Academy",'Mount_Vernon=' + Mount_Vernon.length); Mount_Vernon[Mount_Vernon.length] = createMarker(new GPoint(-82.68840000,40.30970000),"
Mount Vernon Sda Elementary School
Po Box 891
Mount Vernon, OH 43050
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount Vernon Sda Elementary School",'Mount_Vernon=' + Mount_Vernon.length); Heath[Heath.length] = createMarker(new GPoint(-82.39582100,40.03348500),"
Newark Seventh-day Adventist School
701 Linnville Road
Heath, OH 43056
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Newark Seventh-day Adventist School",'Heath=' + Heath.length); Worthington[Worthington.length] = createMarker(new GPoint(-83.05330000,40.10250000),"
Northwest Christian School
5707 Olentangy River Road
Worthington, OH 43235
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northwest Christian School",'Worthington=' + Worthington.length); Oberlin[Oberlin.length] = createMarker(new GPoint(-82.21241100,41.28903300),"
Oberlin Sda Elem. School
99 South Park Street
Oberlin, OH 44074
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oberlin Sda Elem. School",'Oberlin=' + Oberlin.length); Piqua[Piqua.length] = createMarker(new GPoint(-84.27872800,40.15961600),"
Piqua Sda Christian School
4020 W State Route 185
Piqua, OH 45356
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Piqua Sda Christian School",'Piqua=' + Piqua.length); Cleveland[Cleveland.length] = createMarker(new GPoint(-81.56498200,41.42956300),"
Ramah Jr. Academy
4770 Lee Road
Cleveland, OH 44128
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ramah Jr. Academy",'Cleveland=' + Cleveland.length); Dayton[Dayton.length] = createMarker(new GPoint(-84.14200300,39.61370500),"
Spring Valley Academy
1461 E Spring Valley Road
Dayton, OH 45458
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Spring Valley Academy",'Dayton=' + Dayton.length); Girard[Girard.length] = createMarker(new GPoint(-80.72114800,41.14631900),"
Summit Junior Christian Academy
2722 W Liberty St
Girard, OH 44420
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Summit Junior Christian Academy",'Girard=' + Girard.length); Toledo[Toledo.length] = createMarker(new GPoint(-83.66120300,41.69096300),"
Toledo Junior Academy
4909 W Sylvania Avenue
Toledo, OH 43623
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Toledo Junior Academy",'Toledo=' + Toledo.length); Springfield[Springfield.length] = createMarker(new GPoint(-83.73982700,39.92093900),"
Twin Oaks Sda Elementary School
151 S Bird Road
Springfield, OH 45505
Co-ed school, K-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Twin Oaks Sda Elementary School",'Springfield=' + Springfield.length); Zanesville[Zanesville.length] = createMarker(new GPoint(-82.01369900,39.96736300),"
Zanesville Sda Elementary School
824 Taylor Street
Zanesville, OH 43701
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zanesville Sda Elementary School",'Zanesville=' + Zanesville.length); map.removeOverlays(Amelia); map.removeOverlays(Chesterland); map.removeOverlays(Cincinnati); map.removeOverlays(Cleveland); map.removeOverlays(Columbus); map.removeOverlays(Dayton); map.removeOverlays(Defiance); map.removeOverlays(Girard); map.removeOverlays(Heath); map.removeOverlays(Lancaster); map.removeOverlays(Mansfield); map.removeOverlays(Mount_Vernon); map.removeOverlays(Oberlin); map.removeOverlays(Piqua); map.removeOverlays(Springfield); map.removeOverlays(Toledo); map.removeOverlays(Uniontown); map.removeOverlays(Wakeman); map.removeOverlays(Westerville); map.removeOverlays(Worthington); map.removeOverlays(Zanesville); setTimeout(function(){map.addOverlays(Amelia)},1000); setTimeout(function(){map.addOverlays(Chesterland)},1000); setTimeout(function(){map.addOverlays(Cincinnati)},1000); setTimeout(function(){map.addOverlays(Cleveland)},1000); setTimeout(function(){map.addOverlays(Columbus)},1000); setTimeout(function(){map.addOverlays(Dayton)},1000); setTimeout(function(){map.addOverlays(Defiance)},1000); setTimeout(function(){map.addOverlays(Girard)},1000); setTimeout(function(){map.addOverlays(Heath)},1000); setTimeout(function(){map.addOverlays(Lancaster)},1000); setTimeout(function(){map.addOverlays(Mansfield)},1000); setTimeout(function(){map.addOverlays(Mount_Vernon)},1000); setTimeout(function(){map.addOverlays(Oberlin)},1000); setTimeout(function(){map.addOverlays(Piqua)},1000); setTimeout(function(){map.addOverlays(Springfield)},1000); setTimeout(function(){map.addOverlays(Toledo)},1000); setTimeout(function(){map.addOverlays(Uniontown)},1000); setTimeout(function(){map.addOverlays(Wakeman)},1000); setTimeout(function(){map.addOverlays(Westerville)},1000); setTimeout(function(){map.addOverlays(Worthington)},1000); setTimeout(function(){map.addOverlays(Zanesville)},1000); maxLng = -80.72114800; maxLat = 41.69096300; minLng = -84.51804400; minLat = 39.01533900; reCenterMap(); } // 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//////' + showArray); map.removeOverlays(Amelia); map.removeOverlays(Chesterland); map.removeOverlays(Cincinnati); map.removeOverlays(Cleveland); map.removeOverlays(Columbus); map.removeOverlays(Dayton); map.removeOverlays(Defiance); map.removeOverlays(Girard); map.removeOverlays(Heath); map.removeOverlays(Lancaster); map.removeOverlays(Mansfield); map.removeOverlays(Mount_Vernon); map.removeOverlays(Oberlin); map.removeOverlays(Piqua); map.removeOverlays(Springfield); map.removeOverlays(Toledo); map.removeOverlays(Uniontown); map.removeOverlays(Wakeman); map.removeOverlays(Westerville); map.removeOverlays(Worthington); map.removeOverlays(Zanesville); 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(Cincinnati);map.removeOverlays(Amelia); map.removeOverlays(Chesterland); map.removeOverlays(Cincinnati); map.removeOverlays(Cleveland); map.removeOverlays(Columbus); map.removeOverlays(Dayton); map.removeOverlays(Defiance); map.removeOverlays(Girard); map.removeOverlays(Heath); map.removeOverlays(Lancaster); map.removeOverlays(Mansfield); map.removeOverlays(Mount_Vernon); map.removeOverlays(Oberlin); map.removeOverlays(Piqua); map.removeOverlays(Springfield); map.removeOverlays(Toledo); map.removeOverlays(Uniontown); map.removeOverlays(Wakeman); map.removeOverlays(Westerville); map.removeOverlays(Worthington); map.removeOverlays(Zanesville); map.addOverlays(Amelia); centerByArray(Amelia, false, false); cntMarker += Amelia.length; map.addOverlays(Chesterland); centerByArray(Chesterland, false, false); cntMarker += Chesterland.length; map.addOverlays(Cincinnati); centerByArray(Cincinnati, false, false); cntMarker += Cincinnati.length; map.addOverlays(Cleveland); centerByArray(Cleveland, false, false); cntMarker += Cleveland.length; map.addOverlays(Columbus); centerByArray(Columbus, false, false); cntMarker += Columbus.length; map.addOverlays(Dayton); centerByArray(Dayton, false, false); cntMarker += Dayton.length; map.addOverlays(Defiance); centerByArray(Defiance, false, false); cntMarker += Defiance.length; map.addOverlays(Girard); centerByArray(Girard, false, false); cntMarker += Girard.length; map.addOverlays(Heath); centerByArray(Heath, false, false); cntMarker += Heath.length; map.addOverlays(Lancaster); centerByArray(Lancaster, false, false); cntMarker += Lancaster.length; map.addOverlays(Mansfield); centerByArray(Mansfield, false, false); cntMarker += Mansfield.length; map.addOverlays(Mount_Vernon); centerByArray(Mount_Vernon, false, false); cntMarker += Mount_Vernon.length; map.addOverlays(Oberlin); centerByArray(Oberlin, false, false); cntMarker += Oberlin.length; map.addOverlays(Piqua); centerByArray(Piqua, false, false); cntMarker += Piqua.length; map.addOverlays(Springfield); centerByArray(Springfield, false, false); cntMarker += Springfield.length; map.addOverlays(Toledo); centerByArray(Toledo, false, false); cntMarker += Toledo.length; map.addOverlays(Uniontown); centerByArray(Uniontown, false, false); cntMarker += Uniontown.length; map.addOverlays(Wakeman); centerByArray(Wakeman, false, false); cntMarker += Wakeman.length; map.addOverlays(Westerville); centerByArray(Westerville, false, false); cntMarker += Westerville.length; map.addOverlays(Worthington); centerByArray(Worthington, false, false); cntMarker += Worthington.length; map.addOverlays(Zanesville); centerByArray(Zanesville, false, false); cntMarker += Zanesville.length; centerByArray(Cincinnati,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///21922,21773,22324,21593,21599,21670,21490,21490,21491,21491,21859,36043,33956,21922,21526,21684,21789,21687,21727,21774,21806,21850,22324,22307,21741,21493,21535,21593,21796,22371,/all'); //window.open('/map.php?type=2&schools=21922,21773,22324,21593,21599,21670,21490,21490,21491,21491,21859,36043,33956,21922,21526,21684,21789,21687,21727,21774,21806,21850,22324,22307,21741,21493,21535,21593,21796,22371,&school_level=&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; }