function addMarkers() { mySelect = document.getElementById('selection'); Dover = [];Camden_wyoming = [];Milford = [];Clayton = [];Camden = [];Hartly = [];Magnolia = [];Felton = [];Frederica = [];Harrington = [];Smyrna = [];Woodside = [];mySelect.options[mySelect.options.length] = new Option("Camden schools",'all=Camden'); mySelect.options[mySelect.options.length] = new Option("Camden wyoming schools",'all=Camden_wyoming'); mySelect.options[mySelect.options.length] = new Option("Clayton schools",'all=Clayton'); mySelect.options[mySelect.options.length] = new Option("Dover schools",'all=Dover'); mySelect.options[mySelect.options.length] = new Option("Felton schools",'all=Felton'); mySelect.options[mySelect.options.length] = new Option("Frederica schools",'all=Frederica'); mySelect.options[mySelect.options.length] = new Option("Harrington schools",'all=Harrington'); mySelect.options[mySelect.options.length] = new Option("Hartly schools",'all=Hartly'); mySelect.options[mySelect.options.length] = new Option("Magnolia schools",'all=Magnolia'); mySelect.options[mySelect.options.length] = new Option("Milford schools",'all=Milford'); mySelect.options[mySelect.options.length] = new Option("Smyrna schools",'all=Smyrna'); mySelect.options[mySelect.options.length] = new Option("Woodside schools",'all=Woodside'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Dover[Dover.length] = createMarker(new GPoint(-75.52375793,39.16345978),"
Academy Of Dover Charter School
104 Saulsbury Road
Dover, DE 19904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Academy Of Dover Charter School",'Dover=' + Dover.length); Camden_wyoming[Camden_wyoming.length] = createMarker(new GPoint(-75.51318359,39.10196686),"
Allen Frear Elementary School
238 Sorghum Mill Road
Camden-wyoming, DE 19934

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Allen Frear Elementary School",'Camden_wyoming=' + Camden_wyoming.length); Milford[Milford.length] = createMarker(new GPoint(-75.43218231,38.91950989),"
Benjamin Banneker Elementary School
449 North Street
Milford, DE 19963

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Benjamin Banneker Elementary School",'Milford=' + Milford.length); Dover[Dover.length] = createMarker(new GPoint(-75.53904724,39.15903091),"
Booker T. Washington Elementary School
901 Forest Street
Dover, DE 19904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Booker T. Washington Elementary School",'Dover=' + Dover.length); Camden_wyoming[Camden_wyoming.length] = createMarker(new GPoint(-75.54304504,39.11846924),"
Caesar Rodney High School
239 Old North Road
Camden-wyoming, DE 19934

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Caesar Rodney High School",'Camden_wyoming=' + Camden_wyoming.length); Dover[Dover.length] = createMarker(new GPoint(-75.52714539,39.16166306),"
Campus Community School
21 North Bradford Street
Dover, DE 19904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Campus Community School",'Dover=' + Dover.length); Dover[Dover.length] = createMarker(new GPoint(-75.52111053,39.16402054),"
Central Middle School
211 Delaware Avenue
Dover, DE 19901

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Central Middle School",'Dover=' + Dover.length); Clayton[Clayton.length] = createMarker(new GPoint(-75.63664246,39.28876114),"
Clayton Elementary School
510 West Main Street
Clayton, DE 19938

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clayton Elementary School",'Clayton=' + Clayton.length); Dover[Dover.length] = createMarker(new GPoint(-75.48917389,39.11874390),"
Dover Air Force Base Middle School
3100 Hawthorne Drive
Dover, DE 19901

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Dover Air Force Base Middle School",'Dover=' + Dover.length); Dover[Dover.length] = createMarker(new GPoint(-75.52443695,39.15808868),"
Dover High School
One Pat Lynn Drive
Dover, DE 19904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dover High School",'Dover=' + Dover.length); Dover[Dover.length] = createMarker(new GPoint(-75.50335693,39.15709686),"
East Dover Elementary School
852 South Little Creek Road
Dover, DE 19901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Dover Elementary School",'Dover=' + Dover.length); Camden[Camden.length] = createMarker(new GPoint(-75.51196289,39.09828949),"
F. Niel Postlethwait Middle School
2841 South State Street
Camden, DE 19934

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("F. Niel Postlethwait Middle School",'Camden=' + Camden.length); Dover[Dover.length] = createMarker(new GPoint(-75.53860474,39.17118073),"
Fairview Elementary School
700 Walker Road
Dover, DE 19904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairview Elementary School",'Dover=' + Dover.length); Camden[Camden.length] = createMarker(new GPoint(-75.54975891,39.11531830),"
Fred Fifer Middle School
109 East Camden-wyoming Avenue
Camden, DE 19934

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fred Fifer Middle School",'Camden=' + Camden.length); Dover[Dover.length] = createMarker(new GPoint(-75.48566437,39.11586380),"
General Henry H. Arnold Elementary School
950 Center Road
Dover, DE 19901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("General Henry H. Arnold Elementary School",'Dover=' + Dover.length); Hartly[Hartly.length] = createMarker(new GPoint(-75.69419861,39.15499878),"
Hartly Elementary School
Po Box 25
Hartly, DE 19953

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hartly Elementary School",'Hartly=' + Hartly.length); Magnolia[Magnolia.length] = createMarker(new GPoint(-75.50309753,39.06800079),"
J. Ralph Mcilvaine Early Childhood Center
Po Box 258
Magnolia, DE 19962

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("J. Ralph Mcilvaine Early Childhood Center",'Magnolia=' + Magnolia.length); Camden_wyoming[Camden_wyoming.length] = createMarker(new GPoint(-75.51258850,39.10237503),"
John S. Charlton School
278 Sorghum Mill Road
Camden-wyoming, DE 19934

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("John S. Charlton School",'Camden_wyoming=' + Camden_wyoming.length); Dover[Dover.length] = createMarker(new GPoint(-75.54344177,39.16090012),"
Kent County Community School
Carver Road
Dover, DE 19904

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kent County Community School",'Dover=' + Dover.length); Dover[Dover.length] = createMarker(new GPoint(-75.52547455,39.14122009),"
Kent County Secondary Intensive Learning Center
1075 South Governors Avenue
Dover, DE 19901

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kent County Secondary Intensive Learning Center",'Dover=' + Dover.length); Camden_wyoming[Camden_wyoming.length] = createMarker(new GPoint(-75.55119400,39.11901000),"
Kent Elementary Intensive Learning Center
5 Old North Road
Camden-wyoming, DE 19934

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kent Elementary Intensive Learning Center",'Camden_wyoming=' + Camden_wyoming.length); Camden[Camden.length] = createMarker(new GPoint(-75.51076508,39.10377884),"
Kent Middle School Intensive Learning Center
278 Sorghum Mill Road
Camden, DE 19934

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kent Middle School Intensive Learning Center",'Camden=' + Camden.length); Felton[Felton.length] = createMarker(new GPoint(-75.55257416,38.98923492),"
Lake Forest Central Elementary School
5424 Killens Pond Road
Felton, DE 19943

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lake Forest Central Elementary School",'Felton=' + Felton.length); Frederica[Frederica.length] = createMarker(new GPoint(-75.47100830,39.00823975),"
Lake Forest East Elementary School
124 West Front Street
Frederica, DE 19946

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lake Forest East Elementary School",'Frederica=' + Frederica.length); Felton[Felton.length] = createMarker(new GPoint(-75.55092621,38.98948288),"
Lake Forest High School
5407 Killens Pond Road
Felton, DE 19943

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lake Forest High School",'Felton=' + Felton.length); Harrington[Harrington.length] = createMarker(new GPoint(-75.57552700,38.92317100),"
Lake Forest Ilc
101 West Center Street
Harrington, DE 19952

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lake Forest Ilc",'Harrington=' + Harrington.length); Felton[Felton.length] = createMarker(new GPoint(-75.57202911,39.00747681),"
Lake Forest North Elementary School
319 East Main Street
Felton, DE 19943

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lake Forest North Elementary School",'Felton=' + Felton.length); Harrington[Harrington.length] = createMarker(new GPoint(-75.58158112,38.92958450),"
Lake Forest South Elementary School
301 Dorman Street
Harrington, DE 19952

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lake Forest South Elementary School",'Harrington=' + Harrington.length); Dover[Dover.length] = createMarker(new GPoint(-75.48275757,39.12082672),"
Major George S. Welch Elementary School
3100 Hawthorne Drive
Dover, DE 19901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Major George S. Welch Elementary School",'Dover=' + Dover.length); Milford[Milford.length] = createMarker(new GPoint(-75.42852783,38.91246033),"
Milford Senior High School
1019 North Walnut Street
Milford, DE 19963

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Milford Senior High School",'Milford=' + Milford.length); Smyrna[Smyrna.length] = createMarker(new GPoint(-75.60422200,39.29839300),"
Moore (john Bassett) School
20 West Frazier Street
Smyrna, DE 19977

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Moore (john Bassett) School",'Smyrna=' + Smyrna.length); Dover[Dover.length] = createMarker(new GPoint(-75.55352783,39.10219574),"
Nellie Hughes Stokes Elementary School
3874 Upper King Road
Dover, DE 19904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Nellie Hughes Stokes Elementary School",'Dover=' + Dover.length); Dover[Dover.length] = createMarker(new GPoint(-75.54457855,39.18328857),"
North Dover Elementary School
855 College Road
Dover, DE 19904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Dover Elementary School",'Dover=' + Dover.length); Smyrna[Smyrna.length] = createMarker(new GPoint(-75.61174011,39.30421448),"
North Smyrna Elementary School
365 North Main Street
Smyrna, DE 19977

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("North Smyrna Elementary School",'Smyrna=' + Smyrna.length); Woodside[Woodside.length] = createMarker(new GPoint(-75.56860352,39.07130051),"
Polytech High School
Po Box 97
Woodside, DE 19980

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Polytech High School",'Woodside=' + Woodside.length); Camden[Camden.length] = createMarker(new GPoint(-75.54084778,39.10550690),"
Positive Outcomes Charter School
193 South Dupont Highway
Camden, DE 19934

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Positive Outcomes Charter School",'Camden=' + Camden.length); Clayton[Clayton.length] = createMarker(new GPoint(-75.63119507,39.29906464),"
Providence Creek Academy Charter School
355 West Duck Creek Road
Clayton, DE 19938

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Providence Creek Academy Charter School",'Clayton=' + Clayton.length); Smyrna[Smyrna.length] = createMarker(new GPoint(-75.60770416,39.29619217),"
Smyrna Elementary School
121 South School Lane
Smyrna, DE 19977

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Smyrna Elementary School",'Smyrna=' + Smyrna.length); Smyrna[Smyrna.length] = createMarker(new GPoint(-75.62268066,39.30521393),"
Smyrna High School
500 Duck Creek Parkway
Smyrna, DE 19977

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Smyrna High School",'Smyrna=' + Smyrna.length); Smyrna[Smyrna.length] = createMarker(new GPoint(-75.59951019,39.30126572),"
Smyrna Kindergarten Center
101 South Locust Street
Smyrna, DE 19977

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Smyrna Kindergarten Center",'Smyrna=' + Smyrna.length); Smyrna[Smyrna.length] = createMarker(new GPoint(-75.60463715,39.29802322),"
Smyrna Middle School
700 Duck Creek Parkway
Smyrna, DE 19977

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Smyrna Middle School",'Smyrna=' + Smyrna.length); Dover[Dover.length] = createMarker(new GPoint(-75.52243042,39.14800644),"
South Dover Elementary School
955 South State Street
Dover, DE 19901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Dover Elementary School",'Dover=' + Dover.length); Dover[Dover.length] = createMarker(new GPoint(-75.53283691,39.09944916),"
Star Hill Elementary School
594 Voshells Millstar Hill Ro
Dover, DE 19901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Star Hill Elementary School",'Dover=' + Dover.length); Dover[Dover.length] = createMarker(new GPoint(-75.52127075,39.17663574),"
Towne Point Elementary School
629 Buckson Drive
Dover, DE 19901

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Towne Point Elementary School",'Dover=' + Dover.length); Camden_wyoming[Camden_wyoming.length] = createMarker(new GPoint(-75.55296326,39.11984253),"
W. B. Simpson Elementary School
5 Old North Road
Camden-wyoming, DE 19934

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("W. B. Simpson Elementary School",'Camden_wyoming=' + Camden_wyoming.length); Dover[Dover.length] = createMarker(new GPoint(-75.53845978,39.13253403),"
W. Reily Brown Elementary School
360 Webbs Lane
Dover, DE 19904

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("W. Reily Brown Elementary School",'Dover=' + Dover.length); Harrington[Harrington.length] = createMarker(new GPoint(-75.58081818,38.92830658),"
W. T. Chipman Middle School
101 West Center Street
Harrington, DE 19952

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("W. T. Chipman Middle School",'Harrington=' + Harrington.length); Dover[Dover.length] = createMarker(new GPoint(-75.54344177,39.16090012),"
William Henry Middle School
Carver Road
Dover, DE 19904

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("William Henry Middle School",'Dover=' + Dover.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(Camden); map.removeOverlays(Camden_wyoming); map.removeOverlays(Clayton); map.removeOverlays(Dover); map.removeOverlays(Felton); map.removeOverlays(Frederica); map.removeOverlays(Harrington); map.removeOverlays(Hartly); map.removeOverlays(Magnolia); map.removeOverlays(Milford); map.removeOverlays(Smyrna); map.removeOverlays(Woodside); 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(Dover);map.removeOverlays(Camden); map.removeOverlays(Camden_wyoming); map.removeOverlays(Clayton); map.removeOverlays(Dover); map.removeOverlays(Felton); map.removeOverlays(Frederica); map.removeOverlays(Harrington); map.removeOverlays(Hartly); map.removeOverlays(Magnolia); map.removeOverlays(Milford); map.removeOverlays(Smyrna); map.removeOverlays(Woodside); map.addOverlays(Camden); centerByArray(Camden, false, false); cntMarker += Camden.length; map.addOverlays(Camden_wyoming); centerByArray(Camden_wyoming, false, false); cntMarker += Camden_wyoming.length; map.addOverlays(Clayton); centerByArray(Clayton, false, false); cntMarker += Clayton.length; map.addOverlays(Dover); centerByArray(Dover, false, false); cntMarker += Dover.length; map.addOverlays(Felton); centerByArray(Felton, false, false); cntMarker += Felton.length; map.addOverlays(Frederica); centerByArray(Frederica, false, false); cntMarker += Frederica.length; map.addOverlays(Harrington); centerByArray(Harrington, false, false); cntMarker += Harrington.length; map.addOverlays(Hartly); centerByArray(Hartly, false, false); cntMarker += Hartly.length; map.addOverlays(Magnolia); centerByArray(Magnolia, false, false); cntMarker += Magnolia.length; map.addOverlays(Milford); centerByArray(Milford, false, false); cntMarker += Milford.length; map.addOverlays(Smyrna); centerByArray(Smyrna, false, false); cntMarker += Smyrna.length; map.addOverlays(Woodside); centerByArray(Woodside, false, false); cntMarker += Woodside.length; centerByArray(Dover,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'); } }