function addMarkers() { mySelect = document.getElementById('selection'); Littleton = [];Littleton[Littleton.length] = createMarker(new GPoint(-104.89669037,39.55795288),"
Acres Green Elementary School
13524 North Acres Green Drive
Littleton, CO 80124

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Acres Green Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.93613434,39.58478928),"
Ames Elementary School
7300 South Clermont Drive
Littleton, CO 80122

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ames Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.96513367,39.58048630),"
Arapahoe High School
2201 East Dry Creek Road
Littleton, CO 80122

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Arapahoe High School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-105.06060791,39.61659241),"
Centennial Academy Of Fine Arts Education
3306 West Berry Avenue
Littleton, CO 80123

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Centennial Academy Of Fine Arts Education",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.99046326,39.60879517),"
East Elementary School
5933 South Fairfield Street
Littleton, CO 80120

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.99724579,39.59708786),"
Euclid Middle School
777 West Euclid Avenue
Littleton, CO 80120

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Euclid Middle School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.98089600,39.61177063),"
Field Elementary School
5402 South Sherman Way
Littleton, CO 80121

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Field Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.96981049,39.59918976),"
Franklin Elementary School
1603 East Euclid Avenue
Littleton, CO 80121

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Franklin Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-105.06060791,39.61659241),"
Goddard Middle School
3800 West Berry Avenue
Littleton, CO 80123

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Goddard Middle School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-105.00572968,39.58438873),"
Heritage High School
1401 West Geddes Avenue
Littleton, CO 80120

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage High School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.97983551,39.59769058),"
Highland Elementary School
711 East Euclid Avenue
Littleton, CO 80121

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Highland Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-105.01170600,39.51931000),"
Hope Online Learning Academy Co-op
6728 Lakeside Circle
Littleton, CO 80125

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hope Online Learning Academy Co-op",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.98174286,39.58774948),"
Hopkins Elementary School
7171 South Pennsylvania Street
Littleton, CO 80122

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hopkins Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.97803497,39.57298660),"
John Wesley Powell Middle School
8000 South Corona Way
Littleton, CO 80122

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("John Wesley Powell Middle School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-105.00278473,39.57368851),"
Littleton Academy
1200 West Mineral Avenue
Littleton, CO 80120

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Littleton Academy",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.98539734,39.61328506),"
Littleton High School
199 East Littleton Blvd
Littleton, CO 80121

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Littleton High School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-105.02564240,39.62305832),"
Littleton Prep Charter School
5151 South Federal Boulevard S
Littleton, CO 80123

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Littleton Prep Charter School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.93083191,39.60112381),"
Lois Lenski Elementary School
6350 South Fairfax Way
Littleton, CO 80121

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lois Lenski Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-105.00713348,39.60073853),"
Moody Elementary School
6390 South Windermere Street
Littleton, CO 80120

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Moody Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.94133759,39.59498978),"
Newton Middle School
4001 East Arapahoe Road
Littleton, CO 80122

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Newton Middle School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.95249176,39.60424423),"
Peabody Elementary School
3128 East Maplewood Avenue
Littleton, CO 80121

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Peabody Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-105.04100037,39.55077744),"
Plum Creek Academy Day Treatment
8236 Carder Court
Littleton, CO 80125

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Plum Creek Academy Day Treatment",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.89025879,39.52909851),"
Rock Canyon High School
5810 Mac Arthur Ranch Road
Littleton, CO 80124

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rock Canyon High School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.89025879,39.52909851),"
Rocky Heights Middle School
11033 Monarch Boulevard
Littleton, CO 80124

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rocky Heights Middle School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-105.08034515,39.47826385),"
Roxborough Elementary School
8000 Village Circle West
Littleton, CO 80125

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roxborough Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.99790955,39.58493805),"
Runyon Elementary School
7455 South Elati Street
Littleton, CO 80120

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Runyon Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.95533752,39.59118652),"
Sandburg Elementary School
6900 South Elizabeth Street
Littleton, CO 80122

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sandburg Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.96947479,39.59118652),"
Twain Elementary School
6901 South Franklin Street
Littleton, CO 80122

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Twain Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-105.01024628,39.61518860),"
Village At North Elementary School
1907 West Powers Avenue
Littleton, CO 80120

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Village At North Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.99057770,39.59824371),"
Whitman Elementary School
6557 South Acoma Street
Littleton, CO 80120

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Whitman Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-104.91043854,39.52305222),"
Wildcat Mountain Elementary School
6585 Lionshead Parkway
Littleton, CO 80124

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wildcat Mountain Elementary School",'Littleton=' + Littleton.length); Littleton[Littleton.length] = createMarker(new GPoint(-105.04255676,39.60314178),"
Wilder Elementary School
4300 West Ponds Circle
Littleton, CO 80123

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wilder Elementary School",'Littleton=' + Littleton.length); map.removeOverlays(Littleton); setTimeout(function(){map.addOverlays(Littleton)},1000); maxLng = -104.89025879; maxLat = 39.62305832; minLng = -105.08034515; minLat = 39.47826385; 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(Littleton); 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(Littleton);map.removeOverlays(Littleton); map.addOverlays(Littleton); centerByArray(Littleton, false, false); cntMarker += Littleton.length; centerByArray(Littleton,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'); } }