function addMarkers() { mySelect = document.getElementById('selection'); South_Point = [];Chesapeake = [];Ironton = [];Coal_Grove = [];Proctorville = [];Willow_Wood = [];mySelect.options[mySelect.options.length] = new Option("Chesapeake schools",'all=Chesapeake'); mySelect.options[mySelect.options.length] = new Option("Coal Grove schools",'all=Coal_Grove'); mySelect.options[mySelect.options.length] = new Option("Ironton schools",'all=Ironton'); mySelect.options[mySelect.options.length] = new Option("Proctorville schools",'all=Proctorville'); mySelect.options[mySelect.options.length] = new Option("South Point schools",'all=South_Point'); mySelect.options[mySelect.options.length] = new Option("Willow Wood schools",'all=Willow_Wood'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); South_Point[South_Point.length] = createMarker(new GPoint(-82.55650330,38.43299866),"
Burlington Elementary School
Po Box 310
South Point, OH 45680

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Burlington Elementary School",'South_Point=' + South_Point.length); Chesapeake[Chesapeake.length] = createMarker(new GPoint(-82.48378754,38.42256165),"
Chesapeake Elementary School
11359 County Road 1
Chesapeake, OH 45619

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chesapeake Elementary School",'Chesapeake=' + Chesapeake.length); Chesapeake[Chesapeake.length] = createMarker(new GPoint(-82.48613739,38.42224503),"
Chesapeake High School
10181 County Road 1
Chesapeake, OH 45619

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chesapeake High School",'Chesapeake=' + Chesapeake.length); Chesapeake[Chesapeake.length] = createMarker(new GPoint(-82.48194885,38.42275620),"
Chesapeake Middle School
10335 County Road 1
Chesapeake, OH 45619

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Chesapeake Middle School",'Chesapeake=' + Chesapeake.length); Ironton[Ironton.length] = createMarker(new GPoint(-82.58322906,38.50339127),"
Dawson-bryant Elementary School
4503 State Route 243
Ironton, OH 45638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dawson-bryant Elementary School",'Ironton=' + Ironton.length); Coal_Grove[Coal_Grove.length] = createMarker(new GPoint(-82.64427185,38.50153732),"
Dawson-bryant High School
1 Hornet Ln
Coal Grove, OH 45638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dawson-bryant High School",'Coal_Grove=' + Coal_Grove.length); Coal_Grove[Coal_Grove.length] = createMarker(new GPoint(-82.64427185,38.50153732),"
Dawson-bryant Middle School
1 Hornet Ln
Coal Grove, OH 45638

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Dawson-bryant Middle School",'Coal_Grove=' + Coal_Grove.length); Proctorville[Proctorville.length] = createMarker(new GPoint(-82.32320404,38.45662308),"
Fairland East Elementary School
10732 State Route 7
Proctorville, OH 45669

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairland East Elementary School",'Proctorville=' + Proctorville.length); Proctorville[Proctorville.length] = createMarker(new GPoint(-82.36216736,38.44927216),"
Fairland High School
21360 State Route 243
Proctorville, OH 45669

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fairland High School",'Proctorville=' + Proctorville.length); Proctorville[Proctorville.length] = createMarker(new GPoint(-82.35527039,38.44290924),"
Fairland Middle School
7875 State Route 7
Proctorville, OH 45669

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fairland Middle School",'Proctorville=' + Proctorville.length); Proctorville[Proctorville.length] = createMarker(new GPoint(-82.35852051,38.44552612),"
Fairland West Elementary School
110 Township Road 1125
Proctorville, OH 45669

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairland West Elementary School",'Proctorville=' + Proctorville.length); Ironton[Ironton.length] = createMarker(new GPoint(-82.67065430,38.52401733),"
Ironton High School
1701 S 7th St
Ironton, OH 45638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ironton High School",'Ironton=' + Ironton.length); Ironton[Ironton.length] = createMarker(new GPoint(-82.67065430,38.52401733),"
Ironton Junior High School
1701 S 7th St
Ironton, OH 45638

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ironton Junior High School",'Ironton=' + Ironton.length); Ironton[Ironton.length] = createMarker(new GPoint(-82.70637512,38.55117035),"
Ironton Middle School
302 Delaware St
Ironton, OH 45638

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ironton Middle School",'Ironton=' + Ironton.length); Ironton[Ironton.length] = createMarker(new GPoint(-82.68131256,38.53536224),"
Kingsbury Elementary School
315 S 6th St
Ironton, OH 45638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kingsbury Elementary School",'Ironton=' + Ironton.length); Chesapeake[Chesapeake.length] = createMarker(new GPoint(-82.47749329,38.49439621),"
Lawrence County High School
11627 State Route 243
Chesapeake, OH 45619

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lawrence County High School",'Chesapeake=' + Chesapeake.length); Ironton[Ironton.length] = createMarker(new GPoint(-82.67236300,38.47115200),"
Rock Hill Child Devlopment Center
2325 County Road 26
Ironton, OH 45638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rock Hill Child Devlopment Center",'Ironton=' + Ironton.length); Ironton[Ironton.length] = createMarker(new GPoint(-82.65763855,38.61212158),"
Rock Hill Elementary School
2676 County Road 26
Ironton, OH 45638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rock Hill Elementary School",'Ironton=' + Ironton.length); Ironton[Ironton.length] = createMarker(new GPoint(-82.66340637,38.61401749),"
Rock Hill High School
2171 Co Rd 26
Ironton, OH 45638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rock Hill High School",'Ironton=' + Ironton.length); Ironton[Ironton.length] = createMarker(new GPoint(-82.66340637,38.61401749),"
Rock Hill Middle School
2171 County Road 26
Ironton, OH 45638

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rock Hill Middle School",'Ironton=' + Ironton.length); Ironton[Ironton.length] = createMarker(new GPoint(-82.65789032,38.61236954),"
Rock Hill Senior High School
2415 County Road 26
Ironton, OH 45638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rock Hill Senior High School",'Ironton=' + Ironton.length); South_Point[South_Point.length] = createMarker(new GPoint(-82.53562927,38.41049957),"
South Point Elementary School
501 Washington St
South Point, OH 45680

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Point Elementary School",'South_Point=' + South_Point.length); South_Point[South_Point.length] = createMarker(new GPoint(-82.58248138,38.42393875),"
South Point High School
302 High St
South Point, OH 45680

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Point High School",'South_Point=' + South_Point.length); South_Point[South_Point.length] = createMarker(new GPoint(-82.58221436,38.42243576),"
South Point Middle School
201 Park Ave
South Point, OH 45680

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("South Point Middle School",'South_Point=' + South_Point.length); Willow_Wood[Willow_Wood.length] = createMarker(new GPoint(-82.48418427,38.60849380),"
Symmes Valley Elementary School
14860 State Route 141
Willow Wood, OH 45696

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Symmes Valley Elementary School",'Willow_Wood=' + Willow_Wood.length); Willow_Wood[Willow_Wood.length] = createMarker(new GPoint(-82.48535919,38.60760117),"
Symmes Valley High School
14778 State Route 141
Willow Wood, OH 45696

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Symmes Valley High School",'Willow_Wood=' + Willow_Wood.length); Ironton[Ironton.length] = createMarker(new GPoint(-82.69510651,38.54446411),"
West Ironton Elementary School
1203 N 3rd St
Ironton, OH 45638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Ironton Elementary School",'Ironton=' + Ironton.length); Ironton[Ironton.length] = createMarker(new GPoint(-82.66929626,38.51886749),"
Whitwell Elementary School
2220 S 5th St
Ironton, OH 45638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Whitwell Elementary School",'Ironton=' + Ironton.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(Chesapeake); map.removeOverlays(Coal_Grove); map.removeOverlays(Ironton); map.removeOverlays(Proctorville); map.removeOverlays(South_Point); map.removeOverlays(Willow_Wood); 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(South_Point);map.removeOverlays(Chesapeake); map.removeOverlays(Coal_Grove); map.removeOverlays(Ironton); map.removeOverlays(Proctorville); map.removeOverlays(South_Point); map.removeOverlays(Willow_Wood); map.addOverlays(Chesapeake); centerByArray(Chesapeake, false, false); cntMarker += Chesapeake.length; map.addOverlays(Coal_Grove); centerByArray(Coal_Grove, false, false); cntMarker += Coal_Grove.length; map.addOverlays(Ironton); centerByArray(Ironton, false, false); cntMarker += Ironton.length; map.addOverlays(Proctorville); centerByArray(Proctorville, false, false); cntMarker += Proctorville.length; map.addOverlays(South_Point); centerByArray(South_Point, false, false); cntMarker += South_Point.length; map.addOverlays(Willow_Wood); centerByArray(Willow_Wood, false, false); cntMarker += Willow_Wood.length; centerByArray(South_Point,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'); } }