function addMarkers() { mySelect = document.getElementById('selection'); Carlisle = [];Lebanon = [];Franklin = [];Springboro = [];Kings_Mills = [];Maineville = [];Blanchester = [];Morrow = [];Mason = [];Waynesville = [];mySelect.options[mySelect.options.length] = new Option("Blanchester schools",'all=Blanchester'); mySelect.options[mySelect.options.length] = new Option("Carlisle schools",'all=Carlisle'); mySelect.options[mySelect.options.length] = new Option("Franklin schools",'all=Franklin'); mySelect.options[mySelect.options.length] = new Option("Kings Mills schools",'all=Kings_Mills'); mySelect.options[mySelect.options.length] = new Option("Lebanon schools",'all=Lebanon'); mySelect.options[mySelect.options.length] = new Option("Maineville schools",'all=Maineville'); mySelect.options[mySelect.options.length] = new Option("Mason schools",'all=Mason'); mySelect.options[mySelect.options.length] = new Option("Morrow schools",'all=Morrow'); mySelect.options[mySelect.options.length] = new Option("Springboro schools",'all=Springboro'); mySelect.options[mySelect.options.length] = new Option("Waynesville schools",'all=Waynesville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Carlisle[Carlisle.length] = createMarker(new GPoint(-84.32352448,39.58546448),"
Alden R Brown Elementary School
310 Jamaica Rd
Carlisle, OH 45005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Alden R Brown Elementary School",'Carlisle=' + Carlisle.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-84.18952179,39.44253540),"
Alfred Holbrook Elementary School
23 Oakwood Ave
Lebanon, OH 45036

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Alfred Holbrook Elementary School",'Lebanon=' + Lebanon.length); Franklin[Franklin.length] = createMarker(new GPoint(-84.31201935,39.55345535),"
Anthony Wayne Elementary School
16 Farm Ave
Franklin, OH 45005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Anthony Wayne Elementary School",'Franklin=' + Franklin.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-84.20825195,39.43934631),"
Berry Middle School
160 Miller Rd
Lebanon, OH 45036

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Berry Middle School",'Lebanon=' + Lebanon.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-84.32352448,39.58617020),"
Carlisle High School
250 Jamaica Rd
Carlisle, OH 45005

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carlisle High School",'Carlisle=' + Carlisle.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-84.32369232,39.58938980),"
Carlisle Intermediate Elementary School
100 Jamaica Rd
Carlisle, OH 45005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carlisle Intermediate Elementary School",'Carlisle=' + Carlisle.length); Carlisle[Carlisle.length] = createMarker(new GPoint(-84.32180786,39.58483887),"
Chamberlain Middle School
720 Fairview Dr
Carlisle, OH 45005

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Chamberlain Middle School",'Carlisle=' + Carlisle.length); Springboro[Springboro.length] = createMarker(new GPoint(-84.23375702,39.54778290),"
Clearcreek Elementary School
750 S Main St
Springboro, OH 45066

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clearcreek Elementary School",'Springboro=' + Springboro.length); Kings_Mills[Kings_Mills.length] = createMarker(new GPoint(-84.28559113,39.31994629),"
Columbia Elementary School
8263 Columbia Rd
Kings Mills, OH 45034

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Columbia Elementary School",'Kings_Mills=' + Kings_Mills.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-84.20503235,39.42511368),"
Donovan Intermediate Elementary School
401 Justice Dr
Lebanon, OH 45036

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Donovan Intermediate Elementary School",'Lebanon=' + Lebanon.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-84.21093750,39.43665695),"
Francis Dunlavy Elementary School
825 Hart Rd.
Lebanon, OH 45036

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Francis Dunlavy Elementary School",'Lebanon=' + Lebanon.length); Franklin[Franklin.length] = createMarker(new GPoint(-84.28792572,39.55485916),"
Franklin High School
750 E 4th St
Franklin, OH 45005

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Franklin High School",'Franklin=' + Franklin.length); Franklin[Franklin.length] = createMarker(new GPoint(-84.30182648,39.55587769),"
Franklin Junior High School
136 E 6th St
Franklin, OH 45005

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Franklin Junior High School",'Franklin=' + Franklin.length); Franklin[Franklin.length] = createMarker(new GPoint(-84.28408051,39.55746460),"
George H Gerke Elementary School
312 Sherman Dr
Franklin, OH 45005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George H Gerke Elementary School",'Franklin=' + Franklin.length); Maineville[Maineville.length] = createMarker(new GPoint(-84.21163177,39.31451416),"
Hamilton-maineville Elementary School
373 E Foster Maineville Rd
Maineville, OH 45039

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hamilton-maineville Elementary School",'Maineville=' + Maineville.length); Blanchester[Blanchester.length] = createMarker(new GPoint(-84.08719635,39.30497360),"
Harlan-butlerville Elementary School
8276 State Route 132
Blanchester, OH 45107

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Harlan-butlerville Elementary School",'Blanchester=' + Blanchester.length); Franklin[Franklin.length] = createMarker(new GPoint(-84.28748322,39.49284363),"
Hunter Elementary School
4418 State Route 122
Franklin, OH 45005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hunter Elementary School",'Franklin=' + Franklin.length); Kings_Mills[Kings_Mills.length] = createMarker(new GPoint(-84.24703217,39.35544968),"
J F Burns Elementary School
8471 Columbia Rd
Kings Mills, OH 45034

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("J F Burns Elementary School",'Kings_Mills=' + Kings_Mills.length); Springboro[Springboro.length] = createMarker(new GPoint(-84.23358917,39.55652237),"
Jonathan Wright Elementary School
40 Florence Dr
Springboro, OH 45066

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jonathan Wright Elementary School",'Springboro=' + Springboro.length); Kings_Mills[Kings_Mills.length] = createMarker(new GPoint(-84.24703217,39.35544968),"
Kings High School
5500 Columbia Rd
Kings Mills, OH 45034

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kings High School",'Kings_Mills=' + Kings_Mills.length); Kings_Mills[Kings_Mills.length] = createMarker(new GPoint(-84.24703217,39.35544968),"
Kings Junior High School
5620 Columbia Rd
Kings Mills, OH 45034

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kings Junior High School",'Kings_Mills=' + Kings_Mills.length); Kings_Mills[Kings_Mills.length] = createMarker(new GPoint(-84.24934387,39.35740280),"
Kings Mills Elementary School
1780 King Ave
Kings Mills, OH 45034

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kings Mills Elementary School",'Kings_Mills=' + Kings_Mills.length); Franklin[Franklin.length] = createMarker(new GPoint(-84.31011963,39.56492615),"
Laura Farrell Elementary School
513 Park Ave
Franklin, OH 45005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Laura Farrell Elementary School",'Franklin=' + Franklin.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-84.20504761,39.45714569),"
Lebanon High School
1716 Drake Rd
Lebanon, OH 45036

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lebanon High School",'Lebanon=' + Lebanon.length); Morrow[Morrow.length] = createMarker(new GPoint(-84.12742615,39.35461044),"
Little Miami High School
3001 E Us 22-3
Morrow, OH 45152

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Miami High School",'Morrow=' + Morrow.length); Morrow[Morrow.length] = createMarker(new GPoint(-84.13697815,39.34915543),"
Little Miami Intermediate Middle School
605 Welch Rd
Morrow, OH 45152

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Little Miami Intermediate Middle School",'Morrow=' + Morrow.length); Morrow[Morrow.length] = createMarker(new GPoint(-84.13697815,39.34915543),"
Little Miami Junior High School
605 Welch Rd
Morrow, OH 45152

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Little Miami Junior High School",'Morrow=' + Morrow.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-84.20513153,39.42412567),"
Louisa Wright Elementary School
600 S East St
Lebanon, OH 45036

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Louisa Wright Elementary School",'Lebanon=' + Lebanon.length); Mason[Mason.length] = createMarker(new GPoint(-84.31047821,39.36253738),"
Mason Early Childhood Center Elementary School
211 N East St
Mason, OH 45040

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mason Early Childhood Center Elementary School",'Mason=' + Mason.length); Mason[Mason.length] = createMarker(new GPoint(-84.29705048,39.36013412),"
Mason Heights Elementary School
200 Northcrest Dr
Mason, OH 45040

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mason Heights Elementary School",'Mason=' + Mason.length); Mason[Mason.length] = createMarker(new GPoint(-84.31045532,39.34716034),"
Mason Intermediate Elementary School
6307 S Mason Montgomery Rd
Mason, OH 45040

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mason Intermediate Elementary School",'Mason=' + Mason.length); Mason[Mason.length] = createMarker(new GPoint(-84.31021118,39.34555054),"
Mason Middle School
6370 S Mason Montgomery Rd
Mason, OH 45040

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mason Middle School",'Mason=' + Mason.length); Morrow[Morrow.length] = createMarker(new GPoint(-84.13201141,39.35243225),"
Morrow Elementary School
10 Miranda St
Morrow, OH 45152

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Morrow Elementary School",'Morrow=' + Morrow.length); Franklin[Franklin.length] = createMarker(new GPoint(-84.25865936,39.58012009),"
Pennyroyal Elementary School
4203 Pennyroyal Rd
Franklin, OH 45005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pennyroyal Elementary School",'Franklin=' + Franklin.length); Maineville[Maineville.length] = createMarker(new GPoint(-84.24703217,39.35544968),"
South Lebanon Elementary School
50 Ridgeview Ln
Maineville, OH 45039

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Lebanon Elementary School",'Maineville=' + Maineville.length); Springboro[Springboro.length] = createMarker(new GPoint(-84.23402405,39.54855347),"
Springboro Elementary School
705 S Main St
Springboro, OH 45066

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Springboro Elementary School",'Springboro=' + Springboro.length); Springboro[Springboro.length] = createMarker(new GPoint(-84.23522949,39.53647995),"
Springboro High School
1675 S Main St
Springboro, OH 45066

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Springboro High School",'Springboro=' + Springboro.length); Springboro[Springboro.length] = createMarker(new GPoint(-84.23514557,39.53726578),"
Springboro Junior High School
1605 S Main St
Springboro, OH 45066

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Springboro Junior High School",'Springboro=' + Springboro.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-84.20054800,39.49009400),"
Warren County Alternative School
3527 N State Route 48
Lebanon, OH 45036

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Warren County Alternative School",'Lebanon=' + Lebanon.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-84.20076752,39.48968506),"
Warren County Career Center
3525 N State Route 48
Lebanon, OH 45036

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Warren County Career Center",'Lebanon=' + Lebanon.length); Lebanon[Lebanon.length] = createMarker(new GPoint(-84.20342900,39.43519100),"
Warren County Virtual Community School
320 E Silver St
Lebanon, OH 45036

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Warren County Virtual Community School",'Lebanon=' + Lebanon.length); Waynesville[Waynesville.length] = createMarker(new GPoint(-84.09147644,39.53459930),"
Waynesville Elementary School
659 Dayton Rd
Waynesville, OH 45068

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Waynesville Elementary School",'Waynesville=' + Waynesville.length); Waynesville[Waynesville.length] = createMarker(new GPoint(-84.09137726,39.53569794),"
Waynesville High School
735 Dayton Rd
Waynesville, OH 45068

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Waynesville High School",'Waynesville=' + Waynesville.length); Waynesville[Waynesville.length] = createMarker(new GPoint(-84.09137726,39.53554916),"
Waynesville Middle School
723 Dayton Rd
Waynesville, OH 45068

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Waynesville Middle School",'Waynesville=' + Waynesville.length); Mason[Mason.length] = createMarker(new GPoint(-84.32799530,39.33716202),"
Western Row Elementary School
755 Western Row Rd
Mason, OH 45040

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Western Row Elementary School",'Mason=' + Mason.length); Franklin[Franklin.length] = createMarker(new GPoint(-84.29022217,39.57000351),"
William C Schenck Elementary School
350 Arlington Dr
Franklin, OH 45005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("William C Schenck Elementary School",'Franklin=' + Franklin.length); Mason[Mason.length] = createMarker(new GPoint(-84.31020355,39.34563828),"
William Mason High School
6100 S Mason Montgomery Rd
Mason, OH 45040

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("William Mason High School",'Mason=' + Mason.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,10); /* 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(Blanchester); map.removeOverlays(Carlisle); map.removeOverlays(Franklin); map.removeOverlays(Kings_Mills); map.removeOverlays(Lebanon); map.removeOverlays(Maineville); map.removeOverlays(Mason); map.removeOverlays(Morrow); map.removeOverlays(Springboro); map.removeOverlays(Waynesville); 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(Carlisle);map.removeOverlays(Blanchester); map.removeOverlays(Carlisle); map.removeOverlays(Franklin); map.removeOverlays(Kings_Mills); map.removeOverlays(Lebanon); map.removeOverlays(Maineville); map.removeOverlays(Mason); map.removeOverlays(Morrow); map.removeOverlays(Springboro); map.removeOverlays(Waynesville); map.addOverlays(Blanchester); centerByArray(Blanchester, false, false); cntMarker += Blanchester.length; map.addOverlays(Carlisle); centerByArray(Carlisle, false, false); cntMarker += Carlisle.length; map.addOverlays(Franklin); centerByArray(Franklin, false, false); cntMarker += Franklin.length; map.addOverlays(Kings_Mills); centerByArray(Kings_Mills, false, false); cntMarker += Kings_Mills.length; map.addOverlays(Lebanon); centerByArray(Lebanon, false, false); cntMarker += Lebanon.length; map.addOverlays(Maineville); centerByArray(Maineville, false, false); cntMarker += Maineville.length; map.addOverlays(Mason); centerByArray(Mason, false, false); cntMarker += Mason.length; map.addOverlays(Morrow); centerByArray(Morrow, false, false); cntMarker += Morrow.length; map.addOverlays(Springboro); centerByArray(Springboro, false, false); cntMarker += Springboro.length; map.addOverlays(Waynesville); centerByArray(Waynesville, false, false); cntMarker += Waynesville.length; centerByArray(Carlisle,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'); } }