function addMarkers() { mySelect = document.getElementById('selection'); Reno = [];Reno[Reno.length] = createMarker(new GPoint(-119.80949402,39.49383545),"
",iconRd); mySelect.options[mySelect.options.length] = new Option("Anderson Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79393768,39.51446152),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Bailey Charter Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.82632446,39.50526428),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Beck Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.82632446,39.50526428),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Beck, Jessie Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.89481354,39.52129745),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Billinghurst Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79342651,39.52108002),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Booth Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79342651,39.52108002),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Booth, Libby Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.72499847,39.40384674),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Brown Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.78411102,39.55046463),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Cannan Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.78411102,39.55046463),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Cannan, Rita Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.85748291,39.48429871),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Caughlin Ranch Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.84665680,39.53696442),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Clayton Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.84665680,39.53696442),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Clayton, Archie Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.82199097,39.52438354),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Coral Academy Of Science Charter",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.78559113,39.50953674),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Corbett, Roger Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79519653,39.41540146),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Damonte Ranch High School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.88353729,39.65212250),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Desert Heights Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.75090027,39.48934174),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Dodson Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.75090027,39.48934174),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Dodson, Edwin Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.74472809,39.47536469),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Donner Springs Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.74643707,39.44263840),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Double Diamond Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79502106,39.54095459),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Duncan Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79502106,39.54095459),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Duncan, Glenn Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79351807,39.50366211),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Echo Loder Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.84157562,39.53305435),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Elmcrest Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79264832,39.54176331),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Esl At Traner Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.78178406,39.50603867),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Esl At Wooster",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79351807,39.50366211),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Esl Center",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79351807,39.50366211),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Esl Echo Loder Center",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79351807,39.50366211),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Esl Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.77514648,39.38944626),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Galena High School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.96902466,39.67953873),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Gomes Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.96902466,39.67953873),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Gomes, Nancy Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.86074066,39.50719833),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Gomm Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.86074066,39.50719833),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Gomm, Roy Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.75116600,39.51036600),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Halima Academy Charter High School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.71598053,39.50029373),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Hidden Valley Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.80992126,39.53677368),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Homebound",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.78087616,39.45953751),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Huffaker Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79842377,39.55790329),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Hug High School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79842377,39.55790329),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Hug, Proctor High School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79957581,39.40503311),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Hunsburger Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.83593750,39.51137543),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Hunter Lake Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.75045013,39.51077652),"",iconGr); mySelect.options[mySelect.options.length] = new Option("I Can Do Anything Charter School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.83938599,39.64492035),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lemmon Valley Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.77579498,39.42651367),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lenz Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.77579498,39.42651367),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lenz, Elizabeth Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.78047943,39.48789215),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mariposa Academy Charter School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.77981567,39.54276276),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mathews, Bernice Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.88275146,39.53339386),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Mcqueen High School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.89298248,39.54518890),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Melton, Rolland Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.75852966,39.54437637),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Montessori Charter School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.81547546,39.51555252),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mount Rose Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.82357788,39.60763168),"",iconGr); mySelect.options[mySelect.options.length] = new Option("North Valleys High School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.88195801,39.62412643),"",iconBl); mySelect.options[mySelect.options.length] = new Option("O'brien Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.82897949,39.51642990),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Occupational Center",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.83418274,39.54023743),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Peavine Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.77546692,39.43220901),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Picollo, Marvin School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.78171539,39.47993851),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Pine Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.78171539,39.47993851),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Pine, Edward Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.78264618,39.35093689),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Valley Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.82009888,39.54520035),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Rainshadow Community Charter",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.75433400,39.50739600),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Regional Technical Institute",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.82665253,39.51721573),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Reno High School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.88233948,39.61608124),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Sierra Nv Academy Charter",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.81291199,39.53010941),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Sierra Vista Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.90141296,39.63254929),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Silver Lake Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.83826447,39.60726166),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Smith, Alice Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.78205872,39.47985840),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Smithridge Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.88185883,39.63182068),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Stead Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.84658051,39.51040649),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Swope Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.84658051,39.51040649),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Swope, Darrell Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.77537400,39.51516100),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Team A Charter High School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79904938,39.57381058),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Tmcc Magnet High School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.85018158,39.53796387),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Towles Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.85018158,39.53796387),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Towles, Mamie Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79264832,39.54176331),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Traner Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79264832,39.54176331),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Traner, Fred Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79251862,39.51446152),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Vaughn Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79251862,39.51446152),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Vaughn, Otis Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.80037689,39.51343155),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Veterans Memorial Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.85594177,39.52855301),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Warner Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.85594177,39.52855301),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Warner, Grace Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79842377,39.55790329),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Washoe High School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.89335632,39.52783203),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Westergard Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.85418200,39.63245900),"",iconBl); mySelect.options[mySelect.options.length] = new Option("William O'brien Middle School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.87834930,39.52297592),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Winnemucca, Sarah Elementary School",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.79505157,39.52419662),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Wittenberg Hall",'Reno=' + Reno.length); Reno[Reno.length] = createMarker(new GPoint(-119.78178406,39.50603867),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Wooster High School",'Reno=' + Reno.length); maxLng = -119.71598053; maxLat = 39.67953873; minLng = -119.96902466; minLat = 39.35093689; reCenterMap(); } // 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(Reno); 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(Reno);map.removeOverlays(Reno); map.addOverlays(Reno); centerByArray(Reno, false, false); cntMarker += Reno.length; centerByArray(Reno,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'); } }