function addMarkers() { mySelect = document.getElementById('selection'); Pasadena = [];Pasadena[Pasadena.length] = createMarker(new GPoint(-118.14296722,34.12627029),"
Allendale Elementary School
1135 South Euclid Ave.
Pasadena, CA 91106

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Allendale Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.14596558,34.12543106),"
Blair High School
1201 South Marengo Ave.
Pasadena, CA 91106

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blair High School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.09059906,34.15465927),"
Cleveland Elementary School
524 Palisade St.
Pasadena, CA 91103

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cleveland Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.09658813,34.15920258),"
Coombs (norma) Alternative Elementary School
2600 Paloma St.
Pasadena, CA 91107

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Coombs (norma) Alternative Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.07202911,34.17108917),"
Don Benito Fundamental Elementary School
3700 Denair St.
Pasadena, CA 91107

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Don Benito Fundamental Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.07609558,34.16141510),"
Field Elementary School
3600 Sierra Madre Blvd.
Pasadena, CA 91107

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Field Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.10748291,34.14093781),"
Hamilton Elementary School
2089 Rose Villa St.
Pasadena, CA 91107

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hamilton Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.09059906,34.15465927),"
Jefferson Elementary School
1500 East Villa St.
Pasadena, CA 91106

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.17686462,34.16906357),"
Linda Vista Elementary School
1259 Linda Vista Ave.
Pasadena, CA 91103

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Linda Vista Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.09059906,34.15465927),"
Longfellow Elementary School
1065 East Washington Blvd.
Pasadena, CA 91104

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Longfellow Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.09059906,34.15465927),"
Madison Elementary School
515 Ashtabula St.
Pasadena, CA 91104

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Madison Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.11293030,34.16246414),"
Marshall Fundamental
990 North Allen Ave.
Pasadena, CA 91104

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marshall Fundamental",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.09059906,34.15465927),"
Mckinley Elementary School
325 South Oak Knoll Ave.
Pasadena, CA 91101

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mckinley Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.13890076,34.14749908),"
Mt Shasta Options For Youth Charter
510 North Mount Shasta Blvd.
Pasadena, CA 96067

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mt Shasta Options For Youth Charter",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.15976715,34.17842484),"
Muir High School
1905 North Lincoln Ave.
Pasadena, CA 91103

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Muir High School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.13235100,34.14589200),"
Nia Educational Charter School
Po Box 92976
Pasadena, CA 91109

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nia Educational Charter School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.11814880,34.14613724),"
Odyssey Charter
30 Marion St.
Pasadena, CA 91106

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Odyssey Charter",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.13890076,34.14749908),"
Options For Youth - Upland Charter
199 South Los Robles, Ste. 700
Pasadena, CA 91101

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Options For Youth - Upland Charter",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.09076691,34.16173553),"
Pasadena High School
2925 East Sierra Madre Blvd.
Pasadena, CA 91107

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pasadena High School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.09059906,34.15465927),"
Roosevelt Elementary School
315 North Pasadena Ave.
Pasadena, CA 91103

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.13535309,34.14013672),"
Rose City High Continuation School
351 Hudson Ave.
Pasadena, CA 91109

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rose City High Continuation School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.17309570,34.13700485),"
San Rafael Elementary School
1090 Nithsdale Rd.
Pasadena, CA 91105

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("San Rafael Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.14893341,34.17193604),"
Washington Accelerated Elementary School
1520 North Raymond Ave.
Pasadena, CA 91103

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington Accelerated Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.09059906,34.15465927),"
Washington Middle School
1505 North Marengo Ave.
Pasadena, CA 91103

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Washington Middle School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.09024048,34.15264130),"
Webster Elementary School
2101 East Washington Blvd.
Pasadena, CA 91104

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Webster Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.09059906,34.15465927),"
Willard Elementary School
301 South Madre St.
Pasadena, CA 91107

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Willard Elementary School",'Pasadena=' + Pasadena.length); Pasadena[Pasadena.length] = createMarker(new GPoint(-118.08132935,34.14142609),"
Wilson Middle School
300 South Madre Ave.
Pasadena, CA 91107

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