function addMarkers(){ mySelect = document.getElementById('selection'); Rogers = [];Cleveland = [];Cincinnati = [];Thornville = [];Copley = [];Cleveland_Hts = [];Dayton = [];Saint_Paris = [];Columbus = [];Lakewood = [];Toledo = [];Wickliffe = [];Shaker_Heights = [];Hunting_Valley = [];Youngstown = [];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("Cleveland Hts schools",'all=Cleveland_Hts'); mySelect.options[mySelect.options.length] = new Option("Columbus schools",'all=Columbus'); mySelect.options[mySelect.options.length] = new Option("Copley schools",'all=Copley'); mySelect.options[mySelect.options.length] = new Option("Dayton schools",'all=Dayton'); mySelect.options[mySelect.options.length] = new Option("Hunting Valley schools",'all=Hunting_Valley'); mySelect.options[mySelect.options.length] = new Option("Lakewood schools",'all=Lakewood'); mySelect.options[mySelect.options.length] = new Option("Rogers schools",'all=Rogers'); mySelect.options[mySelect.options.length] = new Option("Saint Paris schools",'all=Saint_Paris'); mySelect.options[mySelect.options.length] = new Option("Shaker Heights schools",'all=Shaker_Heights'); mySelect.options[mySelect.options.length] = new Option("Thornville schools",'all=Thornville'); mySelect.options[mySelect.options.length] = new Option("Toledo schools",'all=Toledo'); mySelect.options[mySelect.options.length] = new Option("Wickliffe schools",'all=Wickliffe'); mySelect.options[mySelect.options.length] = new Option("Youngstown schools",'all=Youngstown'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Rogers[Rogers.length] = createMarker(new GPoint(-80.61213800,40.77713700),"
Act 1 Education Center
Po Box 319
Rogers, OH 44455
All-boys school, 3-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Act 1 Education Center",'Rogers=' + Rogers.length); Cleveland[Cleveland.length] = createMarker(new GPoint(-81.60998100,41.48009400),"
Benedictine
2900 Mlk Jr Drive
Cleveland, OH 44104
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Benedictine",'Cleveland=' + Cleveland.length); Cincinnati[Cincinnati.length] = createMarker(new GPoint(-84.57877600,39.11213700),"
Elder High School
3900 Vincent Avenue
Cincinnati, OH 45205
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Elder High School",'Cincinnati=' + Cincinnati.length); Thornville[Thornville.length] = createMarker(new GPoint(-82.43969700,39.80591400),"
Fairfield Academy High School
7860 Pleasantville Road
Thornville, OH 43076
All-boys school, 6-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fairfield Academy High School",'Thornville=' + Thornville.length); Copley[Copley.length] = createMarker(new GPoint(-81.65188000,41.09943700),"
The Ghent Academy For Boys
3745 Copley Road
Copley, OH 44321
All-boys school, K-8
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("The Ghent Academy For Boys",'Copley=' + Copley.length); Cincinnati[Cincinnati.length] = createMarker(new GPoint(-84.58695000,39.18962900),"
La Salle High School
3091 North Bend Road
Cincinnati, OH 45239
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("La Salle High School",'Cincinnati=' + Cincinnati.length); Cincinnati[Cincinnati.length] = createMarker(new GPoint(-84.35762700,39.21947700),"
Moeller High School
9001 Montgomery Road
Cincinnati, OH 45242
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Moeller High School",'Cincinnati=' + Cincinnati.length); Cleveland_Hts[Cleveland_Hts.length] = createMarker(new GPoint(-81.53668200,41.51908000),"
Mosdas Our Hatnah
1508 Warrensville Ctr Rd
Cleveland Hts, OH 44121
All-boys school, PK-8
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mosdas Our Hatnah",'Cleveland_Hts=' + Cleveland_Hts.length); Dayton[Dayton.length] = createMarker(new GPoint(-84.28331200,39.73197000),"
Nicholas-liberty Adult
5581 Dayton Liberty Road
Dayton, OH 45418
All-boys school, 7-10
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Nicholas-liberty Adult",'Dayton=' + Dayton.length); Saint_Paris[Saint_Paris.length] = createMarker(new GPoint(-83.97171800,40.15265200),"
Operation Rebirth Christian Academy
1638 Apple Road
Saint Paris, OH 43072
All-boys school, 4-10
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Operation Rebirth Christian Academy",'Saint_Paris=' + Saint_Paris.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); Lakewood[Lakewood.length] = createMarker(new GPoint(-81.78503000,41.48523300),"
St. Edward High School
13500 Detroit Avenue
Lakewood, OH 44107
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St. Edward High School",'Lakewood=' + Lakewood.length); Toledo[Toledo.length] = createMarker(new GPoint(-83.59656000,41.66319300),"
St. Francis De Sales High School
2323 W Bancroft Street
Toledo, OH 43607
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St. Francis De Sales High School",'Toledo=' + Toledo.length); Toledo[Toledo.length] = createMarker(new GPoint(-83.68150300,41.61417000),"
St. John's Jesuit High School
5901 Airport Highway
Toledo, OH 43615
All-boys school, 7-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St. John's Jesuit High School",'Toledo=' + Toledo.length); Cincinnati[Cincinnati.length] = createMarker(new GPoint(-84.56037900,39.20369000),"
St. Xavier High School
600 North Bend Rd
Cincinnati, OH 45224
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St. Xavier High School",'Cincinnati=' + Cincinnati.length); Cleveland[Cleveland.length] = createMarker(new GPoint(-81.70689200,41.48248300),"
St Ignatius High School
1911 W 30th Street
Cleveland, OH 44113
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St Ignatius High School",'Cleveland=' + Cleveland.length); Cincinnati[Cincinnati.length] = createMarker(new GPoint(-84.50473300,39.10644200),"
St Peter Claver Latin School For Boys
Po Box 14686
Cincinnati, OH 45250
All-boys school, K-6
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("St Peter Claver Latin School For Boys",'Cincinnati=' + Cincinnati.length); Wickliffe[Wickliffe.length] = createMarker(new GPoint(-81.48714000,41.59668900),"
Telshe High School
28400 Euclid Avenue
Wickliffe, OH 44092
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Telshe High School",'Wickliffe=' + Wickliffe.length); Shaker_Heights[Shaker_Heights.length] = createMarker(new GPoint(-81.53345400,41.48063700),"
University Lower School
20701 Brantley Road
Shaker Heights, OH 44122
All-boys school, K-8
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("University Lower School",'Shaker_Heights=' + Shaker_Heights.length); Hunting_Valley[Hunting_Valley.length] = createMarker(new GPoint(-81.43811600,41.48584900),"
University School
2785 S O M Center Road
Hunting Valley, OH 44022
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("University School",'Hunting_Valley=' + Hunting_Valley.length); Cleveland[Cleveland.length] = createMarker(new GPoint(-81.51249200,41.50499600),"
Yeshiva High School-jacob Sapirstein Campus Boys
1975 Lyndway Road
Cleveland, OH 44121
All-boys school, 7-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Yeshiva High School-jacob Sapirstein Campus Boys",'Cleveland=' + Cleveland.length); Youngstown[Youngstown.length] = createMarker(new GPoint(-80.62603500,41.11897200),"
Youngstown Youth Academy High School
1387 Commonwealth Ave
Youngstown, OH 44505
All-boys school, 8-10
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Youngstown Youth Academy High School",'Youngstown=' + Youngstown.length); map.removeOverlays(Cincinnati); map.removeOverlays(Cleveland); map.removeOverlays(Cleveland_Hts); map.removeOverlays(Columbus); map.removeOverlays(Copley); map.removeOverlays(Dayton); map.removeOverlays(Hunting_Valley); map.removeOverlays(Lakewood); map.removeOverlays(Rogers); map.removeOverlays(Saint_Paris); map.removeOverlays(Shaker_Heights); map.removeOverlays(Thornville); map.removeOverlays(Toledo); map.removeOverlays(Wickliffe); map.removeOverlays(Youngstown); setTimeout(function(){map.addOverlays(Cincinnati)},1000); setTimeout(function(){map.addOverlays(Cleveland)},1000); setTimeout(function(){map.addOverlays(Cleveland_Hts)},1000); setTimeout(function(){map.addOverlays(Columbus)},1000); setTimeout(function(){map.addOverlays(Copley)},1000); setTimeout(function(){map.addOverlays(Dayton)},1000); setTimeout(function(){map.addOverlays(Hunting_Valley)},1000); setTimeout(function(){map.addOverlays(Lakewood)},1000); setTimeout(function(){map.addOverlays(Rogers)},1000); setTimeout(function(){map.addOverlays(Saint_Paris)},1000); setTimeout(function(){map.addOverlays(Shaker_Heights)},1000); setTimeout(function(){map.addOverlays(Thornville)},1000); setTimeout(function(){map.addOverlays(Toledo)},1000); setTimeout(function(){map.addOverlays(Wickliffe)},1000); setTimeout(function(){map.addOverlays(Youngstown)},1000); maxLng = -80.61213800; maxLat = 41.66319300; minLng = -84.58695000; minLat = 39.10644200; 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(Cincinnati); map.removeOverlays(Cleveland); map.removeOverlays(Cleveland_Hts); map.removeOverlays(Columbus); map.removeOverlays(Copley); map.removeOverlays(Dayton); map.removeOverlays(Hunting_Valley); map.removeOverlays(Lakewood); map.removeOverlays(Rogers); map.removeOverlays(Saint_Paris); map.removeOverlays(Shaker_Heights); map.removeOverlays(Thornville); map.removeOverlays(Toledo); map.removeOverlays(Wickliffe); map.removeOverlays(Youngstown); 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(Rogers);map.removeOverlays(Cincinnati); map.removeOverlays(Cleveland); map.removeOverlays(Cleveland_Hts); map.removeOverlays(Columbus); map.removeOverlays(Copley); map.removeOverlays(Dayton); map.removeOverlays(Hunting_Valley); map.removeOverlays(Lakewood); map.removeOverlays(Rogers); map.removeOverlays(Saint_Paris); map.removeOverlays(Shaker_Heights); map.removeOverlays(Thornville); map.removeOverlays(Toledo); map.removeOverlays(Wickliffe); map.removeOverlays(Youngstown); map.addOverlays(Cincinnati); centerByArray(Cincinnati, false, false); cntMarker += Cincinnati.length; map.addOverlays(Cleveland); centerByArray(Cleveland, false, false); cntMarker += Cleveland.length; map.addOverlays(Cleveland_Hts); centerByArray(Cleveland_Hts, false, false); cntMarker += Cleveland_Hts.length; map.addOverlays(Columbus); centerByArray(Columbus, false, false); cntMarker += Columbus.length; map.addOverlays(Copley); centerByArray(Copley, false, false); cntMarker += Copley.length; map.addOverlays(Dayton); centerByArray(Dayton, false, false); cntMarker += Dayton.length; map.addOverlays(Hunting_Valley); centerByArray(Hunting_Valley, false, false); cntMarker += Hunting_Valley.length; map.addOverlays(Lakewood); centerByArray(Lakewood, false, false); cntMarker += Lakewood.length; map.addOverlays(Rogers); centerByArray(Rogers, false, false); cntMarker += Rogers.length; map.addOverlays(Saint_Paris); centerByArray(Saint_Paris, false, false); cntMarker += Saint_Paris.length; map.addOverlays(Shaker_Heights); centerByArray(Shaker_Heights, false, false); cntMarker += Shaker_Heights.length; map.addOverlays(Thornville); centerByArray(Thornville, false, false); cntMarker += Thornville.length; map.addOverlays(Toledo); centerByArray(Toledo, false, false); cntMarker += Toledo.length; map.addOverlays(Wickliffe); centerByArray(Wickliffe, false, false); cntMarker += Wickliffe.length; map.addOverlays(Youngstown); centerByArray(Youngstown, false, false); cntMarker += Youngstown.length; centerByArray(Rogers,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///21539,21678,21758,22252,21401,22037,21662,21992,32767,22325,22254,35693,21814,21552,22017,22070,22278,22370,31662,21769,22291,35693,21814,22326,21552,/all'); //window.open('/map.php?type=2&schools=21539,21678,21758,22252,21401,22037,21662,21992,32767,22325,22254,35693,21814,21552,22017,22070,22278,22370,31662,21769,22291,35693,21814,22326,21552,&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; }