function addMarkers() { mySelect = document.getElementById('selection'); Pocatello = [];Chubbuck = [];Downey = [];Inkom = [];Lava_Hot_Springs = [];Arimo = [];Mc_Cammon = [];mySelect.options[mySelect.options.length] = new Option("Arimo schools",'all=Arimo'); mySelect.options[mySelect.options.length] = new Option("Chubbuck schools",'all=Chubbuck'); mySelect.options[mySelect.options.length] = new Option("Downey schools",'all=Downey'); mySelect.options[mySelect.options.length] = new Option("Inkom schools",'all=Inkom'); mySelect.options[mySelect.options.length] = new Option("Lava Hot Springs schools",'all=Lava_Hot_Springs'); mySelect.options[mySelect.options.length] = new Option("Mc Cammon schools",'all=Mc_Cammon'); mySelect.options[mySelect.options.length] = new Option("Pocatello schools",'all=Pocatello'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.38189697,42.79679871),"
Century High School
7801 Diamondback Drive
Pocatello, ID 83204

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Century High School",'Pocatello=' + Pocatello.length); Chubbuck[Chubbuck.length] = createMarker(new GPoint(-112.47714996,42.92573547),"
Chubbuck Elementary School
600 West Chastain Drive
Chubbuck, ID 83202

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chubbuck Elementary School",'Chubbuck=' + Chubbuck.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.47225952,42.89886475),"
Claude A Wilcox Elementary School
427 Lark Lane
Pocatello, ID 83201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Claude A Wilcox Elementary School",'Pocatello=' + Pocatello.length); Downey[Downey.length] = createMarker(new GPoint(-112.12280273,42.42378235),"
Downey Elementary School
88 S 4th E
Downey, ID 83234

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Downey Elementary School",'Downey=' + Downey.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.42272186,42.89883423),"
Edahow Elementary School
2020 Pocatello Creek Road
Pocatello, ID 83201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edahow Elementary School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.44219971,42.86830139),"
Family Treatment Prom-unit Fun
3115 Pole Line Road
Pocatello, ID 83201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Family Treatment Prom-unit Fun",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.41738892,42.86874771),"
Franklin Junior High School
2271 East Terry Street
Pocatello, ID 83201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Franklin Junior High School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.41966248,42.91611099),"
Gate City Elementary School
2288 Hiskey Street
Pocatello, ID 83201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gate City Elementary School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.46638489,42.89087296),"
Gateway Professional-technical Center
3115 Pole Line Road
Pocatello, ID 83204

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gateway Professional-technical Center",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.43726349,42.87703705),"
Greenacres Elementary School
1250 East Oak Street
Pocatello, ID 83201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greenacres Elementary School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.46813965,42.89486313),"
Hawthorne Junior High School
1025 West Eldredge Street
Pocatello, ID 83201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hawthorne Junior High School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.42677307,42.90560150),"
Highland Senior High School
1800 Bench Road
Pocatello, ID 83201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Highland Senior High School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.40921021,42.82060242),"
Indian Hills Elementary School
666 Cheyenne Avenue
Pocatello, ID 83204

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Indian Hills Elementary School",'Pocatello=' + Pocatello.length); Inkom[Inkom.length] = createMarker(new GPoint(-112.24220276,42.79930115),"
Inkom Elementary School
Po Box 430
Inkom, ID 83245

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Inkom Elementary School",'Inkom=' + Inkom.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.46202087,42.86569595),"
Irving Junior High School
911 North Grant Avenue
Pocatello, ID 83204

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Irving Junior High School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.44490814,42.87081146),"
Isu, Early Learning Class
Po Box 8316
Pocatello, ID 83209

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Isu, Early Learning Class",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.47104645,42.86223602),"
Jefferson Elementary School
1455 Gwen Drive
Pocatello, ID 83204

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Elementary School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.45011139,42.87973785),"
Kinport (alternative) Academy
252 Pershing Avenue
Pocatello, ID 83201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kinport (alternative) Academy",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.45648956,42.89048767),"
Kinport Academy
845 Mckinley Ave
Pocatello, ID 83201

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kinport Academy",'Pocatello=' + Pocatello.length); Lava_Hot_Springs[Lava_Hot_Springs.length] = createMarker(new GPoint(-112.02020264,42.60229874),"
Lava Elementary School
Po Box 660
Lava Hot Springs, ID 83246

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lava Elementary School",'Lava_Hot_Springs=' + Lava_Hot_Springs.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.45986938,42.88980103),"
Lewis & Clark Elementary School
800 Grace Drive
Pocatello, ID 83201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lewis & Clark Elementary School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.47451782,42.87293625),"
Lincoln Early Childhood Center
330 Oakwood Drive
Pocatello, ID 83204

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Early Childhood Center",'Pocatello=' + Pocatello.length); Arimo[Arimo.length] = createMarker(new GPoint(-112.24479675,42.54830170),"
Marsh Valley Alternative High School
12655 S Old Hwy 91
Arimo, ID 83214

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marsh Valley Alternative High School",'Arimo=' + Arimo.length); Arimo[Arimo.length] = createMarker(new GPoint(-112.17845154,42.57678986),"
Marsh Valley High School
12655 S Old Hwy 91
Arimo, ID 83214

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marsh Valley High School",'Arimo=' + Arimo.length); Arimo[Arimo.length] = createMarker(new GPoint(-112.17810059,42.57604599),"
Marsh Valley Middle School
12805 South Old Hwy 91
Arimo, ID 83214

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Marsh Valley Middle School",'Arimo=' + Arimo.length); Mc_Cammon[Mc_Cammon.length] = createMarker(new GPoint(-112.22589874,42.63209915),"
Mountain View Elementary School
Po Box 69
Mc Cammon, ID 83250

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mountain View Elementary School",'Mc_Cammon=' + Mc_Cammon.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.43549347,42.91429901),"
New Horizons High School
10714 North Fairgrounds Rd
Pocatello, ID 83201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Horizons High School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.45648956,42.89048767),"
New Horizons High School (alt)
845 Mckinley Ave
Pocatello, ID 83201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Horizons High School (alt)",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.45931244,42.88036346),"
Pocatello Community Charter
615 W Maple
Pocatello, ID 83201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pocatello Community Charter",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.44219971,42.86830139),"
Pocatello Juvenile Detention
Po Box 4926
Pocatello, ID 83205

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pocatello Juvenile Detention",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.44227600,42.87031174),"
Pocatello Montessori
320 North 8th Avenue
Pocatello, ID 83201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pocatello Montessori",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.45381927,42.86315536),"
Pocatello Senior High School
325 North Arthur Avenue
Pocatello, ID 83204

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pocatello Senior High School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.42251587,42.90965271),"
Pocatello Teen Parenting Prog. High School
109 Von Elm Lane
Pocatello, ID 83201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pocatello Teen Parenting Prog. High School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.47451782,42.87293625),"
Roosevelt Center-preschool Elementary School
330 Oakwood Drive
Pocatello, ID 83201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Center-preschool Elementary School",'Pocatello=' + Pocatello.length); Chubbuck[Chubbuck.length] = createMarker(new GPoint(-112.45641327,42.93416595),"
Rulon M Ellis Elementary School
11888 North Whitaker Road
Chubbuck, ID 83202

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rulon M Ellis Elementary School",'Chubbuck=' + Chubbuck.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.44781494,42.90073776),"
Syringa Elementary School
388 East Griffith Road
Pocatello, ID 83201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Syringa Elementary School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.44115448,42.89126205),"
Tendoy Elementary School
957 East Alameda Road
Pocatello, ID 83201

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tendoy Elementary School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.47132111,42.94936371),"
Tyhee Elementary School
12743 West Tyhee Road
Pocatello, ID 83202

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tyhee Elementary School",'Pocatello=' + Pocatello.length); Pocatello[Pocatello.length] = createMarker(new GPoint(-112.43708801,42.86885452),"
Washington Elementary School
226 South 10th Avenue
Pocatello, ID 83201

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