function addMarkers() { mySelect = document.getElementById('selection'); Hampton = [];mySelect.options[mySelect.options.length] = new Option("Hampton schools",'all=Hampton'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Hampton[Hampton.length] = createMarker(new GPoint(-76.37458801,37.01751328),"
A.w.e. Bassette Elementary School
671 Bell St
Hampton, VA 23661

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("A.w.e. Bassette Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.40599823,37.03362274),"
Aberdeen Elementary School
1424 Aberdeen Rd
Hampton, VA 23666

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Aberdeen Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.42484283,37.04177094),"
Alfred S. Forrest Elementary School
1406 Todds Ln
Hampton, VA 23666

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Alfred S. Forrest Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.36512756,37.00954819),"
Armstrong Elementary School
3401 Matoaka Rd
Hampton, VA 23661

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Armstrong Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.34243011,37.04630661),"
Barron Elementary School
45 Fox Hill Rd
Hampton, VA 23669

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Barron Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.33045959,37.05462265),"
Benjamin Syms Middle School
170 Fox Hill Rd
Hampton, VA 23669

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Benjamin Syms Middle School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.42880249,37.05314636),"
Bethel High School
1067 Big Bethel Rd
Hampton, VA 23666

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethel High School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.33779907,37.05780029),"
Booker Elementary School
160 Apollo Dr
Hampton, VA 23669

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Booker Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.39747620,37.01943970),"
C. Alton Lindsay Middle School
1636 Briarfield Rd
Hampton, VA 23661

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("C. Alton Lindsay Middle School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.32180023,37.04200363),"
C. Vernon Spratley Middle School
339 Woodland Rd
Hampton, VA 23669

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("C. Vernon Spratley Middle School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.32250214,37.04653931),"
Captain John Smith Elementary School
379 Woodland Rd
Hampton, VA 23669

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Captain John Smith Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.40466309,37.02190781),"
Cesar Tarrant Elementary School
1589 Wingfield Dr
Hampton, VA 23666

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cesar Tarrant Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.41721344,37.04859161),"
Christopher C Kraft Elementary School
600 Concord Dr
Hampton, VA 23666

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Christopher C Kraft Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.33239746,37.02059937),"
Falling Spring Elementary School
Phenix Hall 304
Hampton, VA 23668

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Falling Spring Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.30030060,37.07038498),"
Francis Asbury Elementary School
140 Beach Rd
Hampton, VA 23664

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Francis Asbury Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.41975403,37.02872086),"
Francis Mallory Elementary School
331 Big Bethel Rd
Hampton, VA 23666

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Francis Mallory Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.30398560,37.04524612),"
Francis W. Jones Magnet Middle School
1819 Nickerson Blvd
Hampton, VA 23663

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Francis W. Jones Magnet Middle School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.40101624,37.00187683),"
Hampton Harbour Academy
700 Shell Rd Bldg 2
Hampton, VA 23661

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hampton Harbour Academy",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.38335419,37.02592087),"
Hampton High School
1491 W Queen St
Hampton, VA 23669

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hampton High School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.35290500,37.01721500),"
Hampton/newport News Less Secure Det. Home
4315 Kecoughtan Rd.
Hampton, VA 23669

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hampton/newport News Less Secure Det. Home",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.31281281,37.02758408),"
Jane H. Bryan Elementary School
1021 N Mallory St
Hampton, VA 23663

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jane H. Bryan Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.42140961,37.04114532),"
Jefferson Davis Middle School
1435 Todds Ln
Hampton, VA 23666

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Jefferson Davis Middle School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.31229401,37.04536057),"
John B. Cary Elementary School
2009 Andrews Blvd
Hampton, VA 23663

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John B. Cary Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.35411072,37.04857254),"
John Tyler Elementary School
57 Salina St
Hampton, VA 23669

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John Tyler Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.31919861,37.05598068),"
Kecoughtan High School
522 Woodland Rd
Hampton, VA 23669

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kecoughtan High School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.38330078,37.06722260),"
Luther W Machen Elementary School
20 Sacramento Dr
Hampton, VA 23666

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Luther W Machen Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.35908508,37.03637695),"
Mary Peake Center
1306 Thomas St
Hampton, VA 23669

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mary Peake Center",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.30745697,37.05063248),"
Merrimack Elementary School
2113 Woodmansee Dr
Hampton, VA 23663

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Merrimack Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.40144348,37.14130020),"
Multi-disabled School
700 Shell Rd
Hampton, VA 23661

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Multi-disabled School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.41142700,37.06400000),"
New Horizons Gov School
520 Butler Farm Rd
Hampton, VA 23666

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Horizons Gov School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.41142700,37.06400000),"
New Horizons Reg Ed Ctr- Newport Academy
520 Butler Farm Road
Hampton, VA 23666

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Horizons Reg Ed Ctr- Newport Academy",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.37387848,37.05582809),"
Paul Burbank Elementary School
40 Tidemill Ln
Hampton, VA 23666

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Paul Burbank Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.31668091,37.06076431),"
Phillips Elementary School
703 Lemaster Dr
Hampton, VA 23669

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Phillips Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.31814575,37.03415298),"
Phoebus High School
100 Ireland St
Hampton, VA 23663

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Phoebus High School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.41338348,37.06169891),"
Point Option Alt School
520 Butler Farm Road
Hampton, VA 23666

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Point Option Alt School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.39553070,37.02045059),"
Robert E. Lee Elementary School
1646 Briarfield Rd
Hampton, VA 23669

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robert E. Lee Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.32137299,37.02582550),"
Robert R. Moton Elementary School
339 Old Buckroe Rd
Hampton, VA 23663

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robert R. Moton Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.33353424,37.06866455),"
Samuel P. Langley Elementary School
16 Rockwell Rd
Hampton, VA 23669

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Samuel P. Langley Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.38555908,37.04801941),"
Thomas Eaton Middle School
2108 Cunningham Dr
Hampton, VA 23666

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Thomas Eaton Middle School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.43852997,37.03580093),"
Tucker-capps Elementary School
113 Wellington Dr
Hampton, VA 23666

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tucker-capps Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.38655090,37.05122375),"
William Mason Cooper Elementary School
200 Marcella Rd
Hampton, VA 23666

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("William Mason Cooper Elementary School",'Hampton=' + Hampton.length); Hampton[Hampton.length] = createMarker(new GPoint(-76.38667297,36.99769592),"
Wythe Elementary School
200 Claremont Ave
Hampton, VA 23661

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