function addMarkers(){ mySelect = document.getElementById('selection'); Thornton = [];Westminster = [];Commerce_City = [];Denver = [];Aurora = [];Brighton = [];Northglenn = [];Eastlake = [];mySelect.options[mySelect.options.length] = new Option("Aurora schools",'all=Aurora'); mySelect.options[mySelect.options.length] = new Option("Brighton schools",'all=Brighton'); mySelect.options[mySelect.options.length] = new Option("Commerce City schools",'all=Commerce_City'); mySelect.options[mySelect.options.length] = new Option("Denver schools",'all=Denver'); mySelect.options[mySelect.options.length] = new Option("Eastlake schools",'all=Eastlake'); mySelect.options[mySelect.options.length] = new Option("Northglenn schools",'all=Northglenn'); mySelect.options[mySelect.options.length] = new Option("Thornton schools",'all=Thornton'); mySelect.options[mySelect.options.length] = new Option("Westminster schools",'all=Westminster'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Thornton[Thornton.length] = createMarker(new GPoint(-104.96167400,39.86219500),"
A Child's Touch
9141 Poze Blvd
Thornton, CO 80229
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("A Child's Touch",'Thornton=' + Thornton.length); Westminster[Westminster.length] = createMarker(new GPoint(-105.05034900,39.86161200),"
A Child's Victory
9050 Yates Str.
Westminster, CO 80030
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("A Child's Victory",'Westminster=' + Westminster.length); Westminster[Westminster.length] = createMarker(new GPoint(-105.05258500,39.90126900),"
The Academy Child Development Center-westminster
5170 W 113th Avenue
Westminster, CO 80031
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Academy Child Development Center-westminster",'Westminster=' + Westminster.length); Commerce_City[Commerce_City.length] = createMarker(new GPoint(-104.93287800,39.82272300),"
Adams City Baptist Church & School
6951 Dexter St.
Commerce City, CO 80022
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Adams City Baptist Church & School",'Commerce_City=' + Commerce_City.length); Denver[Denver.length] = createMarker(new GPoint(-104.95755500,39.83824000),"
Assumption Catholic School
2341 E 78th Avenue
Denver, CO 80229
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Assumption Catholic School",'Denver=' + Denver.length); Aurora[Aurora.length] = createMarker(new GPoint(-104.80925600,39.74028800),"
Auroras Children
15355 E Colfax Avenue
Aurora, CO 80011
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Auroras Children",'Aurora=' + Aurora.length); Westminster[Westminster.length] = createMarker(new GPoint(-105.03270100,39.84685500),"
Belleview Christian School
3455 W 83rd Ave
Westminster, CO 80031
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Belleview Christian School",'Westminster=' + Westminster.length); Brighton[Brighton.length] = createMarker(new GPoint(-104.81657000,39.97400600),"
Brighton Adventist Academy
820 South 5th Ave
Brighton, CO 80601
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brighton Adventist Academy",'Brighton=' + Brighton.length); Brighton[Brighton.length] = createMarker(new GPoint(-104.81967800,39.98352300),"
Brighton Montessori School
203 South 3rd Avenue
Brighton, CO 80601
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Brighton Montessori School",'Brighton=' + Brighton.length); Denver[Denver.length] = createMarker(new GPoint(-105.00592000,39.84153700),"
Childrens Outreach Project
8000 Pecos Street
Denver, CO 80221
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Childrens Outreach Project",'Denver=' + Denver.length); Thornton[Thornton.length] = createMarker(new GPoint(-104.98093500,39.91819400),"
Childrens World
12290 Pennsylvania Street
Thornton, CO 80241
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Childrens World",'Thornton=' + Thornton.length); Northglenn[Northglenn.length] = createMarker(new GPoint(-104.96782000,39.91322200),"
Community Christian
11980 Irma Drive
Northglenn, CO 80233
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Community Christian",'Northglenn=' + Northglenn.length); Westminster[Westminster.length] = createMarker(new GPoint(-105.01536100,39.91426800),"
Cornerstone Christian Academy
12000 Zuni Street
Westminster, CO 80234
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone Christian Academy",'Westminster=' + Westminster.length); Eastlake[Eastlake.length] = createMarker(new GPoint(-104.96127400,39.92460500),"
Eastlake Montessori School
PO Box 222
Eastlake, CO 80614
Co-ed school, PK-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eastlake Montessori School",'Eastlake=' + Eastlake.length); Brighton[Brighton.length] = createMarker(new GPoint(-104.83479300,39.95763400),"
Elmwood Baptist Academy
13100 East 144th Avenue
Brighton, CO 80601
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Elmwood Baptist Academy",'Brighton=' + Brighton.length); Northglenn[Northglenn.length] = createMarker(new GPoint(-104.97797800,39.89001800),"
Gethsemane Lutheran School
10675 Washington Street
Northglenn, CO 80233
school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gethsemane Lutheran School",'Northglenn=' + Northglenn.length); Denver[Denver.length] = createMarker(new GPoint(-105.00760000,39.81720000),"
Guardian Angels
1843 West 52nd Avenue
Denver, CO 80221
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Guardian Angels",'Denver=' + Denver.length); Westminster[Westminster.length] = createMarker(new GPoint(-105.02623200,39.83437600),"
Holy Trinity Catholic School
3050 W 76th Avenue
Westminster, CO 80030
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Trinity Catholic School",'Westminster=' + Westminster.length); Thornton[Thornton.length] = createMarker(new GPoint(-104.93815600,39.92824500),"
Kindercare Learning Center
4200 E 128th Avenue
Thornton, CO 80241
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kindercare Learning Center",'Thornton=' + Thornton.length); Northglenn[Northglenn.length] = createMarker(new GPoint(-104.99490100,39.90341900),"
Kindercare Learning Center
701 W 114th Avenue
Northglenn, CO 80234
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kindercare Learning Center",'Northglenn=' + Northglenn.length); Westminster[Westminster.length] = createMarker(new GPoint(-105.05271300,39.90537200),"
Life Christian Academy
11500 Sheridan Blvd
Westminster, CO 80020
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Life Christian Academy",'Westminster=' + Westminster.length); Thornton[Thornton.length] = createMarker(new GPoint(-104.93328400,39.92826300),"
Little Village Christian Child Care Center
4550 E 128th Avenue
Thornton, CO 80241
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Village Christian Child Care Center",'Thornton=' + Thornton.length); Northglenn[Northglenn.length] = createMarker(new GPoint(-104.96876000,39.90831700),"
Lord Of Life Lutheran School
11700 Irma Drive
Northglenn, CO 80233
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lord Of Life Lutheran School",'Northglenn=' + Northglenn.length); Westminster[Westminster.length] = createMarker(new GPoint(-105.03332100,39.88531500),"
Noahs Ark Learning Center
3501 W 104th Avenue
Westminster, CO 80031
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Noahs Ark Learning Center",'Westminster=' + Westminster.length); Northglenn[Northglenn.length] = createMarker(new GPoint(-104.97751900,39.90685300),"
Northside Christian Daycare
11550 Washington Street
Northglenn, CO 80233
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northside Christian Daycare",'Northglenn=' + Northglenn.length); Westminster[Westminster.length] = createMarker(new GPoint(-105.02373200,39.90067300),"
Seven Oaks Academy At The Ranch Reserve
11305 Decatur Street
Westminster, CO 80234
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Seven Oaks Academy At The Ranch Reserve",'Westminster=' + Westminster.length); Northglenn[Northglenn.length] = createMarker(new GPoint(-104.99344100,39.89018700),"
Step By Step Child Development Center
10689 Melody Drive
Northglenn, CO 80234
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Step By Step Child Development Center",'Northglenn=' + Northglenn.length); Brighton[Brighton.length] = createMarker(new GPoint(-104.80442000,39.98196300),"
Zion Lutheran School
1400 Skeel Street
Brighton, CO 80601
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zion Lutheran School",'Brighton=' + Brighton.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/////1/' + showArray); map.removeOverlays(Aurora); map.removeOverlays(Brighton); map.removeOverlays(Commerce_City); map.removeOverlays(Denver); map.removeOverlays(Eastlake); map.removeOverlays(Northglenn); map.removeOverlays(Thornton); map.removeOverlays(Westminster); 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(Thornton);map.removeOverlays(Aurora); map.removeOverlays(Brighton); map.removeOverlays(Commerce_City); map.removeOverlays(Denver); map.removeOverlays(Eastlake); map.removeOverlays(Northglenn); map.removeOverlays(Thornton); map.removeOverlays(Westminster); map.addOverlays(Aurora); centerByArray(Aurora, false, false); cntMarker += Aurora.length; map.addOverlays(Brighton); centerByArray(Brighton, false, false); cntMarker += Brighton.length; map.addOverlays(Commerce_City); centerByArray(Commerce_City, false, false); cntMarker += Commerce_City.length; map.addOverlays(Denver); centerByArray(Denver, false, false); cntMarker += Denver.length; map.addOverlays(Eastlake); centerByArray(Eastlake, false, false); cntMarker += Eastlake.length; map.addOverlays(Northglenn); centerByArray(Northglenn, false, false); cntMarker += Northglenn.length; map.addOverlays(Thornton); centerByArray(Thornton, false, false); cntMarker += Thornton.length; map.addOverlays(Westminster); centerByArray(Westminster, false, false); cntMarker += Westminster.length; centerByArray(Thornton,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=1&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; }