function addMarkers() { mySelect = document.getElementById('selection'); Lisbon = [];Salem = [];East_Liverpool = [];Columbiana = [];Wellsville = [];East_Palestine = [];Alliance = [];Leetonia = [];Rogers = [];Salineville = [];Hanoverton = [];East_Rochester = [];West_Point = [];mySelect.options[mySelect.options.length] = new Option("Alliance schools",'all=Alliance'); mySelect.options[mySelect.options.length] = new Option("Columbiana schools",'all=Columbiana'); mySelect.options[mySelect.options.length] = new Option("East Liverpool schools",'all=East_Liverpool'); mySelect.options[mySelect.options.length] = new Option("East Palestine schools",'all=East_Palestine'); mySelect.options[mySelect.options.length] = new Option("East Rochester schools",'all=East_Rochester'); mySelect.options[mySelect.options.length] = new Option("Hanoverton schools",'all=Hanoverton'); mySelect.options[mySelect.options.length] = new Option("Leetonia schools",'all=Leetonia'); mySelect.options[mySelect.options.length] = new Option("Lisbon schools",'all=Lisbon'); mySelect.options[mySelect.options.length] = new Option("Rogers schools",'all=Rogers'); mySelect.options[mySelect.options.length] = new Option("Salem schools",'all=Salem'); mySelect.options[mySelect.options.length] = new Option("Salineville schools",'all=Salineville'); mySelect.options[mySelect.options.length] = new Option("Wellsville schools",'all=Wellsville'); mySelect.options[mySelect.options.length] = new Option("West Point schools",'all=West_Point'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Lisbon[Lisbon.length] = createMarker(new GPoint(-80.63564301,40.71072769),"
Beaver Local High School
13187 State Route 7
Lisbon, OH 44432

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beaver Local High School",'Lisbon=' + Lisbon.length); Lisbon[Lisbon.length] = createMarker(new GPoint(-80.63462830,40.71275711),"
Beaver Local Middle School
13052 State Route 7
Lisbon, OH 44432

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Beaver Local Middle School",'Lisbon=' + Lisbon.length); Salem[Salem.length] = createMarker(new GPoint(-80.85951996,40.91196060),"
Buckeye Elementary School
1200 Buckeye Ave
Salem, OH 44460

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buckeye Elementary School",'Salem=' + Salem.length); East_Liverpool[East_Liverpool.length] = createMarker(new GPoint(-80.57751300,40.61908000),"
Buckeye On-line School For Success
519 Broadway St
East Liverpool, OH 43920

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Buckeye On-line School For Success",'East_Liverpool=' + East_Liverpool.length); East_Liverpool[East_Liverpool.length] = createMarker(new GPoint(-80.57437134,40.67587280),"
Calcutta Elementary School
15482 State Route 170
East Liverpool, OH 43920

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Calcutta Elementary School",'East_Liverpool=' + East_Liverpool.length); Lisbon[Lisbon.length] = createMarker(new GPoint(-80.74989319,40.76546860),"
Columbiana County High School
9364 State Route 45
Lisbon, OH 44432

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Columbiana County High School",'Lisbon=' + Lisbon.length); Columbiana[Columbiana.length] = createMarker(new GPoint(-80.68164825,40.88012695),"
Columbiana High School
700 Columbiana Waterford Rd
Columbiana, OH 44408

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Columbiana High School",'Columbiana=' + Columbiana.length); Columbiana[Columbiana.length] = createMarker(new GPoint(-80.66912842,40.84936142),"
Crestview Elementary School
3407 Middleton Rd
Columbiana, OH 44408

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Crestview Elementary School",'Columbiana=' + Columbiana.length); Columbiana[Columbiana.length] = createMarker(new GPoint(-80.68840027,40.88729858),"
Crestview High School
44100 Crestview Rd Ste B
Columbiana, OH 44408

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crestview High School",'Columbiana=' + Columbiana.length); Columbiana[Columbiana.length] = createMarker(new GPoint(-80.66797638,40.84233856),"
Crestview Middle School
44100 Crestview Rd Ste C
Columbiana, OH 44408

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Crestview Middle School",'Columbiana=' + Columbiana.length); Lisbon[Lisbon.length] = createMarker(new GPoint(-80.77172852,40.77546310),"
David Anderson Jr/sr High School
260 W Pine St
Lisbon, OH 44432

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("David Anderson Jr/sr High School",'Lisbon=' + Lisbon.length); Wellsville[Wellsville.length] = createMarker(new GPoint(-80.64836121,40.60410309),"
Daw Middle School
929 Center St
Wellsville, OH 43968

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Daw Middle School",'Wellsville=' + Wellsville.length); East_Liverpool[East_Liverpool.length] = createMarker(new GPoint(-80.54562378,40.63459778),"
East Elementary School
1417 Etruria St
East Liverpool, OH 43920

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Elementary School",'East_Liverpool=' + East_Liverpool.length); East_Liverpool[East_Liverpool.length] = createMarker(new GPoint(-80.56670380,40.62985611),"
East Liverpool High School
100 Maine Blvd
East Liverpool, OH 43920

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Liverpool High School",'East_Liverpool=' + East_Liverpool.length); East_Liverpool[East_Liverpool.length] = createMarker(new GPoint(-80.58937836,40.62497711),"
East Liverpool Middle School
810 W 8th St
East Liverpool, OH 43920

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("East Liverpool Middle School",'East_Liverpool=' + East_Liverpool.length); East_Palestine[East_Palestine.length] = createMarker(new GPoint(-80.54255676,40.83893585),"
East Palestine Elementary School
195 W Grant St
East Palestine, OH 44413

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Palestine Elementary School",'East_Palestine=' + East_Palestine.length); East_Palestine[East_Palestine.length] = createMarker(new GPoint(-80.54634857,40.83893585),"
East Palestine High School
360 W Grant St
East Palestine, OH 44413

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Palestine High School",'East_Palestine=' + East_Palestine.length); East_Palestine[East_Palestine.length] = createMarker(new GPoint(-80.54566956,40.83893585),"
East Palestine Middle School
320 W Grant St
East Palestine, OH 44413

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("East Palestine Middle School",'East_Palestine=' + East_Palestine.length); Wellsville[Wellsville.length] = createMarker(new GPoint(-80.65793610,40.59940720),"
Garfield Elementary School
1600 Lincoln Ave
Wellsville, OH 43968

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Wellsville=' + Wellsville.length); Salem[Salem.length] = createMarker(new GPoint(-80.84409332,40.90643692),"
H E Mullins Practical Nursing
1200 E 6th St
Salem, OH 44460

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("H E Mullins Practical Nursing",'Salem=' + Salem.length); Columbiana[Columbiana.length] = createMarker(new GPoint(-80.69688416,40.89386368),"
Joshua Dixon Elementary School
333 N Middle St
Columbiana, OH 44408

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Joshua Dixon Elementary School",'Columbiana=' + Columbiana.length); Alliance[Alliance.length] = createMarker(new GPoint(-81.03081512,40.85912323),"
Knox Elementary School
2900 Knox School Rd
Alliance, OH 44601

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Knox Elementary School",'Alliance=' + Alliance.length); East_Liverpool[East_Liverpool.length] = createMarker(new GPoint(-80.59539795,40.64682770),"
Lacroft Elementary School
2460 Boring Ln
East Liverpool, OH 43920

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lacroft Elementary School",'East_Liverpool=' + East_Liverpool.length); Leetonia[Leetonia.length] = createMarker(new GPoint(-80.76389313,40.88626862),"
Leetonia Elementary School
450 Walnut St
Leetonia, OH 44431

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Leetonia Elementary School",'Leetonia=' + Leetonia.length); Leetonia[Leetonia.length] = createMarker(new GPoint(-80.76389313,40.88626862),"
Leetonia High School
450 Walnut St
Leetonia, OH 44431

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Leetonia High School",'Leetonia=' + Leetonia.length); Leetonia[Leetonia.length] = createMarker(new GPoint(-80.76389313,40.88626862),"
Leetonia Middle School
450 Walnut St
Leetonia, OH 44431

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Leetonia Middle School",'Leetonia=' + Leetonia.length); Wellsville[Wellsville.length] = createMarker(new GPoint(-80.64737701,40.60447693),"
Macdonald Elementary School
305 9th St
Wellsville, OH 43968

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Macdonald Elementary School",'Wellsville=' + Wellsville.length); Lisbon[Lisbon.length] = createMarker(new GPoint(-80.76048279,40.77343750),"
Mckinley Elementary School
441 E Chestnut St
Lisbon, OH 44432

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Lisbon=' + Lisbon.length); East_Liverpool[East_Liverpool.length] = createMarker(new GPoint(-80.56699371,40.62989044),"
North Elementary School
90 Maine Blvd
East Liverpool, OH 43920

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Elementary School",'East_Liverpool=' + East_Liverpool.length); Salem[Salem.length] = createMarker(new GPoint(-80.84793091,40.89786148),"
Reilly Elementary School
491 Reilly Ave
Salem, OH 44460

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Reilly Elementary School",'Salem=' + Salem.length); Rogers[Rogers.length] = createMarker(new GPoint(-80.62400818,40.78356934),"
Rogers Elementary School
8059 Sprucevale Rd
Rogers, OH 44455

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rogers Elementary School",'Rogers=' + Rogers.length); Salem[Salem.length] = createMarker(new GPoint(-80.84409332,40.90643692),"
Salem High School
1200 E 6th St
Salem, OH 44460

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Salem High School",'Salem=' + Salem.length); Columbiana[Columbiana.length] = createMarker(new GPoint(-80.68128204,40.87991714),"
South Side Middle School
720 Columbiana Waterford Rd
Columbiana, OH 44408

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("South Side Middle School",'Columbiana=' + Columbiana.length); Salem[Salem.length] = createMarker(new GPoint(-80.83126831,40.89143753),"
Southeast Elementary School
2200 Merle Rd
Salem, OH 44460

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Southeast Elementary School",'Salem=' + Salem.length); Salineville[Salineville.length] = createMarker(new GPoint(-80.83638763,40.62333679),"
Southern Local Elementary School
38095e State Route 39
Salineville, OH 43945

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southern Local Elementary School",'Salineville=' + Salineville.length); Salineville[Salineville.length] = createMarker(new GPoint(-80.78281403,40.63924789),"
Southern Local Jr/sr High School
38095 State Route 39
Salineville, OH 43945

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southern Local Jr/sr High School",'Salineville=' + Salineville.length); Salineville[Salineville.length] = createMarker(new GPoint(-80.76963043,40.63599777),"
Southern Local Primary Elementary School
38095e State Route 39
Salineville, OH 43945

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southern Local Primary Elementary School",'Salineville=' + Salineville.length); Hanoverton[Hanoverton.length] = createMarker(new GPoint(-80.92816925,40.78194427),"
United Elementary School
8143 State Route 9
Hanoverton, OH 44423

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("United Elementary School",'Hanoverton=' + Hanoverton.length); Hanoverton[Hanoverton.length] = createMarker(new GPoint(-80.92816925,40.78194427),"
United High School
8143 State Route 9
Hanoverton, OH 44423

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("United High School",'Hanoverton=' + Hanoverton.length); Wellsville[Wellsville.length] = createMarker(new GPoint(-80.65380096,40.60279846),"
Wellsville High School
1 Bengal Blvd
Wellsville, OH 43968

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wellsville High School",'Wellsville=' + Wellsville.length); East_Rochester[East_Rochester.length] = createMarker(new GPoint(-81.01349640,40.76350021),"
West Elementary School
24604 Us Route 30
East Rochester, OH 44625

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Elementary School",'East_Rochester=' + East_Rochester.length); West_Point[West_Point.length] = createMarker(new GPoint(-80.70142365,40.70883560),"
West Point Elementary School
13360 West Point Rd
West Point, OH 44492

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Point Elementary School",'West_Point=' + West_Point.length); East_Liverpool[East_Liverpool.length] = createMarker(new GPoint(-80.58937836,40.62497711),"
Westgate Elementary School
810 W 8th St
East Liverpool, OH 43920

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westgate Elementary School",'East_Liverpool=' + East_Liverpool.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(Alliance); map.removeOverlays(Columbiana); map.removeOverlays(East_Liverpool); map.removeOverlays(East_Palestine); map.removeOverlays(East_Rochester); map.removeOverlays(Hanoverton); map.removeOverlays(Leetonia); map.removeOverlays(Lisbon); map.removeOverlays(Rogers); map.removeOverlays(Salem); map.removeOverlays(Salineville); map.removeOverlays(Wellsville); map.removeOverlays(West_Point); 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(Lisbon);map.removeOverlays(Alliance); map.removeOverlays(Columbiana); map.removeOverlays(East_Liverpool); map.removeOverlays(East_Palestine); map.removeOverlays(East_Rochester); map.removeOverlays(Hanoverton); map.removeOverlays(Leetonia); map.removeOverlays(Lisbon); map.removeOverlays(Rogers); map.removeOverlays(Salem); map.removeOverlays(Salineville); map.removeOverlays(Wellsville); map.removeOverlays(West_Point); map.addOverlays(Alliance); centerByArray(Alliance, false, false); cntMarker += Alliance.length; map.addOverlays(Columbiana); centerByArray(Columbiana, false, false); cntMarker += Columbiana.length; map.addOverlays(East_Liverpool); centerByArray(East_Liverpool, false, false); cntMarker += East_Liverpool.length; map.addOverlays(East_Palestine); centerByArray(East_Palestine, false, false); cntMarker += East_Palestine.length; map.addOverlays(East_Rochester); centerByArray(East_Rochester, false, false); cntMarker += East_Rochester.length; map.addOverlays(Hanoverton); centerByArray(Hanoverton, false, false); cntMarker += Hanoverton.length; map.addOverlays(Leetonia); centerByArray(Leetonia, false, false); cntMarker += Leetonia.length; map.addOverlays(Lisbon); centerByArray(Lisbon, false, false); cntMarker += Lisbon.length; map.addOverlays(Rogers); centerByArray(Rogers, false, false); cntMarker += Rogers.length; map.addOverlays(Salem); centerByArray(Salem, false, false); cntMarker += Salem.length; map.addOverlays(Salineville); centerByArray(Salineville, false, false); cntMarker += Salineville.length; map.addOverlays(Wellsville); centerByArray(Wellsville, false, false); cntMarker += Wellsville.length; map.addOverlays(West_Point); centerByArray(West_Point, false, false); cntMarker += West_Point.length; centerByArray(Lisbon,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'); } }