function addMarkers() { mySelect = document.getElementById('selection'); Tucson = [];Tucson[Tucson.length] = createMarker(new GPoint(-110.98829651,32.26580048),"
Academy Adventures Primary School
3902 North Flowing Wells Road
Tucson, AZ 85705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Academy Adventures Primary School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.99889374,32.27206421),"
Academy Of Math And Science
1557 W Prince Rd
Tucson, AZ 85705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Academy Of Math And Science",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.97181702,32.24528885),"
Alternative Computerized Education (ace) Charter H
1901 N. Stone Ave.
Tucson, AZ 85705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alternative Computerized Education (ace) Charter H",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.97375488,32.26941299),"
Amphitheater High School
125 W Yavapai Road
Tucson, AZ 85705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Amphitheater High School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.96735382,32.27213669),"
Amphitheater Middle School
315 East Prince Road
Tucson, AZ 85705

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Amphitheater Middle School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-111.02423859,32.30330658),"
Carden Of Tucson Elementary School
5260 N. Royal Palm Drive
Tucson, AZ 85705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carden Of Tucson Elementary School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-111.01400757,32.28723526),"
Centennial Elementary School
2200 W Wetmore
Tucson, AZ 85705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Centennial Elementary School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.97149658,32.23904419),"
Childrens Academy Of Arizona - Tucson (charter)
1346 North Stone Ave.
Tucson, AZ 85705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Childrens Academy Of Arizona - Tucson (charter)",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.98036957,32.25556183),"
E C Nash School
515 W Kelso
Tucson, AZ 85705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("E C Nash School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.96443176,32.28647614),"
El Hogar De La Paz
450 East Wetmore Road
Tucson, AZ 85705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("El Hogar De La Paz",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-111.00920868,32.28141022),"
Flowing Wells Alternative Education Center
1949 W. Gardner Lane
Tucson, AZ 85705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Flowing Wells Alternative Education Center",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.99671936,32.27230072),"
Flowing Wells Early Childhood Education Center
1450 W. Prince Road
Tucson, AZ 85705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Flowing Wells Early Childhood Education Center",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.99516296,32.27455902),"
Flowing Wells High School
3725 N Flowing Wells Rd
Tucson, AZ 85705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Flowing Wells High School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-111.01216125,32.28950500),"
Flowing Wells Junior High School
4545 N La Cholla Blvd
Tucson, AZ 85705

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Flowing Wells Junior High School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.96356201,32.25840759),"
Helen Keeling Elementary School
2837 N. Los Altos Avenue
Tucson, AZ 85705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Helen Keeling Elementary School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-111.00325012,32.28462982),"
Homer Davis Elementary School
4250 N Romero Rd
Tucson, AZ 85705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Homer Davis Elementary School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-111.00907898,32.28140259),"
Inscape Alternative High School
1949 W Gardner
Tucson, AZ 85705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Inscape Alternative High School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.96907806,32.27213669),"
L M Prince School
125 E. Prince Road
Tucson, AZ 85705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("L M Prince School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.98829651,32.26580048),"
Laguna Elementary School
5001 N Shannon Rd
Tucson, AZ 85705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Laguna Elementary School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.99482727,32.27747345),"
Laurent Clerc Elementary School (charter)
3902 N. Flowing Wells Rd.
Tucson, AZ 85705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Laurent Clerc Elementary School (charter)",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.99889374,32.27206421),"
Mathematics And Science Achievement School
1557 W. Prince Rd.
Tucson, AZ 85705

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mathematics And Science Achievement School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.96798000,32.22903300),"
Meta Academy High School
222 E. 5th Street
Tucson, AZ 85705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Meta Academy High School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.96709200,32.23164800),"
Paulo Freire Freedom School
300 E. University Blvd.
Tucson, AZ 85705

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Paulo Freire Freedom School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.98521423,32.22485352),"
Pima Partnership School, High School
330 N. Commerce Park Loop
Tucson, AZ 85705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pima Partnership School, High School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.98236084,32.24827194),"
Richey Elementary School
2209 N 15 Th Avenue
Tucson, AZ 85705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Richey Elementary School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.96839905,32.27186203),"
Rillito Center
266 E Pastime Road
Tucson, AZ 85705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rillito Center",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.96392059,32.22783661),"
Roskruge Bilingual Elementary School
501 E. 6th St.
Tucson, AZ 85705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roskruge Bilingual Elementary School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.96392059,32.22783661),"
Roskruge Bilingual Magnet Middle School
501 E 6th St
Tucson, AZ 85705

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Roskruge Bilingual Magnet Middle School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.97859955,32.24649811),"
Transformational Learning Centers
P.o. Box 5310
Tucson, AZ 85705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Transformational Learning Centers",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.96233368,32.22784042),"
Tucson Magnet High School
400 N. Second Avenue
Tucson, AZ 85705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tucson Magnet High School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.97826385,32.24063873),"
Tucson Preparatory School
1525 N. Oracle Rd.
Tucson, AZ 85705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tucson Preparatory School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.99483490,32.26664352),"
Walter Douglas Elementary School
3302 N Flowing Wells Rd
Tucson, AZ 85705

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