function addMarkers() { mySelect = document.getElementById('selection'); Eureka = [];Eureka[Eureka.length] = createMarker(new GPoint(-124.17923737,40.77746201),"
Birney (alice) Elementary School
717 South Ave.
Eureka, CA 95503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Birney (alice) Elementary School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.14891815,40.78831100),"
Catherine L. Zane Middle School
2155 S St.
Eureka, CA 95501

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Catherine L. Zane Middle School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.14891815,40.78833389),"
Cic Program High School
2151 S St.
Eureka, CA 95501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cic Program High School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.17369843,40.79650116),"
Cutten Elementary School
4182 Walnut Dr.
Eureka, CA 95503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cutten Elementary School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.14999200,40.80065100),"
Eureka Community
901 Myrtle Ave.
Eureka, CA 95501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eureka Community",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.17863464,40.77343750),"
Eureka Secondary Community Day
674 Allard Ave.
Eureka, CA 95503

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Eureka Secondary Community Day",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.15869904,40.79027557),"
Eureka Senior High School
1915 J St.
Eureka, CA 95501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eureka Senior High School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.08328247,40.78587341),"
Freshwater Charter Middle School
75 Greenwood Heights Dr.
Eureka, CA 95503

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Freshwater Charter Middle School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.08328247,40.78587341),"
Freshwater Elementary School
75 Greenwood Heights Dr.
Eureka, CA 95503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Freshwater Elementary School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.03491211,40.75639343),"
Garfield Elementary School
2200 Freshwater Rd.
Eureka, CA 95503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.16139984,40.77109909),"
Grant Elementary School
3901 G St.
Eureka, CA 95503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Grant Elementary School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.15917969,40.78856277),"
Humboldt Bay High School
2100 J St.
Eureka, CA 95501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Humboldt Bay High School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.14999390,40.80086899),"
Humboldt County Community High School
901 Mrytle Ave.
Eureka, CA 95501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Humboldt County Community High School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.14999390,40.80086899),"
Humboldt County Court Schools
901 Myrtle Ave.
Eureka, CA 95501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Humboldt County Court Schools",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.14999200,40.80065100),"
Humboldt County Office Of Education Court
901 Myrtle Ave.
Eureka, CA 95501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Humboldt County Office Of Education Court",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.14999200,40.80065100),"
Humboldt County Office Of Education Juvenile Hall
901 Myrtle Ave.
Eureka, CA 95501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Humboldt County Office Of Education Juvenile Hall",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.14999200,40.80065100),"
Humboldt County Rop
901 Myrtle Ave.
Eureka, CA 95501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Humboldt County Rop",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.16960144,40.79740143),"
Jefferson Elementary School
Grant And B Sts.
Eureka, CA 95501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.13251495,40.79496384),"
Lafayette Elementary School
3100 Park St.
Eureka, CA 95501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lafayette Elementary School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.17328644,40.78063583),"
Lincoln Elementary School
216 West Harris St.
Eureka, CA 95503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.22940063,40.65599823),"
Pacific View Charter
2937 Moore Ave.
Eureka, CA 95501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pacific View Charter",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.15879822,40.75920105),"
Pine Hill Elementary School
5230 Vance Ave.
Eureka, CA 95503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pine Hill Elementary School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.17369843,40.79650116),"
Ridgewood Elementary School
2060 Ridgewood Dr.
Eureka, CA 95503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ridgewood Elementary School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.15879822,40.75920105),"
South Bay Elementary School
6077 Loma Ave.
Eureka, CA 95503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Bay Elementary School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.14999390,40.80086899),"
Special Education
901 Myrtle Ave.
Eureka, CA 95501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Special Education",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.14220428,40.77820587),"
Washington Elementary School
3322 Dolbeer St.
Eureka, CA 95503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.14122772,40.76575470),"
Winship Middle School
2500 Cypress Ave.
Eureka, CA 95503

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Winship Middle School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.12802124,40.78406143),"
Worthington Elementary School
3400 Erie St.
Eureka, CA 95501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Worthington Elementary School",'Eureka=' + Eureka.length); Eureka[Eureka.length] = createMarker(new GPoint(-124.17863464,40.77343750),"
Zoe Barnum High School
674 Allard Ave.
Eureka, CA 95503

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zoe Barnum High School",'Eureka=' + Eureka.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(Eureka); 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(Eureka);map.removeOverlays(Eureka); map.addOverlays(Eureka); centerByArray(Eureka, false, false); cntMarker += Eureka.length; centerByArray(Eureka,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'); } }