function addMarkers() { mySelect = document.getElementById('selection'); Grand_Junction = [];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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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(Grand_Junction); 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(Grand_Junction); map.addOverlays(Grand_Junction); centerByArray(Grand_Junction, false, false); cntMarker += Grand_Junction.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'); } }