function addMarkers() { mySelect = document.getElementById('selection'); Madera = [];Madera[Madera.length] = createMarker(new GPoint(-120.08038330,36.95816422),"
Adams (john) Elementary School
1822 National Ave.
Madera, CA 93637

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Adams (john) Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.06517029,36.94431686),"
Alpha Elementary School
900 Stadium Rd.
Madera, CA 93637

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Alpha Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.03691101,36.95273590),"
Alternative/opportunity High School
28261 Avenue 14
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alternative/opportunity High School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.05242400,36.98618000),"
Apollo Elementary Community Day
28123 Avenue 14
Madera, CA 93638

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Apollo Elementary Community Day",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.05746460,37.02456284),"
Berenda Elementary School
26820 Club Dr.
Madera, CA 93638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Berenda Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-119.87947083,36.98747635),"
Bonadelle Community Day
16436 Paula Rd.
Madera, CA 93638

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bonadelle Community Day",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-119.86762238,36.92323685),"
Camelot High Continuation School
16362 Paula Rd.
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Camelot High Continuation School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.05242400,36.98618000),"
Challenger Elementary Community Day
28123 Avenue 14
Madera, CA 93638

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Challenger Elementary Community Day",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.03691101,36.95273590),"
Discovery Secondary
28123 Avenue 14
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Discovery Secondary",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.20246887,37.01734543),"
Dixieland Elementary School
18440 Road 19
Madera, CA 93637

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dixieland Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.00923920,36.86593628),"
Eastin-arcola Elementary School
29551 Avenue 8
Madera, CA 93637

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eastin-arcola Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.05242400,36.98618000),"
Enterprise Secondary
28281 Avenue 14
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Enterprise Secondary",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.03691101,36.95273590),"
Enterprise Secondary School
28123 Avenue 14
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Enterprise Secondary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.06971500,36.98690000),"
Ezequiel Tafoya Alvarado Academy
26247 Ellis St.
Madera, CA 93638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ezequiel Tafoya Alvarado Academy",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.06766510,36.93843842),"
Furman (duane E.) High (alter.)
26355 Avenue 13
Madera, CA 93637

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Furman (duane E.) High (alter.)",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.15625763,36.95102310),"
Howard Elementary School
13878 Road 21 12
Madera, CA 93637

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Howard Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-119.86762238,36.92323685),"
Independence High School
37479 Ave. 12
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Independence High School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.06722600,36.99267600),"
Jack G. Desmond Middle School
26490 Martin St.
Madera, CA 93638

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Jack G. Desmond Middle School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.07424164,36.96023560),"
Jefferson (thomas) Middle School
1407 Sunset Ave.
Madera, CA 93637

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Jefferson (thomas) Middle School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.03441620,36.95273590),"
Juvenile Hall (endeavor/voyager Secondary) High School
28261 Avenue 14
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Juvenile Hall (endeavor/voyager Secondary) High School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.04451752,36.96268845),"
King (martin Luther Jr.) Middle School
601 Lilly St.
Madera, CA 93038

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("King (martin Luther Jr.) Middle School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.12857056,36.87154007),"
La Vina Elementary School
8594 Road 23
Madera, CA 93637

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("La Vina Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-119.86762238,36.92323685),"
Liberty High School
37479 Avenue 12
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Liberty High School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.33402252,36.92358017),"
Liberty Middle School
12220 Road 36
Madera, CA 93638

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Liberty Middle School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-119.86765700,36.92289500),"
Lincoln Community Day
37479 Ave.12
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lincoln Community Day",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.10366821,36.96149826),"
Lincoln Elementary School
650 Liberty Ln.
Madera, CA 93637

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.02931700,36.95260800),"
Madera County Alternative/opportunity
28123 Avenue 14
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Madera County Alternative/opportunity",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.06582642,36.95590591),"
Madera High School
200 South L St.
Madera, CA 93637

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Madera High School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.06491852,36.95255661),"
Madison Elementary School
109 Stadium Rd.
Madera, CA 93637

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Madison Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.04050446,36.97102356),"
Millview Elementary School
1609 Clinton St.
Madera, CA 93638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Millview Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.05603027,36.98492813),"
Monroe (james) Elementary School
1819 North Lake St.
Madera, CA 93638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Monroe (james) Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.03843689,36.97220230),"
Mountain Vista High (continuation)
1901 Clinton St.
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mountain Vista High (continuation)",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.06722600,36.99267600),"
Nishimoto Elementary School
26460 Martin St.
Madera, CA 93638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Nishimoto Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.03691101,36.95273590),"
Pioneer Technical Center
28123 Avenue 14
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pioneer Technical Center",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.07051849,36.85143661),"
Ripperdan Elementary School
26133 Ave. 7
Madera, CA 93637

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ripperdan Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.06399400,36.96205500),"
Ripperdan High School
26133 Avenue 7
Madera, CA 93637

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ripperdan High School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.10427856,36.95679855),"
Sherman Thomas Charter
1902 Howard Rd.
Madera, CA 93638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sherman Thomas Charter",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-119.87947083,36.98747635),"
Sierra View Elementary School
16436 Paula Rd.
Madera, CA 93638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sierra View Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.04553223,36.95283890),"
Sierra Vista Elementary School
917 Olive Ave.
Madera, CA 93638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sierra Vista Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.03691101,36.95273590),"
Special Education
28123 Ave. 14
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Special Education",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-119.91171600,36.90445000),"
Valley Teen Ranch Community Day
10535 Road 35
Madera, CA 93638

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valley Teen Ranch Community Day",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-120.06175995,36.97053528),"
Washington (george) Elementary School
509 South St.
Madera, CA 93638

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Washington (george) Elementary School",'Madera=' + Madera.length); Madera[Madera.length] = createMarker(new GPoint(-119.88565826,36.92983627),"
Webster Elementary School
36477 Ruth Ave.
Madera, CA 93638

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