function addMarkers() { mySelect = document.getElementById('selection'); Lewes = [];Blades = [];Delmar = [];Millsboro = [];Lincoln = [];Frankford = [];Seaford = [];Laurel = [];Georgetown = [];Milton = [];Dagsboro = [];Milford = [];Selbyville = [];Rehoboth_Beach = [];Bridgeville = [];Greenwood = [];mySelect.options[mySelect.options.length] = new Option("Blades schools",'all=Blades'); mySelect.options[mySelect.options.length] = new Option("Bridgeville schools",'all=Bridgeville'); mySelect.options[mySelect.options.length] = new Option("Dagsboro schools",'all=Dagsboro'); mySelect.options[mySelect.options.length] = new Option("Delmar schools",'all=Delmar'); mySelect.options[mySelect.options.length] = new Option("Frankford schools",'all=Frankford'); mySelect.options[mySelect.options.length] = new Option("Georgetown schools",'all=Georgetown'); mySelect.options[mySelect.options.length] = new Option("Greenwood schools",'all=Greenwood'); mySelect.options[mySelect.options.length] = new Option("Laurel schools",'all=Laurel'); mySelect.options[mySelect.options.length] = new Option("Lewes schools",'all=Lewes'); mySelect.options[mySelect.options.length] = new Option("Lincoln schools",'all=Lincoln'); mySelect.options[mySelect.options.length] = new Option("Milford schools",'all=Milford'); mySelect.options[mySelect.options.length] = new Option("Millsboro schools",'all=Millsboro'); mySelect.options[mySelect.options.length] = new Option("Milton schools",'all=Milton'); mySelect.options[mySelect.options.length] = new Option("Rehoboth Beach schools",'all=Rehoboth_Beach'); mySelect.options[mySelect.options.length] = new Option("Seaford schools",'all=Seaford'); mySelect.options[mySelect.options.length] = new Option("Selbyville schools",'all=Selbyville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Lewes[Lewes.length] = createMarker(new GPoint(-75.14539337,38.76839066),"
Beacon Middle School
19483 John J. Williams Highway
Lewes, DE 19958

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Beacon Middle School",'Lewes=' + Lewes.length); Blades[Blades.length] = createMarker(new GPoint(-75.60713196,38.63139725),"
Blades Elementary School
900 South Arch Street
Blades, DE 19973

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Blades Elementary School",'Blades=' + Blades.length); Lewes[Lewes.length] = createMarker(new GPoint(-75.15068817,38.75041580),"
Cape Henlopen High School
1250 Kings Highway
Lewes, DE 19958

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cape Henlopen High School",'Lewes=' + Lewes.length); Delmar[Delmar.length] = createMarker(new GPoint(-75.56826782,38.45754623),"
Delmar Middle School
200 North Eighth Street
Delmar, DE 19940

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Delmar Middle School",'Delmar=' + Delmar.length); Delmar[Delmar.length] = createMarker(new GPoint(-75.56826782,38.45754623),"
Delmar Senior High School
200 North Eighth Street
Delmar, DE 19940

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Delmar Senior High School",'Delmar=' + Delmar.length); Millsboro[Millsboro.length] = createMarker(new GPoint(-75.28824615,38.59088135),"
East Millsboro Elementary School
29346 Iron Branch Road
Millsboro, DE 19966

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Millsboro Elementary School",'Millsboro=' + Millsboro.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-75.41882324,38.86959076),"
Evelyn I. Morris Early Childhood Center
8609 Third Street
Lincoln, DE 19960

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Evelyn I. Morris Early Childhood Center",'Lincoln=' + Lincoln.length); Frankford[Frankford.length] = createMarker(new GPoint(-75.09429932,38.52799988),"
Frankford Elementary School
30207 Frankford School Road
Frankford, DE 19945

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Frankford Elementary School",'Frankford=' + Frankford.length); Seaford[Seaford.length] = createMarker(new GPoint(-75.59226227,38.67570114),"
Frederick Douglass Elementary School
1 Swain Road
Seaford, DE 19973

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Frederick Douglass Elementary School",'Seaford=' + Seaford.length); Laurel[Laurel.length] = createMarker(new GPoint(-75.55490112,38.54980087),"
Georgetown Charter School
12108 County Seat Highway
Laurel, DE 19956

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Georgetown Charter School",'Laurel=' + Laurel.length); Georgetown[Georgetown.length] = createMarker(new GPoint(-75.38934326,38.68725586),"
Georgetown Elementary School
301-a West Market Street
Georgetown, DE 19947

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Georgetown Elementary School",'Georgetown=' + Georgetown.length); Milton[Milton.length] = createMarker(new GPoint(-75.31510162,38.78106689),"
H. O. Brittingham Elementary School
400 Mulberry Street
Milton, DE 19968

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("H. O. Brittingham Elementary School",'Milton=' + Milton.length); Georgetown[Georgetown.length] = createMarker(new GPoint(-75.38577271,38.68975830),"
Howard T. Ennis School
20346 Ennis Road
Georgetown, DE 19947

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Howard T. Ennis School",'Georgetown=' + Georgetown.length); Dagsboro[Dagsboro.length] = createMarker(new GPoint(-75.09429932,38.52799988),"
Indian River High School
29772 Armory Road
Dagsboro, DE 19939

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Indian River High School",'Dagsboro=' + Dagsboro.length); Laurel[Laurel.length] = createMarker(new GPoint(-75.56998444,38.55180740),"
Laurel Intermediate School
801 South Central Avenue
Laurel, DE 19956

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Laurel Intermediate School",'Laurel=' + Laurel.length); Laurel[Laurel.length] = createMarker(new GPoint(-75.56998444,38.55180740),"
Laurel Middle School
801 South Central Avenue
Laurel, DE 19956

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Laurel Middle School",'Laurel=' + Laurel.length); Laurel[Laurel.length] = createMarker(new GPoint(-75.56954956,38.54999924),"
Laurel Senior High School
1133 South Central Avenue
Laurel, DE 19956

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Laurel Senior High School",'Laurel=' + Laurel.length); Millsboro[Millsboro.length] = createMarker(new GPoint(-75.29090118,38.59114838),"
Long Neck Elementary School
Rd 10 Box 452
Millsboro, DE 19966

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Long Neck Elementary School",'Millsboro=' + Millsboro.length); Frankford[Frankford.length] = createMarker(new GPoint(-75.09719849,38.55820084),"
Lord Baltimore Elementary School
Co John M. Clayton School
Frankford, DE 19945

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lord Baltimore Elementary School",'Frankford=' + Frankford.length); Milford[Milford.length] = createMarker(new GPoint(-75.41657257,38.90639114),"
Lulu M. Ross Elementary School
310 Lovers Lane
Milford, DE 19963

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lulu M. Ross Elementary School",'Milford=' + Milford.length); Milton[Milton.length] = createMarker(new GPoint(-75.31332397,38.77281189),"
Mariner Middle School
16391 Harbeson Rd.
Milton, DE 19968

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mariner Middle School",'Milton=' + Milton.length); Milford[Milford.length] = createMarker(new GPoint(-75.42855835,38.91255951),"
Milford Ilc
906 Lakeview Avenue
Milford, DE 19963

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Milford Ilc",'Milford=' + Milford.length); Milford[Milford.length] = createMarker(new GPoint(-75.43806458,38.90374756),"
Milford Middle School
612 Lakeview Avenue
Milford, DE 19963

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Milford Middle School",'Milford=' + Milford.length); Milton[Milton.length] = createMarker(new GPoint(-75.30016327,38.81694031),"
Milton Elementary School
512 Federal Street
Milton, DE 19968

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Milton Elementary School",'Milton=' + Milton.length); Georgetown[Georgetown.length] = createMarker(new GPoint(-75.39192963,38.69546127),"
North Georgetown Elementary School
664 North Bedford
Georgetown, DE 19947

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Georgetown Elementary School",'Georgetown=' + Georgetown.length); Laurel[Laurel.length] = createMarker(new GPoint(-75.56929016,38.56493759),"
North Laurel Elementary School
300 Wilson Street
Laurel, DE 19956

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Laurel Elementary School",'Laurel=' + Laurel.length); Laurel[Laurel.length] = createMarker(new GPoint(-75.57782745,38.55553055),"
Paul Laurence Dunbar Elementary School
499 West Sixth Street
Laurel, DE 19956

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Paul Laurence Dunbar Elementary School",'Laurel=' + Laurel.length); Selbyville[Selbyville.length] = createMarker(new GPoint(-75.22116852,38.46039963),"
Phillip C. Showell Elementary School
41 Bethany Road
Selbyville, DE 19975

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Phillip C. Showell Elementary School",'Selbyville=' + Selbyville.length); Rehoboth_Beach[Rehoboth_Beach.length] = createMarker(new GPoint(-75.08773804,38.70998383),"
Rehoboth Elementary School
500 Stockley Street
Rehoboth Beach, DE 19971

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rehoboth Elementary School",'Rehoboth_Beach=' + Rehoboth_Beach.length); Lewes[Lewes.length] = createMarker(new GPoint(-75.14688873,38.76774216),"
Richard A. Shields Elementary School
910 Shields Avenue
Lewes, DE 19958

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Richard A. Shields Elementary School",'Lewes=' + Lewes.length); Georgetown[Georgetown.length] = createMarker(new GPoint(-75.37641907,38.69028473),"
Richard Allen School
316 South Railroad Avenue
Georgetown, DE 19947

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Richard Allen School",'Georgetown=' + Georgetown.length); Seaford[Seaford.length] = createMarker(new GPoint(-75.61531067,38.63974380),"
Seaford Central Elementary School
1 Delaware Place
Seaford, DE 19973

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Seaford Central Elementary School",'Seaford=' + Seaford.length); Seaford[Seaford.length] = createMarker(new GPoint(-75.61000061,38.64806747),"
Seaford Middle School
500 East Stein Highway
Seaford, DE 19973

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Seaford Middle School",'Seaford=' + Seaford.length); Seaford[Seaford.length] = createMarker(new GPoint(-75.61495209,38.65274048),"
Seaford Senior High School
399 North Market Street
Seaford, DE 19973

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Seaford Senior High School",'Seaford=' + Seaford.length); Selbyville[Selbyville.length] = createMarker(new GPoint(-75.16580200,38.46559906),"
Selbyville Middle School
80 Betheny Rd.
Selbyville, DE 19975

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Selbyville Middle School",'Selbyville=' + Selbyville.length); Selbyville[Selbyville.length] = createMarker(new GPoint(-75.24240112,38.46530151),"
Southern Delaware School Of Arts
31 Hoosier Street
Selbyville, DE 19975

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southern Delaware School Of Arts",'Selbyville=' + Selbyville.length); Georgetown[Georgetown.length] = createMarker(new GPoint(-75.36441803,38.66811752),"
Sussex Academy Of Arts And Sciences
21777 Sussex Pines Road
Georgetown, DE 19947

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sussex Academy Of Arts And Sciences",'Georgetown=' + Georgetown.length); Millsboro[Millsboro.length] = createMarker(new GPoint(-75.21720123,38.60580063),"
Sussex Central Middle School
Po Box 668
Millsboro, DE 19966

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sussex Central Middle School",'Millsboro=' + Millsboro.length); Georgetown[Georgetown.length] = createMarker(new GPoint(-75.38934326,38.68725586),"
Sussex Central Senior High School
26026 Patriots Way
Georgetown, DE 19947

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sussex Central Senior High School",'Georgetown=' + Georgetown.length); Lewes[Lewes.length] = createMarker(new GPoint(-75.14694977,38.77342987),"
Sussex Consortium
520 Dupont Avenue
Lewes, DE 19958

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sussex Consortium",'Lewes=' + Lewes.length); Seaford[Seaford.length] = createMarker(new GPoint(-75.61000061,38.64806747),"
Sussex Orthopedic Facility & Sussex Visually Handi
500 E. Stein Highway
Seaford, DE 19973

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sussex Orthopedic Facility & Sussex Visually Handi",'Seaford=' + Seaford.length); Georgetown[Georgetown.length] = createMarker(new GPoint(-75.47232056,38.62702179),"
Sussex Technical High School
17099 County Seat Highway
Georgetown, DE 19947

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sussex Technical High School",'Georgetown=' + Georgetown.length); Seaford[Seaford.length] = createMarker(new GPoint(-75.63233948,38.64268112),"
West Seaford Elementary School
511 Sussex Avenue
Seaford, DE 19973

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Seaford Elementary School",'Seaford=' + Seaford.length); Laurel[Laurel.length] = createMarker(new GPoint(-75.56994629,38.55164719),"
Western Sussex Academy
815 Central Avenue
Laurel, DE 19956

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Western Sussex Academy",'Laurel=' + Laurel.length); Bridgeville[Bridgeville.length] = createMarker(new GPoint(-75.60345459,38.75067139),"
Woodbridge Early Childhood Education Center
48 Church Street
Bridgeville, DE 19933

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodbridge Early Childhood Education Center",'Bridgeville=' + Bridgeville.length); Greenwood[Greenwood.length] = createMarker(new GPoint(-75.59010315,38.81930161),"
Woodbridge Elementary School
Po Box 2007
Greenwood, DE 19950

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodbridge Elementary School",'Greenwood=' + Greenwood.length); Bridgeville[Bridgeville.length] = createMarker(new GPoint(-75.59789276,38.73983765),"
Woodbridge Middle School
307 Laws Street
Bridgeville, DE 19933

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Woodbridge Middle School",'Bridgeville=' + Bridgeville.length); Bridgeville[Bridgeville.length] = createMarker(new GPoint(-75.60131836,38.73959732),"
Woodbridge Senior High School
307 Laws Street
Bridgeville, DE 19933

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodbridge Senior High School",'Bridgeville=' + Bridgeville.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(Blades); map.removeOverlays(Bridgeville); map.removeOverlays(Dagsboro); map.removeOverlays(Delmar); map.removeOverlays(Frankford); map.removeOverlays(Georgetown); map.removeOverlays(Greenwood); map.removeOverlays(Laurel); map.removeOverlays(Lewes); map.removeOverlays(Lincoln); map.removeOverlays(Milford); map.removeOverlays(Millsboro); map.removeOverlays(Milton); map.removeOverlays(Rehoboth_Beach); map.removeOverlays(Seaford); map.removeOverlays(Selbyville); 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(Lewes);map.removeOverlays(Blades); map.removeOverlays(Bridgeville); map.removeOverlays(Dagsboro); map.removeOverlays(Delmar); map.removeOverlays(Frankford); map.removeOverlays(Georgetown); map.removeOverlays(Greenwood); map.removeOverlays(Laurel); map.removeOverlays(Lewes); map.removeOverlays(Lincoln); map.removeOverlays(Milford); map.removeOverlays(Millsboro); map.removeOverlays(Milton); map.removeOverlays(Rehoboth_Beach); map.removeOverlays(Seaford); map.removeOverlays(Selbyville); map.addOverlays(Blades); centerByArray(Blades, false, false); cntMarker += Blades.length; map.addOverlays(Bridgeville); centerByArray(Bridgeville, false, false); cntMarker += Bridgeville.length; map.addOverlays(Dagsboro); centerByArray(Dagsboro, false, false); cntMarker += Dagsboro.length; map.addOverlays(Delmar); centerByArray(Delmar, false, false); cntMarker += Delmar.length; map.addOverlays(Frankford); centerByArray(Frankford, false, false); cntMarker += Frankford.length; map.addOverlays(Georgetown); centerByArray(Georgetown, false, false); cntMarker += Georgetown.length; map.addOverlays(Greenwood); centerByArray(Greenwood, false, false); cntMarker += Greenwood.length; map.addOverlays(Laurel); centerByArray(Laurel, false, false); cntMarker += Laurel.length; map.addOverlays(Lewes); centerByArray(Lewes, false, false); cntMarker += Lewes.length; map.addOverlays(Lincoln); centerByArray(Lincoln, false, false); cntMarker += Lincoln.length; map.addOverlays(Milford); centerByArray(Milford, false, false); cntMarker += Milford.length; map.addOverlays(Millsboro); centerByArray(Millsboro, false, false); cntMarker += Millsboro.length; map.addOverlays(Milton); centerByArray(Milton, false, false); cntMarker += Milton.length; map.addOverlays(Rehoboth_Beach); centerByArray(Rehoboth_Beach, false, false); cntMarker += Rehoboth_Beach.length; map.addOverlays(Seaford); centerByArray(Seaford, false, false); cntMarker += Seaford.length; map.addOverlays(Selbyville); centerByArray(Selbyville, false, false); cntMarker += Selbyville.length; centerByArray(Lewes,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'); } }