function addMarkers() { mySelect = document.getElementById('selection'); Highlands_Ranch = [];Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.93331146,39.52802658),"
Arrowwood Elementary School
10345 Arrowwood Drive
Highlands Ranch, CO 80130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arrowwood Elementary School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.98714447,39.54070282),"
Bear Canyon Elementary School
9660 Salford Lane
Highlands Ranch, CO 80126

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bear Canyon Elementary School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.94692700,39.51824400),"
Copper Mesa Elementary School
3501 Poston Parkway
Highlands Ranch, CO 80126

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Copper Mesa Elementary School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.95103455,39.55529785),"
Cougar Run Elementary School
8780 Venneford Ranch Road
Highlands Ranch, CO 80126

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cougar Run Elementary School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-105.02275085,39.52761459),"
Coyote Creek Elementary School
2861 Baneberry Court
Highlands Ranch, CO 80129

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Coyote Creek Elementary School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.92893219,39.55271912),"
Cresthill Middle School
9195 Cresthill Lane
Highlands Ranch, CO 80130

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Cresthill Middle School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.92887878,39.54772949),"
Eagle Academy
9375 Cresthill Lane
Highlands Ranch, CO 80130

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eagle Academy",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.99402618,39.54199219),"
Eldorado Elementary School
1305 Timbervale Trail
Highlands Ranch, CO 80126

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eldorado Elementary School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.91028595,39.54666519),"
Fox Creek Elementary School
6585 Collegiate Drive
Highlands Ranch, CO 80130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fox Creek Elementary School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.95049286,39.53150177),"
Heritage Elementary School
3350 Summit View Parkway
Highlands Ranch, CO 80126

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Heritage Elementary School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.92887878,39.54772949),"
Highlands Ranch High School
9375 Cresthill Lane
Highlands Ranch, CO 80130

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Highlands Ranch High School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.96378326,39.52312469),"
Mountain Ridge Middle School
10590 Mountain Vista Ridge
Highlands Ranch, CO 80126

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mountain Ridge Middle School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.96414948,39.52317429),"
Mountain Vista High School
10585 Mountain Vista Ridge
Highlands Ranch, CO 80126

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mountain Vista High School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.98352051,39.55095291),"
Northridge Elementary School
555 South Park Road
Highlands Ranch, CO 80126

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northridge Elementary School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.94056702,39.55002213),"
Platte River Charter Academy
4085 S. Lark Sparrow St.
Highlands Ranch, CO 80130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Platte River Charter Academy",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-105.00922394,39.53150177),"
Ranch View Middle School
1731 Wildcat Reserve Parkway
Highlands Ranch, CO 80129

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ranch View Middle School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.91980200,39.53499900),"
Redstone Elementary School
9970 Glenstone Circle
Highlands Ranch, CO 80130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Redstone Elementary School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.99564362,39.53122330),"
Saddle Ranch Elementary School
805 West English Sparrow Trail
Highlands Ranch, CO 80129

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Saddle Ranch Elementary School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.96462250,39.56111908),"
Sand Creek Elementary School
8898 South Maplewood Drive
Highlands Ranch, CO 80126

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sand Creek Elementary School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-104.96273804,39.53251266),"
Summit View Elementary School
10200 South Piedmont Drive
Highlands Ranch, CO 80126

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Summit View Elementary School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-105.01390839,39.53445816),"
Thunderridge High School
1991 Wildcat Reserve Parkway
Highlands Ranch, CO 80129

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Thunderridge High School",'Highlands_Ranch=' + Highlands_Ranch.length); Highlands_Ranch[Highlands_Ranch.length] = createMarker(new GPoint(-105.01950836,39.53876877),"
Trailblazer Elementary School
9760 South Hackberry
Highlands Ranch, CO 80126

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