function addMarkers() { mySelect = document.getElementById('selection'); Apple_Valley = [];Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.21757900,44.74275000),"
917 Mcquire Jr High School
6950 W. 146th St. 114
Apple Valley, MN 55124

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("917 Mcquire Jr High School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.03949738,44.84349823),"
917 Pine Bend Elementary School
6950 W. 146th St. 114
Apple Valley, MN 55124

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("917 Pine Bend Elementary School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.23280334,44.73941803),"
Apple Valley Senior High School
14450 Hayes Road
Apple Valley, MN 55124

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Apple Valley Senior High School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.21939850,44.72637177),"
Cedar Park Elementary School
7500 Whitney Drive
Apple Valley, MN 55124

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cedar Park Elementary School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.15761566,44.74082184),"
Dakota Ridge School
4629 144th Street W
Apple Valley, MN 55124

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dakota Ridge School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.15631866,44.74003601),"
Diamond Path Elementary School
14455 Diamond Path
Apple Valley, MN 55124

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Diamond Path Elementary School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.18431854,44.73276520),"
Early Childhood Learning Center
5800 149th Street W
Apple Valley, MN 55124

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Early Childhood Learning Center",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.19136047,44.74636459),"
Eastview Senior High School
6200 140th Street W
Apple Valley, MN 55124

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eastview Senior High School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.18669891,44.76266861),"
Falcon Ridge Middle School
12900 Johnny Cake Ridge Road
Apple Valley, MN 55124

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Falcon Ridge Middle School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.20745087,44.75528717),"
Greenleaf Elementary School
13333 Galaxie Avenue
Apple Valley, MN 55124

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greenleaf Elementary School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.17709351,44.74636459),"
Highland Elementary School
14001 Pilot Knob Road
Apple Valley, MN 55124

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Highland Elementary School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.20369720,44.74440002),"
Idea/apple Valley Campus High School
6950 W. 146th St. 114
Apple Valley, MN 55124

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Idea/apple Valley Campus High School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.21179600,44.73477300),"
Paideia Academy Charter School
7200 W 147th Street
Apple Valley, MN 55124

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Paideia Academy Charter School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.21398163,44.73270416),"
Rosemount Alc High School
Suite 301 15025 Glazier Avenu
Apple Valley, MN 55124

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rosemount Alc High School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.21757900,44.74275000),"
Rosemount Area Learning Cntr.
15025 Glazier Avenue Ste 301
Apple Valley, MN 55124

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rosemount Area Learning Cntr.",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.20359802,44.74449921),"
School Of Environmental Studies
12155 Johnny Cake Ridge Road
Apple Valley, MN 55124

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("School Of Environmental Studies",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.17709351,44.74475861),"
Scott Highlands Middle School
14011 Pilot Knob Road
Apple Valley, MN 55124

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Scott Highlands Middle School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.24022675,44.72527695),"
Southview Elementary School
1025 Whitney Drive
Apple Valley, MN 55124

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southview Elementary School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.21398163,44.73270416),"
Transition Plus High School
Suite 220 15025 Glazier Avenu
Apple Valley, MN 55124

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Transition Plus High School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.23839569,44.72698975),"
Valley Middle School
900 Garden View Drive
Apple Valley, MN 55124

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Valley Middle School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.23861694,44.73873520),"
Westview Elementary School
225 Garden View Drive
Apple Valley, MN 55124

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westview Elementary School",'Apple_Valley=' + Apple_Valley.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-93.20887756,44.81993866),"
Youth Transition Program (ytp)
6950 W. 146th St. 114
Apple Valley, MN 55124

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Youth Transition Program (ytp)",'Apple_Valley=' + Apple_Valley.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(Apple_Valley); 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(Apple_Valley);map.removeOverlays(Apple_Valley); map.addOverlays(Apple_Valley); centerByArray(Apple_Valley, false, false); cntMarker += Apple_Valley.length; centerByArray(Apple_Valley,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'); } }