function addMarkers(){ mySelect = document.getElementById('selection'); Denver = [];Aurora = [];mySelect.options[mySelect.options.length] = new Option("Aurora schools",'all=Aurora'); mySelect.options[mySelect.options.length] = new Option("Denver schools",'all=Denver'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Denver[Denver.length] = createMarker(new GPoint(-105.05227800,39.73836300),"
Beth Jacob High School
5100 W 14th Avenue
Denver, CO 80204
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Beth Jacob High School",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.89490000,39.72210000),"
Bishop Machebeuf Catholic High School
458 Uinta Way
Denver, CO 80230
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bishop Machebeuf Catholic High School",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.84398600,39.79263500),"
C.h.a.n.g.e. Christian Academy
12505 Elmendorf Place
Denver, CO 80239
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("C.h.a.n.g.e. Christian Academy",'Denver=' + Denver.length); Aurora[Aurora.length] = createMarker(new GPoint(-104.81264900,39.70870900),"
Cedar Wood Christian Academy
Po Box 111389
Aurora, CO 80042
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cedar Wood Christian Academy",'Aurora=' + Aurora.length); Denver[Denver.length] = createMarker(new GPoint(-104.95892900,39.71285600),"
Colorado Christian School
200 S University Blvd
Denver, CO 80209
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Colorado Christian School",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.98123100,39.73120100),"
Colorado Outward Bound School
945 Pennsylvania St
Denver, CO 80203
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Colorado Outward Bound School",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.92959400,39.67468100),"
Denver Academy
4400 E Iliff Avenue
Denver, CO 80222
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Denver Academy",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.98062700,39.67810600),"
Denver Christian High School
2135 S Pearl Street
Denver, CO 80210
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Denver Christian High School",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-105.02807300,39.69503700),"
Denver Lutheran High School
3201 W Arizona Avenue
Denver, CO 80219
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Denver Lutheran High School",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.95274400,39.73119100),"
The Denver Waldorf School
940 Fillmore St
Denver, CO 80206
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Denver Waldorf School",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.93596000,39.71645600),"
Graland Country Day School
30 Birch St
Denver, CO 80220
Co-ed school, K-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Graland Country Day School",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.99622100,39.73077300),"
La Academia At The Denver Inner City Parish
910 Galapago Street
Denver, CO 80204
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("La Academia At The Denver Inner City Parish",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.84075400,39.78232900),"
Love Christian Fellowship Ed
4651 Tulsa Court
Denver, CO 80239
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Love Christian Fellowship Ed",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-105.02865400,39.77674700),"
Messiah Baptist School
3241 W 44th Avenue
Denver, CO 80211
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Messiah Baptist School",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.97904900,39.66783700),"
Mile High Academy
711 E Yale Avenue
Denver, CO 80210
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mile High Academy",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-105.03478800,39.65051700),"
Mullen High School
3601 S Lowell Blvd
Denver, CO 80236
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mullen High School",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.91670000,39.73390000),"
Our Lady Help Of Christians Academy
Po Box 201568
Denver, CO 80220
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Help Of Christians Academy",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-105.05921300,39.77363100),"
Our Lady Of The Rosary Academy
4165 Eaton
Denver, CO 80212
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of The Rosary Academy",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.96044000,39.67998600),"
Ricks Center for Gifted Children
2040 South York Street
Denver, CO 80208
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ricks Center for Gifted Children",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.96021800,39.67825400),"
University Of Denver High School
2306 E. Evans Avenue
Denver, CO 80208
Co-ed school, 10-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("University Of Denver High School",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-104.89054500,39.70993200),"
Woodside Baptist School
8500 E Alameda Avenue
Denver, CO 80247
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodside Baptist School",'Denver=' + Denver.length); Denver[Denver.length] = createMarker(new GPoint(-105.04297700,39.74173200),"
Yeshiva Toras Chaim High School
1555 Stuart Street
Denver, CO 80204
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Yeshiva Toras Chaim High School",'Denver=' + Denver.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,11); /* 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/////2/' + showArray); map.removeOverlays(Aurora); map.removeOverlays(Denver); 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(Denver);map.removeOverlays(Aurora); map.removeOverlays(Denver); map.addOverlays(Aurora); centerByArray(Aurora, false, false); cntMarker += Aurora.length; map.addOverlays(Denver); centerByArray(Denver, false, false); cntMarker += Denver.length; centerByArray(Denver,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'); //window.open('/map.php?type=1&schools=&school_level=2&radius=&zipcode=&school_type_search=&school_type_code='); } } function createMarker(point, label, icon) { var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }