function addMarkers() { mySelect = document.getElementById('selection'); Grand_Junction = [];Clifton = [];De_Beque = [];Fruita = [];Gateway = [];Collbran = [];Loma = [];Palisade = [];mySelect.options[mySelect.options.length] = new Option("Clifton schools",'all=Clifton'); mySelect.options[mySelect.options.length] = new Option("Collbran schools",'all=Collbran'); mySelect.options[mySelect.options.length] = new Option("De Beque schools",'all=De_Beque'); mySelect.options[mySelect.options.length] = new Option("Fruita schools",'all=Fruita'); mySelect.options[mySelect.options.length] = new Option("Gateway schools",'all=Gateway'); mySelect.options[mySelect.options.length] = new Option("Grand Junction schools",'all=Grand_Junction'); mySelect.options[mySelect.options.length] = new Option("Loma schools",'all=Loma'); mySelect.options[mySelect.options.length] = new Option("Palisade schools",'all=Palisade'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.61607361,39.12070084),"
Appleton Elementary School
2358 H Road
Grand Junction, CO 81505

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Appleton Elementary School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.50854492,39.08448029),"
Bookcliff Middle School
2935 Orchard Ave
Grand Junction, CO 81504

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bookcliff Middle School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.63294983,39.07707977),"
Broadway Elementary School
2248 Broadway
Grand Junction, CO 81503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Broadway Elementary School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.47276306,39.04133606),"
Central High School
550 Warrior Way
Grand Junction, CO 81504

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central High School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.55022430,39.06441879),"
Chatfield Elementary School
3188 D12 Road
Grand Junction, CO 81504

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chatfield Elementary School",'Grand_Junction=' + Grand_Junction.length); Clifton[Clifton.length] = createMarker(new GPoint(-108.44552612,39.09178162),"
Clifton Elementary School
3276 F Road
Clifton, CO 81520

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Clifton Elementary School",'Clifton=' + Clifton.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.55774689,39.07257462),"
Columbine Elementary School
624 N 9th St
Grand Junction, CO 81501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Columbine Elementary School",'Grand_Junction=' + Grand_Junction.length); De_Beque[De_Beque.length] = createMarker(new GPoint(-108.55370331,39.44480133),"
De Beque Elementary School
P O Box 70
De Beque, CO 81630

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("De Beque Elementary School",'De_Beque=' + De_Beque.length); De_Beque[De_Beque.length] = createMarker(new GPoint(-108.55370331,39.44480133),"
De Beque Undivided High School
P O Box 70
De Beque, CO 81630

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("De Beque Undivided High School",'De_Beque=' + De_Beque.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.52880096,39.04191971),"
Deep River School
2813 Patterson Road
Grand Junction, CO 81501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Deep River School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.55715179,39.04117966),"
Dos Rios Elementary School
265 Linden Ave
Grand Junction, CO 81503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dos Rios Elementary School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.55439600,39.04841600),"
Dual Immersion Academy School
2660 Unaweep Avenue
Grand Junction, CO 81503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dual Immersion Academy School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.55892944,39.07348251),"
East Middle School
830 Gunnison Ave
Grand Junction, CO 81501

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("East Middle School",'Grand_Junction=' + Grand_Junction.length); Fruita[Fruita.length] = createMarker(new GPoint(-108.72881317,39.16118622),"
Fruita Middle School
239 N Maple
Fruita, CO 81521

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Fruita Middle School",'Fruita=' + Fruita.length); Fruita[Fruita.length] = createMarker(new GPoint(-108.68679810,39.14960098),"
Fruita Monument High School
1815 Wildcat Ave
Fruita, CO 81521

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fruita Monument High School",'Fruita=' + Fruita.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.49655914,39.08948898),"
Fruitvale Elementary School
585 30 Road
Grand Junction, CO 81504

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fruitvale Elementary School",'Grand_Junction=' + Grand_Junction.length); Gateway[Gateway.length] = createMarker(new GPoint(-108.80690002,38.79280090),"
Gateway School
P O Box 240
Gateway, CO 81522

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gateway School",'Gateway=' + Gateway.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.56455231,39.07987976),"
Grand Junction High School
1400 N 5th St
Grand Junction, CO 81501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grand Junction High School",'Grand_Junction=' + Grand_Junction.length); Collbran[Collbran.length] = createMarker(new GPoint(-107.98761749,39.23683929),"
Grand Mesa High School
56600 Highway 330
Collbran, CO 81624

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grand Mesa High School",'Collbran=' + Collbran.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.46884918,39.08909225),"
Grand Mesa Middle School
585 31-12 Road
Grand Junction, CO 81504

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Grand Mesa Middle School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.56598663,39.07448196),"
Hawthorne Building Elementary School
410 Hill Ave
Grand Junction, CO 81501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hawthorne Building Elementary School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.51753998,39.04123688),"
Lincoln Orchard Mesa Elementary School
2888 B12 Road
Grand Junction, CO 81503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Orchard Mesa Elementary School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.54914856,39.07228088),"
Lincoln Park Elementary School
600 N 14th St
Grand Junction, CO 81501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Park Elementary School",'Grand_Junction=' + Grand_Junction.length); Loma[Loma.length] = createMarker(new GPoint(-108.81259918,39.20196152),"
Loma Elementary School
1360 13 Road
Loma, CO 81524

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Loma Elementary School",'Loma=' + Loma.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.50294495,39.03388214),"
Mesa View Elementary School
2967 B Road
Grand Junction, CO 81503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mesa View Elementary School",'Grand_Junction=' + Grand_Junction.length); Clifton[Clifton.length] = createMarker(new GPoint(-108.42714691,39.09366226),"
Mount Garfield Middle School
3475 Front Street
Clifton, CO 81520

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mount Garfield Middle School",'Clifton=' + Clifton.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.55424500,39.04838181),"
New Emerson School At Columbus
2660 Unaweep Ave
Grand Junction, CO 81503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Emerson School At Columbus",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.51997375,39.08293533),"
Nisley Elementary School
543 28-34 Road
Grand Junction, CO 81501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Nisley Elementary School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.54415131,39.08457947),"
Orchard Avenue Elementary School
1800 Orchard Ave
Grand Junction, CO 81501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Orchard Avenue Elementary School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.48769379,39.04850769),"
Orchard Mesa Middle School
2736 C Road
Grand Junction, CO 81503

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Orchard Mesa Middle School",'Grand_Junction=' + Grand_Junction.length); Palisade[Palisade.length] = createMarker(new GPoint(-108.36693573,39.10570145),"
Palisade High School
3679 G Road
Palisade, CO 81526

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Palisade High School",'Palisade=' + Palisade.length); Collbran[Collbran.length] = createMarker(new GPoint(-107.98761749,39.23683929),"
Plateau Valley Elementary School
56600 Highway 330
Collbran, CO 81624

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Plateau Valley Elementary School",'Collbran=' + Collbran.length); Collbran[Collbran.length] = createMarker(new GPoint(-107.98761749,39.23683929),"
Plateau Valley High School
56600 Highway 330
Collbran, CO 81624

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Plateau Valley High School",'Collbran=' + Collbran.length); Collbran[Collbran.length] = createMarker(new GPoint(-107.98761749,39.23683929),"
Plateau Valley Middle School
56600 Highway 330
Collbran, CO 81624

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Plateau Valley Middle School",'Collbran=' + Collbran.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.55022430,39.06441879),"
Pomona Elementary School
588 25-12 Road
Grand Junction, CO 81505

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pomona Elementary School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.56114960,39.06939316),"
R-5 High School
310 N 7th St
Grand Junction, CO 81501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("R-5 High School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.64485168,39.07258224),"
Redlands Middle School
2200 Broadway
Grand Junction, CO 81503

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Redlands Middle School",'Grand_Junction=' + Grand_Junction.length); Clifton[Clifton.length] = createMarker(new GPoint(-108.44808960,39.09032059),"
Rocky Mountain Elementary School
3260 D12 Road
Clifton, CO 81520

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rocky Mountain Elementary School",'Clifton=' + Clifton.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.60986328,39.07147980),"
Scenic Elementary School
451 West Scenic Dr
Grand Junction, CO 81503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Scenic Elementary School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.56114960,39.06939316),"
School Without Walls
310 N 7th St
Grand Junction, CO 81501

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("School Without Walls",'Grand_Junction=' + Grand_Junction.length); Fruita[Fruita.length] = createMarker(new GPoint(-108.73342133,39.16316605),"
Shelledy Elementary School
353 North Mesa
Fruita, CO 81521

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shelledy Elementary School",'Fruita=' + Fruita.length); Palisade[Palisade.length] = createMarker(new GPoint(-108.35263824,39.10205841),"
Taylor Elementary School
689 Brentwood Dr
Palisade, CO 81526

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Taylor Elementary School",'Palisade=' + Palisade.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.55022430,39.06441879),"
Thunder Mountain Elementary School
3063 F12 Road
Grand Junction, CO 81504

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thunder Mountain Elementary School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.56114960,39.08699799),"
Tope Elementary School
2220 N 7th St
Grand Junction, CO 81501

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tope Elementary School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.60520172,39.11249924),"
Valley School
2508 Blichmann Ave
Grand Junction, CO 81505

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valley School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.57117462,39.08457947),"
West Middle School
123 W Orchard Ave
Grand Junction, CO 81505

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("West Middle School",'Grand_Junction=' + Grand_Junction.length); Grand_Junction[Grand_Junction.length] = createMarker(new GPoint(-108.63851929,39.04893875),"
Wingate Elementary School
351 South Camp Road
Grand Junction, CO 81503

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wingate Elementary School",'Grand_Junction=' + Grand_Junction.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(Clifton); map.removeOverlays(Collbran); map.removeOverlays(De_Beque); map.removeOverlays(Fruita); map.removeOverlays(Gateway); map.removeOverlays(Grand_Junction); map.removeOverlays(Loma); map.removeOverlays(Palisade); 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(Grand_Junction);map.removeOverlays(Clifton); map.removeOverlays(Collbran); map.removeOverlays(De_Beque); map.removeOverlays(Fruita); map.removeOverlays(Gateway); map.removeOverlays(Grand_Junction); map.removeOverlays(Loma); map.removeOverlays(Palisade); map.addOverlays(Clifton); centerByArray(Clifton, false, false); cntMarker += Clifton.length; map.addOverlays(Collbran); centerByArray(Collbran, false, false); cntMarker += Collbran.length; map.addOverlays(De_Beque); centerByArray(De_Beque, false, false); cntMarker += De_Beque.length; map.addOverlays(Fruita); centerByArray(Fruita, false, false); cntMarker += Fruita.length; map.addOverlays(Gateway); centerByArray(Gateway, false, false); cntMarker += Gateway.length; map.addOverlays(Grand_Junction); centerByArray(Grand_Junction, false, false); cntMarker += Grand_Junction.length; map.addOverlays(Loma); centerByArray(Loma, false, false); cntMarker += Loma.length; map.addOverlays(Palisade); centerByArray(Palisade, false, false); cntMarker += Palisade.length; centerByArray(Grand_Junction,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'); } }