function addMarkers() { mySelect = document.getElementById('selection'); Idaho_Falls = [];Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.03565979,43.50038147),"
3-b Dentention Center
950 Environmental Way
Idaho Falls, ID 83402

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("3-b Dentention Center",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.03694916,43.51123810),"
A H Bush Elementary School
380 W Anderson St
Idaho Falls, ID 83402

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("A H Bush Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-111.96701050,43.47145844),"
Ammon Elementary School
2900 Central Avenue
Idaho Falls, ID 83406

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ammon Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-111.96938800,43.51137700),"
Behavior Health Alternative
3175 East Lincoln Road
Idaho Falls, ID 83401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Behavior Health Alternative",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-111.97121429,43.52566528),"
Bonneville High School
3165 East Iona Road
Idaho Falls, ID 83401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bonneville High School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.01226044,43.50060654),"
Clair E. Gale Junior High School
955 Garfield Street
Idaho Falls, ID 83401

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Clair E. Gale Junior High School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-111.95363617,43.50344849),"
Cloverdale Elementary School
3999 Greenwillow Ln
Idaho Falls, ID 83401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cloverdale Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.01573944,43.49946213),"
Dora Erickson Elementary School
850 Cleveland Street
Idaho Falls, ID 83401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dora Erickson Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.07492065,43.48949051),"
Eagle Rock Junior High School
2020 Pancheri Drive
Idaho Falls, ID 83402

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Eagle Rock Junior High School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.01912689,43.49362183),"
Eastern Idaho Professional-technical High School
690 John Adams Parkway
Idaho Falls, ID 83401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eastern Idaho Professional-technical High School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.01030731,43.48030853),"
Edgemont Gardens Elementary School
1240 Azalea Drive
Idaho Falls, ID 83404

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edgemont Gardens Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.02769470,43.49353790),"
Emerson Elementary School
335 5th Street
Idaho Falls, ID 83401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Emerson Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.06924438,43.49266434),"
Ethel Boyes Elementary School
1875 Brentwood Drive
Idaho Falls, ID 83402

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ethel Boyes Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.01450348,43.58252335),"
Fairview Elementary School
979 East 97th North
Idaho Falls, ID 83401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairview Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-111.98481750,43.49734879),"
Falls Valley Elementary School
2455 Virlow Street
Idaho Falls, ID 83401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Falls Valley Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.07769012,43.47956085),"
Foxhollow Elementary School
2365 Genevieve
Idaho Falls, ID 83404

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Foxhollow Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.03398895,43.48393631),"
Hawthorne Elementary School
1520 S Boulevard Ave
Idaho Falls, ID 83402

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hawthorne Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-111.92704773,43.52533722),"
Hillcrest High School
2800 Owens Street
Idaho Falls, ID 83406

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hillcrest High School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-111.97393036,43.47524261),"
Hillview Elementary School
3075 Teton Street
Idaho Falls, ID 83406

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hillview Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.02371216,43.49235535),"
Idaho Falls Senior High School
601 S Holmes Avenue
Idaho Falls, ID 83401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Idaho Falls Senior High School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-111.96823883,43.51124954),"
Lincoln High School (alt)
3175 East Lincoln Road
Idaho Falls, ID 83401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lincoln High School (alt)",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.00811768,43.48983765),"
Linden Park Elementary School
1305 9th Street
Idaho Falls, ID 83404

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Linden Park Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.02629089,43.47526169),"
Longfellow Elementary School
2500 S Higbee Ave
Idaho Falls, ID 83404

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Longfellow Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.10263824,43.56796265),"
Osgood Elementary School
3491 West 81st North
Idaho Falls, ID 83402

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Osgood Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-111.96379089,43.52684784),"
Rocky Mountain Middle School
3443 North Ammon Road
Idaho Falls, ID 83401

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rocky Mountain Middle School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-111.97492981,43.47188568),"
Sandcreek Middle School
2955 Owen Street
Idaho Falls, ID 83406

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sandcreek Middle School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.06891632,43.48596191),"
Skyline Senior High School
1767 Blue Sky Drive
Idaho Falls, ID 83402

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Skyline Senior High School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.03634644,43.46406174),"
Sunnyside Elementary School
165 Cobblestone Lane
Idaho Falls, ID 83404

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunnyside Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.02870178,43.46067429),"
Taylorview Junior High School
350 Castlerock Lane
Idaho Falls, ID 83402

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Taylorview Junior High School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-111.99349213,43.53934479),"
Telford Academy (alt)
2017 East 49th North
Idaho Falls, ID 83401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Telford Academy (alt)",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.05675507,43.50140762),"
Temple View Elementary School
1500 Scorpius Drive
Idaho Falls, ID 83402

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Temple View Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.00711060,43.48343658),"
Theresa Bunker Elementary School
1385 East 16th Street
Idaho Falls, ID 83404

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Theresa Bunker Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-111.97427368,43.49637222),"
Tiebreaker Elementary School
3100 First Street
Idaho Falls, ID 83401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tiebreaker Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-111.93456268,43.53238678),"
Ucon Elementary School
10841 North 41 East
Idaho Falls, ID 83401

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ucon Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.08542633,43.48425674),"
Westside Elementary School
2680 Newman Drive
Idaho Falls, ID 83402

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westside Elementary School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.06891632,43.48596191),"
Westview Alternative Evening High School
335 5th Street
Idaho Falls, ID 83401

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westview Alternative Evening High School",'Idaho_Falls=' + Idaho_Falls.length); Idaho_Falls[Idaho_Falls.length] = createMarker(new GPoint(-112.03565979,43.50038147),"
White Pine Charter School
Po Box 2825
Idaho Falls, ID 83403

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