function addMarkers() { mySelect = document.getElementById('selection'); La_Puente = [];La_Puente[La_Puente.length] = createMarker(new GPoint(-117.94293213,34.04801941),"
Baldwin Academy Elementary School
1616 Griffiths Ave.
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Baldwin Academy Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.97231293,34.05237198),"
Bassett Senior High School
904 North Willow Ave.
La Puente, CA 91746

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bassett Senior High School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.96096039,34.03260040),"
California Elementary School
1111 California Ave.
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("California Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.94389343,34.03308105),"
Del Valle Elementary School
801 North Del Valle St.
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Del Valle Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.97231293,34.05237198),"
Edgewood Academy Elementary School
904 North Willow Ave.
La Puente, CA 91746

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edgewood Academy Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.97231293,34.05237198),"
Erwin (thomas M.) Elementary School
943 North Sunkist Ave.
La Puente, CA 91746

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Erwin (thomas M.) Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.94676971,34.04183197),"
Fairgrove Academy (k-8)
15540 Fairgrove Ave.
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairgrove Academy (k-8)",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.96096039,34.03260040),"
Hacienda La Puente Community Day
14162 East Lomitas Ave.
La Puente, CA 91746

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hacienda La Puente Community Day",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.92777252,34.01307678),"
Hurley Elementary School
535 South Dora Guzman Ave.
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hurley Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.97231293,34.05237198),"
Julian (don) Elementary School
904 North Willow Ave.
La Puente, CA 91746

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Julian (don) Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.95561218,34.02503586),"
La Puente High School
15615 East Nelson Ave.
La Puente, CA 91744

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("La Puente High School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.89773560,34.01241302),"
La Seda Elementary School
341 South La Seda Rd.
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("La Seda Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.97141266,34.04457855),"
Lassalette Elementary School
14333 Lassalette St.
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lassalette Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.96665955,34.03380203),"
Nelson Elementary School
330 North California Ave.
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Nelson Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.88677979,34.01363754),"
Nogales High School
401 South Nogales St.
La Puente, CA 91744

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nogales High School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.91365814,34.01394653),"
Northam Elementary School
17800 East Renault
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northam Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.97231293,34.05237198),"
Nueva Vista Continuation High School
904 North Willow Ave.
La Puente, CA 91746

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nueva Vista Continuation High School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.99101257,34.03115082),"
Puente Hills High (alter.)
14162 East Lomitas Ave.
La Puente, CA 91746

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Puente Hills High (alter.)",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.89392090,34.00640869),"
Rorimer Elementary School
18750 East Rorimer St.
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rorimer Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.94728851,34.03072357),"
Sierra Vista Middle School
15801 Sierra Vista Ct.
La Puente, CA 91744

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sierra Vista Middle School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.95920563,34.03431702),"
Sparks Elementary School
15151 East Temple Ave.
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sparks Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.95749664,34.03690720),"
Sparks Middle School
15100 Giordano St.
La Puente, CA 91744

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sparks Middle School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.97231293,34.05237198),"
Sunkist Elementary School
935 Mayland Ave.
La Puente, CA 91746

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunkist Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.96746826,34.04510117),"
Sunset Elementary School
800 North Tonopah
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunset Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.96746826,34.04510117),"
Sunset Orthopedic Handicapped
800 North Tonopah
La Puente, CA 91744

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sunset Orthopedic Handicapped",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.96260834,34.03810883),"
Temple Academy
635 California Ave.
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Temple Academy",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.97231293,34.05237198),"
Torch Middle School
904 North Willow Ave.
La Puente, CA 91746

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Torch Middle School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.99101257,34.03115082),"
Valley Alternative High Continuation School
14162 East Lomitas Ave.
La Puente, CA 91746

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valley Alternative High Continuation School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.97231293,34.05237198),"
Vanwig (j. E.) Elementary School
904 North Willow Ave.
La Puente, CA 91746

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Vanwig (j. E.) Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.94780731,34.02005005),"
Villacorta Elementary School
17840 Villacorta St.
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Villacorta Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.94773102,34.02146149),"
Workman Elementary School
16000 Workman St.
La Puente, CA 91744

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Workman Elementary School",'La_Puente=' + La_Puente.length); La_Puente[La_Puente.length] = createMarker(new GPoint(-117.90755463,34.00954056),"
Yorbita Elementary School
502 South Vidalia St.
La Puente, CA 91744

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