function addMarkers() { mySelect = document.getElementById('selection'); El_Centro = [];El_Centro[El_Centro.length] = createMarker(new GPoint(-115.56366730,32.78966141),"
Central High School
1001 Brighton Ave.
El Centro, CA 92243

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central High School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.57405853,32.78038788),"
De Anza Elementary School
1530 South Waterman Ave.
El Centro, CA 92243

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("De Anza Elementary School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.55676270,32.77676392),"
Desert Garden Elementary School
1900 South Sixth St.
El Centro, CA 92243

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Desert Garden Elementary School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.55046082,32.78264236),"
Desert Oasis High Continuation School
1302 South Third St.
El Centro, CA 92243

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Desert Oasis High Continuation School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.55926514,32.78449631),"
Harding Elementary School
950 South Seventh St.
El Centro, CA 92243

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Harding Elementary School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.57426453,32.78839874),"
Hedrick (margaret) Elementary School
550 South Waterman Ave.
El Centro, CA 92243

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hedrick (margaret) Elementary School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.55883000,32.79177800),"
Imperial Valley Rop
687 State St.
El Centro, CA 92243

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Imperial Valley Rop",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.53945923,32.78393173),"
Juvenile Hall/community
1398 Sperber Rd.
El Centro, CA 92243

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Juvenile Hall/community",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.55725861,32.80015182),"
Kennedy Middle School
900 North Sixth St.
El Centro, CA 92243

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kennedy Middle School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.57825470,32.80383682),"
King (martin Luther Jr.) Elementary School
1950 Villa Ave.
El Centro, CA 92243

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("King (martin Luther Jr.) Elementary School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.56567383,32.79393005),"
Lincoln Elementary School
200 North Twelfth St.
El Centro, CA 92243

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.59514618,32.75236130),"
Mccabe Elementary School
701 West Mccabe Rd.
El Centro, CA 92243

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mccabe Elementary School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.56123352,32.80212402),"
Mckinley Elementary School
1177 North Eighth St.
El Centro, CA 92243

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.47398376,32.80031967),"
Meadows Elementary School
2059 Bowker Rd.
El Centro, CA 92243

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Meadows Elementary School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.57857513,32.77726364),"
Southwest High School
2001 Ocotillo Dr.
El Centro, CA 92243

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southwest High School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.56452179,32.75232315),"
Special Education
1398 Sperber Rd.
El Centro, CA 92243

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Special Education",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.58412170,32.79293823),"
Sunflower Elementary School
2450 Main St.
El Centro, CA 92243

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunflower Elementary School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.54403687,32.79149246),"
Washington Elementary School
223 South First St.
El Centro, CA 92243

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Elementary School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.73249054,32.75821304),"
Westside Elementary School
2295 West Vaughn Rd.
El Centro, CA 92243

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westside Elementary School",'El_Centro=' + El_Centro.length); El_Centro[El_Centro.length] = createMarker(new GPoint(-115.56696320,32.78756332),"
Wilson Junior High School
600 South Wilson Ave.
El Centro, CA 92243

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