function addMarkers() { mySelect = document.getElementById('selection'); Parker = [];Parker[Parker.length] = createMarker(new GPoint(-104.79256439,39.54591370),"
Challenge To Excellence Charter School
16995 East Carlson Drive
Parker, CO 80134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Challenge To Excellence Charter School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.80750275,39.53899384),"
Chaparral High School
15655 Brookstone Drive
Parker, CO 80134

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chaparral High School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.78664700,39.52513300),"
Cherokee Trail Elementary School
17302 Clarke Farms Drive
Parker, CO 80134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cherokee Trail Elementary School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.75586700,39.53542328),"
Core Knowledge Charter School
1161 Pine Drive
Parker, CO 80138

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Core Knowledge Charter School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.77082062,39.52215195),"
Daniel C Oakes High School
11722 Dransfelt Road
Parker, CO 80134

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Daniel C Oakes High School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.71534729,39.50170135),"
Frontier Valley Elementary School
23919 East Canterberry Trail
Parker, CO 80138

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Frontier Valley Elementary School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.75708771,39.50431061),"
Iron Horse Elementary School
20151 Tallman Drive
Parker, CO 80138

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Iron Horse Elementary School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.78459930,39.56019974),"
Legacy Point Elementary School
12736 South Red Rosa Circle
Parker, CO 80134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Legacy Point Elementary School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.72796631,39.45489883),"
Mountain View Elementary School
8502 East Pinery Parkway
Parker, CO 80134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mountain View Elementary School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.75883484,39.46315002),"
Northeast Elementary School
6598 North State Highway 83
Parker, CO 80134

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Northeast Elementary School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.80696869,39.52658463),"
Pine Grove Elementary School
10450 Stonegate Parkway
Parker, CO 80134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pine Grove Elementary School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.76572418,39.54408264),"
Pine Lane Intermediate School
6485 E Ponderosa Drive
Parker, CO 80138

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pine Lane Intermediate School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.76828766,39.54105377),"
Pine Lane Primary School
6475 East Ponderosa Drive
Parker, CO 80138

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pine Lane Primary School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.73761749,39.51268768),"
Pioneer Elementary School
10881 Riva Ridge Street
Parker, CO 80138

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pioneer Elementary School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.75813293,39.43453979),"
Ponderosa High School
7007 East Bayou Gulch Road
Parker, CO 80134

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ponderosa High School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.79777527,39.51038742),"
Prairie Crossing Elementary School
11605 South Bradbury Ranch Dri
Parker, CO 80134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Prairie Crossing Elementary School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.80348969,39.52904129),"
Renaissance Charter School
16700 Keystone Boulevard
Parker, CO 80134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Renaissance Charter School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.79684448,39.53719711),"
Renaissance Expedition Learn Outward Bound School
16700 Keystone Boulevard
Parker, CO 80134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Renaissance Expedition Learn Outward Bound School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.73977200,39.43159200),"
Sagewood Middle School
4725 Fox Sparrow Road
Parker, CO 80134

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sagewood Middle School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.76324463,39.54409027),"
Sierra Middle School
6651 Pine Lane Avenue
Parker, CO 80138

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Sierra Middle School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.65129089,39.46530533),"
Singing Hills Elementary School
41012 Madrid Drive
Parker, CO 80134

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Singing Hills Elementary School",'Parker=' + Parker.length); Parker[Parker.length] = createMarker(new GPoint(-104.65129089,39.46530533),"
Singing Hills Preschool
41012 Madrid Drive
Parker, CO 80134

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