function addMarkers() { mySelect = document.getElementById('selection'); Hanford = [];Hanford[Hanford.length] = createMarker(new GPoint(-119.47763824,36.32756424),"
Delta View Elementary School
1201 Lacey Blvd.
Hanford, CA 93230

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Delta View Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.62083435,36.24053574),"
Gardenside Elementary School
9615 Temple Dr.
Hanford, CA 93230

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gardenside Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.62049866,36.29359818),"
Hamilton Elementary School
P.o. Box 1067
Hanford, CA 93232

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hamilton Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.64542700,36.32555400),"
Hanford Elementary Community Day
Po Box 1067
Hanford, CA 93232

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hanford Elementary Community Day",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.64557648,36.34283829),"
Hanford High Night Continuation School
1201 North Douty
Hanford, CA 93230

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hanford High Night Continuation School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.64557648,36.34283829),"
Hanford High School
120 East Grangeville Blvd.
Hanford, CA 93230

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hanford High School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.64557648,36.34283829),"
Hanford Jt. Union High Community Day
120 East Grangeville Blvd.
Hanford, CA 93230

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hanford Jt. Union High Community Day",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.66236115,36.32823563),"
Hanford West High School
1150 West Lacey Blvd.
Hanford, CA 93230

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hanford West High School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.66230011,36.32823563),"
J. C. Montgomery School
1450 Forum Dr.
Hanford, CA 93230

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("J. C. Montgomery School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.62049866,36.29359818),"
Jefferson Elementary School
Po Box 1067
Hanford, CA 93232

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.64557648,36.34283829),"
Johnson (earl F.) High Continuation School
1201 North Douty
Hanford, CA 93230

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Johnson (earl F.) High Continuation School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.62049866,36.29359818),"
Joseph M. Simas Elementary School
Po Box 1067
Hanford, CA 93232

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Joseph M. Simas Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.64418793,36.32683945),"
Kennedy (john F.) Junior High School
Po Box 1067
Hanford, CA 93232

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kennedy (john F.) Junior High School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.64418793,36.32683945),"
King (martin Luther Jr) Elementary School
Po Box 1067
Hanford, CA 93232

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("King (martin Luther Jr) Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.65468597,36.30083466),"
Kings County Community High School
11835 South 11th Ave.
Hanford, CA 93230

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kings County Community High School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.66096900,36.32814200),"
Kings County Rop
1144 West Lacey Blvd.
Hanford, CA 93230

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kings County Rop",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.64240265,36.40133667),"
Kings River-hardwick Elementary School
10300 Excelsior Ave.
Hanford, CA 93230

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kings River-hardwick Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.58293152,36.33043671),"
Kit Carson Elementary School
9895 Seventh Ave.
Hanford, CA 93230

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kit Carson Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.62083435,36.24053574),"
Lakeside Elementary School
9100 Jersey Ave.
Hanford, CA 93230

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lakeside Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.62049866,36.29359818),"
Lincoln Elementary School
Po Box 1067
Hanford, CA 93232

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.58293152,36.33043671),"
Mid Valley Altern. Charter
9895 Seventh Ave.
Hanford, CA 93230

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mid Valley Altern. Charter",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.62049866,36.29359818),"
Monroe Elementary School
Po Box 1067
Hanford, CA 93232

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Monroe Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.70916748,36.34459305),"
Pioneer Elementary School
8810 14th Ave.
Hanford, CA 93230

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pioneer Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.71350098,36.34529877),"
Pioneer Middle School
8810 14th Ave.
Hanford, CA 93230

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pioneer Middle School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.62049866,36.29359818),"
Richmond (lee) Elementary School
Po Box 1067
Hanford, CA 93232

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Richmond (lee) Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.62049866,36.29359818),"
Roosevelt Elementary School
Po Box 1067
Hanford, CA 93232

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.66230011,36.32823563),"
Special Education
1144 West Lacey Blvd.
Hanford, CA 93230

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Special Education",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.64418793,36.32683945),"
Washington (george) Elementary School
Po Box 1067
Hanford, CA 93232

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington (george) Elementary School",'Hanford=' + Hanford.length); Hanford[Hanford.length] = createMarker(new GPoint(-119.62049866,36.29359818),"
Wilson (woodrow) Junior High School
Po Box 1067
Hanford, CA 93232

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Wilson (woodrow) Junior High School",'Hanford=' + Hanford.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(Hanford); 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(Hanford);map.removeOverlays(Hanford); map.addOverlays(Hanford); centerByArray(Hanford, false, false); cntMarker += Hanford.length; centerByArray(Hanford,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'); } }