function addMarkers() { mySelect = document.getElementById('selection'); Las_Cruces = [];Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Alameda Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Alameda Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.90926600,32.29551300),"
Alma D'arte Charter
5p.o. Box 7027
Las Cruces, NM 88006

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alma D'arte Charter",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Booker T. Washington Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Booker T. Washington Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Camino Real Middle School
505 S Main,suite 249
Las Cruces, NM 88011

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Camino Real Middle School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Central Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Cesar E. Chavez Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cesar E. Chavez Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.83399963,32.28879929),"
Columbia Elementary School
4555 Elks Drive
Las Cruces, NM 88005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Columbia Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Conlee Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Conlee Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77748900,32.30585900),"
Desert Hills Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Desert Hills Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Dona Ana Elementary School
505 S Main,suite 249
Las Cruces, NM 88032

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dona Ana Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77748900,32.30585900),"
Dona Ana Headstart
505 S Main,suite 249
Las Cruces, NM 88032

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dona Ana Headstart",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Dona Ana Jdc
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dona Ana Jdc",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
East Picacho Elementary School
505 S Main,suite 249
Las Cruces, NM 88343

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Picacho Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Fairacres Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairacres Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Hermosa Hgts Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hermosa Hgts Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Highland Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Highland Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Hillrise Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hillrise Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77748900,32.30585900),"
Homebound/hospital
505 S Main,suite249
Las Cruces, NM 88001

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Homebound/hospital",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Jornada Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jornada Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.76509800,32.29488000),"
La Academia De Idiom
1550 South Esperanza
Las Cruces, NM 88001

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("La Academia De Idiom",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Las Cruces High School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Las Cruces High School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Loma Heights Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Loma Heights Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Lynn Middle School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lynn Middle School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Mac Arthur Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mac Arthur Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Mayfield High School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mayfield High School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Mesilla Alt. Program
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mesilla Alt. Program",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Mesilla Elementary School
505 S Main,suite 249
Las Cruces, NM 88046

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mesilla Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.74957275,32.24802399),"
Mesilla Park Elementary School
505 S Main,suite 249
Las Cruces, NM 88047

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mesilla Park Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Mesilla Valley Rtc
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mesilla Valley Rtc",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Onate High School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Onate High School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Picacho Middle School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Picacho Middle School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
San Andres High School
505 S Main,suite 249
Las Cruces, NM 88046

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("San Andres High School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77748900,32.30585900),"
San Andres Learning
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("San Andres Learning",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Sierra Middle School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sierra Middle School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Sunrise Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunrise Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Tombaugh Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tombaugh Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Univ Hills Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Univ Hills Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Valley View Elementary School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Valley View Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
Vista Middle School
505 S Main,suite 249
Las Cruces, NM 88001

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Vista Middle School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
White Sands Elementary School
505 S Main,suite 249
Las Cruces, NM 88002

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("White Sands Elementary School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77765656,32.30614853),"
White Sands Middle School
505 S Main,suite 249
Las Cruces, NM 88002

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("White Sands Middle School",'Las_Cruces=' + Las_Cruces.length); Las_Cruces[Las_Cruces.length] = createMarker(new GPoint(-106.77773400,32.30673000),"
Zia Middle School
505 S Main,suite 249
Las Cruces, NM 88001

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