function addMarkers() { mySelect = document.getElementById('selection'); Florence = [];Timmonsville = [];Effingham = [];Pamplico = [];Coward = [];Lake_City = [];Johnsonville = [];Olanta = [];Scranton = [];mySelect.options[mySelect.options.length] = new Option("Coward schools",'all=Coward'); mySelect.options[mySelect.options.length] = new Option("Effingham schools",'all=Effingham'); mySelect.options[mySelect.options.length] = new Option("Florence schools",'all=Florence'); mySelect.options[mySelect.options.length] = new Option("Johnsonville schools",'all=Johnsonville'); mySelect.options[mySelect.options.length] = new Option("Lake City schools",'all=Lake_City'); mySelect.options[mySelect.options.length] = new Option("Olanta schools",'all=Olanta'); mySelect.options[mySelect.options.length] = new Option("Pamplico schools",'all=Pamplico'); mySelect.options[mySelect.options.length] = new Option("Scranton schools",'all=Scranton'); mySelect.options[mySelect.options.length] = new Option("Timmonsville schools",'all=Timmonsville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Florence[Florence.length] = createMarker(new GPoint(-79.78125763,34.17663956),"
Briggs Elementary School
1012 Congaree Dr
Florence, SC 29501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Briggs Elementary School",'Florence=' + Florence.length); Timmonsville[Timmonsville.length] = createMarker(new GPoint(-79.94335175,34.13870239),"
Brockington Elementary School
401 North Brockington St
Timmonsville, SC 29161

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brockington Elementary School",'Timmonsville=' + Timmonsville.length); Florence[Florence.length] = createMarker(new GPoint(-79.80078888,34.20092010),"
Carver Elementary School
515 N. Cashua Drive
Florence, SC 29501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carver Elementary School",'Florence=' + Florence.length); Florence[Florence.length] = createMarker(new GPoint(-10.00000000,10.00000000),"
Choices School
1405 Poinset Drive
Florence, SC 29505

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Choices School",'Florence=' + Florence.length); Florence[Florence.length] = createMarker(new GPoint(-79.81869507,34.17102051),"
Delmae Heights Elementary School
1211 South Cashua Dr
Florence, SC 29501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Delmae Heights Elementary School",'Florence=' + Florence.length); Effingham[Effingham.length] = createMarker(new GPoint(-79.77214050,34.09203339),"
Dewey Carter Elementary School
4837 So. Irby Street
Effingham, SC 29541

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dewey Carter Elementary School",'Effingham=' + Effingham.length); Florence[Florence.length] = createMarker(new GPoint(-79.77250700,34.13390600),"
Florence Career Center
126 E Howe Springs
Florence, SC 29501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Florence Career Center",'Florence=' + Florence.length); Florence[Florence.length] = createMarker(new GPoint(-79.73126984,34.14347076),"
Greenwood Elementary School
2300 E Howe Springs Rd
Florence, SC 29501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greenwood Elementary School",'Florence=' + Florence.length); Pamplico[Pamplico.length] = createMarker(new GPoint(-79.54974365,33.94549179),"
Hannah-pamplico El/middle Elementary School
2131 S Pamplico Highway
Pamplico, SC 29583

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hannah-pamplico El/middle Elementary School",'Pamplico=' + Pamplico.length); Pamplico[Pamplico.length] = createMarker(new GPoint(-79.55077362,33.94699478),"
Hannah-pamplico High School
2055 S. Pamplico Highway
Pamplico, SC 29583

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hannah-pamplico High School",'Pamplico=' + Pamplico.length); Florence[Florence.length] = createMarker(new GPoint(-79.85309601,34.16713715),"
Henry L. Sneed Middle School
1102 Ebenezer Road
Florence, SC 29501

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Henry L. Sneed Middle School",'Florence=' + Florence.length); Florence[Florence.length] = createMarker(new GPoint(-79.70748901,34.22963715),"
Henry Timrod Elementary School
1901 E. Old Marion Hwy
Florence, SC 29506

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Henry Timrod Elementary School",'Florence=' + Florence.length); Coward[Coward.length] = createMarker(new GPoint(-79.74849701,33.99520111),"
J C Lynch Elementary School
P O Box 140
Coward, SC 29530

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("J C Lynch Elementary School",'Coward=' + Coward.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-79.75209808,33.86679840),"
J. Paul Truluck Middle School
Post Office Box 1239
Lake City, SC 29560

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("J. Paul Truluck Middle School",'Lake_City=' + Lake_City.length); Timmonsville[Timmonsville.length] = createMarker(new GPoint(-79.94543457,34.14151001),"
Johnson Middle School
620 North Brockington St
Timmonsville, SC 29161

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Johnson Middle School",'Timmonsville=' + Timmonsville.length); Johnsonville[Johnsonville.length] = createMarker(new GPoint(-79.44667053,33.81707764),"
Johnsonville Elementary School
160 E. Marion St.
Johnsonville, SC 29555

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Johnsonville Elementary School",'Johnsonville=' + Johnsonville.length); Johnsonville[Johnsonville.length] = createMarker(new GPoint(-79.44219971,33.81462097),"
Johnsonville High School
237 So Georgetown Hwy
Johnsonville, SC 29555

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Johnsonville High School",'Johnsonville=' + Johnsonville.length); Johnsonville[Johnsonville.length] = createMarker(new GPoint(-79.44925690,33.81758881),"
Johnsonville Middle School
415 Maple Ave.x 67
Johnsonville, SC 29555

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Johnsonville Middle School",'Johnsonville=' + Johnsonville.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-79.75209808,33.86679840),"
Lake City Elementary School
P. O. Box 1717
Lake City, SC 29560

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lake City Elementary School",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-79.75209808,33.86679840),"
Lake City High School
P O Box 1659
Lake City, SC 29560

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lake City High School",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-79.75209808,33.86679840),"
Main Street Elementary School
P O Box 1509
Lake City, SC 29560

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Main Street Elementary School",'Lake_City=' + Lake_City.length); Florence[Florence.length] = createMarker(new GPoint(-79.74492645,34.17777252),"
Mclaurin Elementary School
1400 Mcmillan Lane
Florence, SC 29501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mclaurin Elementary School",'Florence=' + Florence.length); Florence[Florence.length] = createMarker(new GPoint(-79.79097748,34.17885971),"
Moore Intermediate School
1101 Cheraw Drive
Florence, SC 29501

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Moore Intermediate School",'Florence=' + Florence.length); Florence[Florence.length] = createMarker(new GPoint(-79.76667786,34.21147537),"
North Vista Elementary School
1100 N Irby Street
Florence, SC 29501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Vista Elementary School",'Florence=' + Florence.length); Olanta[Olanta.length] = createMarker(new GPoint(-79.93260193,33.94419861),"
Olanta Elementary School
P O 628
Olanta, SC 29114

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Olanta Elementary School",'Olanta=' + Olanta.length); Florence[Florence.length] = createMarker(new GPoint(-79.77478000,34.22005300),"
Palmetto Youth Academy
1209 North Douglas Street
Florence, SC 29501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Palmetto Youth Academy",'Florence=' + Florence.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-79.75209808,33.86679840),"
Ronald E. Mcnair Middle School
Post Office Box 1209
Lake City, SC 29560

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ronald E. Mcnair Middle School",'Lake_City=' + Lake_City.length); Florence[Florence.length] = createMarker(new GPoint(-79.79161600,34.18719800),"
Royall Elementary School
1400 Woods Road
Florence, SC 29501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Royall Elementary School",'Florence=' + Florence.length); Effingham[Effingham.length] = createMarker(new GPoint(-79.82875824,34.14925766),"
Savannah Grove Elementary School
2348 Savannah Grove Rd.
Effingham, SC 29541

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Savannah Grove Elementary School",'Effingham=' + Effingham.length); Scranton[Scranton.length] = createMarker(new GPoint(-79.75820160,33.92559814),"
Scranton Elementary School
Post Office Box 129
Scranton, SC 29591

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Scranton Elementary School",'Scranton=' + Scranton.length); Florence[Florence.length] = createMarker(new GPoint(-79.77603149,34.12841415),"
South Florence High School
3200 S. Irby Street
Florence, SC 29501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Florence High School",'Florence=' + Florence.length); Florence[Florence.length] = createMarker(new GPoint(-79.76950073,34.13359833),"
Southside Middle School
200 E Howe Springs
Florence, SC 29501

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Southside Middle School",'Florence=' + Florence.length); Florence[Florence.length] = createMarker(new GPoint(-79.69663239,34.19703674),"
Theodore Lester Elementary School
3501 E Palmetto St
Florence, SC 29501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Theodore Lester Elementary School",'Florence=' + Florence.length); Timmonsville[Timmonsville.length] = createMarker(new GPoint(-79.93973541,34.13393784),"
Timmonsville High School
605 North Market Street
Timmonsville, SC 29161

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Timmonsville High School",'Timmonsville=' + Timmonsville.length); Florence[Florence.length] = createMarker(new GPoint(-79.65636444,34.19438171),"
Wallace Gregg Elementary School
515 Francis Marion Rd.
Florence, SC 29506

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wallace Gregg Elementary School",'Florence=' + Florence.length); Florence[Florence.length] = createMarker(new GPoint(-79.82324219,34.19406891),"
West Florence High School
221 N Beltline Dr
Florence, SC 29501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Florence High School",'Florence=' + Florence.length); Florence[Florence.length] = createMarker(new GPoint(-79.76702881,34.21173477),"
Williams Middle School
1119 North Irby St
Florence, SC 29501

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Williams Middle School",'Florence=' + Florence.length); Florence[Florence.length] = createMarker(new GPoint(-79.72435760,34.22551346),"
Wilson Senior High School
1411 Old Marion Hwy
Florence, SC 29506

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wilson Senior High School",'Florence=' + Florence.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(Coward); map.removeOverlays(Effingham); map.removeOverlays(Florence); map.removeOverlays(Johnsonville); map.removeOverlays(Lake_City); map.removeOverlays(Olanta); map.removeOverlays(Pamplico); map.removeOverlays(Scranton); map.removeOverlays(Timmonsville); 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(Florence);map.removeOverlays(Coward); map.removeOverlays(Effingham); map.removeOverlays(Florence); map.removeOverlays(Johnsonville); map.removeOverlays(Lake_City); map.removeOverlays(Olanta); map.removeOverlays(Pamplico); map.removeOverlays(Scranton); map.removeOverlays(Timmonsville); map.addOverlays(Coward); centerByArray(Coward, false, false); cntMarker += Coward.length; map.addOverlays(Effingham); centerByArray(Effingham, false, false); cntMarker += Effingham.length; map.addOverlays(Florence); centerByArray(Florence, false, false); cntMarker += Florence.length; map.addOverlays(Johnsonville); centerByArray(Johnsonville, false, false); cntMarker += Johnsonville.length; map.addOverlays(Lake_City); centerByArray(Lake_City, false, false); cntMarker += Lake_City.length; map.addOverlays(Olanta); centerByArray(Olanta, false, false); cntMarker += Olanta.length; map.addOverlays(Pamplico); centerByArray(Pamplico, false, false); cntMarker += Pamplico.length; map.addOverlays(Scranton); centerByArray(Scranton, false, false); cntMarker += Scranton.length; map.addOverlays(Timmonsville); centerByArray(Timmonsville, false, false); cntMarker += Timmonsville.length; centerByArray(Florence,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'); } }