function addMarkers() { mySelect = document.getElementById('selection'); Roswell = [];Roswell[Roswell.length] = createMarker(new GPoint(-104.52954102,33.45246506),"
Berrendo Elementary School
505 W. Pine Lodge Rd
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Berrendo Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.51340485,33.47434998),"
Berrendo Middle School
800 Marion Richards
Roswell, NM 88201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Berrendo Middle School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.52110291,33.39636612),"
Chaves County Jdc High School
400 N. Virginia
Roswell, NM 88201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chaves County Jdc High School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.52114868,33.40683746),"
Chisum Elementary School
2301 South Virginia
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chisum Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.51441956,33.42692566),"
Del Norte Elementary School
2701 N. Garden Ave
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Del Norte Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.52089691,33.42697525),"
E Grand Plains Elementary School
3773 E. Grand Plains
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("E Grand Plains Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.51429749,33.39982605),"
Edgewood Elementary School
701 North Garden Ave
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edgewood Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.55892944,33.38675308),"
El Capitan Elementary School
2807 West Bland St
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("El Capitan Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.44309998,33.48640060),"
Goddard High School
701 E. Country Club
Roswell, NM 88201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Goddard High School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.47895813,33.38679123),"
Mesa Middle School
1601 East Bland St
Roswell, NM 88201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mesa Middle School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.53283691,33.41595840),"
Military Hgts Elementary School
1900 North Michigan
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Military Hgts Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.53035736,33.39982986),"
Missouri Ave Elementary School
700 S. Missouri Ave
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Missouri Ave Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.53530121,33.36146545),"
Monterrey Elementary School
910 W. Gayle Street
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Monterrey Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.44309998,33.48640060),"
Mountain View Middl Middle School
312 E. Mtn. View Rd
Roswell, NM 88201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mountain View Middl Middle School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.47895813,33.38679123),"
Nancy Lopez Elementary School
1208 E. Bland Street
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Nancy Lopez Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.55993652,33.39030457),"
Parkview Elementary School
1700 West Alameda St
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Parkview Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.51452637,33.37256241),"
Pecos Elementary School
600 East Hobbs St
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pecos Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.52780151,33.37242889),"
Roswell High School
500 West Hobbs St
Roswell, NM 88201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Roswell High School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.52896881,33.39996338),"
Sidney Gutierrez Middle School
4 E Challenger Rd
Roswell, NM 88201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sidney Gutierrez Middle School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.55915833,33.39868927),"
Sierra Middle School
615 S. Sycamore Ave
Roswell, NM 88201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sierra Middle School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.52108765,33.31480789),"
Sunset Elementary School
25 Martin Street
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunset Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-10.00000000,10.00000000),"
University High School
606 West O''conner Rd
Roswell, NM 88201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("University High School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.53181458,33.38278580),"
Valley View Elementary School
1400 S. Washington
Roswell, NM 88201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Valley View Elementary School",'Roswell=' + Roswell.length); Roswell[Roswell.length] = createMarker(new GPoint(-104.53183746,33.39646530),"
Washington Avenue Elementary School
408 N Washington Ave
Roswell, NM 88201

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