function addMarkers() { mySelect = document.getElementById('selection'); Fairbanks = [];Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.71749878,64.84190369),"
Alternative Learning Systems
520 5th Avenue
Fairbanks, AK 99701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alternative Learning Systems",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.74244690,64.85807037),"
Anne Wien Elementary School
1501 Hampstead Avenue
Fairbanks, AK 99709

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Anne Wien Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.71749878,64.84190369),"
Badger Road Elementary School
520 Fifth Avenue
Fairbanks, AK 99701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Badger Road Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.72663879,64.83905792),"
Barnette Elementary School
1000 Barnette Street
Fairbanks, AK 99701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Barnette Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.75025940,64.81832886),"
Chinook Charter School
3002 International Street
Fairbanks, AK 99701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chinook Charter School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.74690247,64.83996582),"
Denali Elementary School
1042 Lathrop St.
Fairbanks, AK 99701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Denali Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.76170349,64.83448792),"
Fairbanks Youth Facility
1502 Wilbur Street
Fairbanks, AK 99701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fairbanks Youth Facility",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.71749878,64.84190369),"
Guided Independent Study
520 Fifth Avenue
Fairbanks, AK 99701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Guided Independent Study",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.91566467,64.91491699),"
Howard Luke Academy
601 Loftus Road
Fairbanks, AK 99709

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Howard Luke Academy",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.72821045,64.83260345),"
Hunter Elementary School
1630 Gillam Way
Fairbanks, AK 99701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hunter Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.91566467,64.91491699),"
Hutchison Career Center
3750 Geist Road
Fairbanks, AK 99709

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hutchison Career Center",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-154.66740417,65.75450134),"
Interior Distance Education Of Ak (idea)
2157 Vanhorn Rd
Fairbanks, AK 99701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Interior Distance Education Of Ak (idea)",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.72401428,64.85973358),"
Joy Elementary School
24 Margaret St.
Fairbanks, AK 99701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Joy Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.66874695,64.84741211),"
Ladd Elementary School
601 F Street
Fairbanks, AK 99701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ladd Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.72364807,64.83640289),"
Lathrop High School
901 Airport Way
Fairbanks, AK 99701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lathrop High School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.71749878,64.84190369),"
New Beginnings Charter School
520 Fifth Avenue
Fairbanks, AK 99701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Beginnings Charter School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.69299316,64.84572601),"
Nordale Elementary School
397 Hamilton Ave
Fairbanks, AK 99701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Nordale Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.81309509,64.88983154),"
Pearl Creek Elementary School
700 Auburn Drive
Fairbanks, AK 99709

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pearl Creek Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.74449158,64.85532379),"
Randy Smith Middle School
1401 Bainbridge
Fairbanks, AK 99709

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Randy Smith Middle School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.91566467,64.91491699),"
Raven Correspondence School
4762 Old Airport Way
Fairbanks, AK 99709

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Raven Correspondence School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.72488403,64.83677673),"
Ryan Middle School
951 Airport Way
Fairbanks, AK 99701

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ryan Middle School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.71749878,64.84190369),"
Salcha Elementary School
520 Fifth Avenue
Fairbanks, AK 99701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Salcha Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.66703796,64.84476471),"
Tanana Middle School
600 Trainor Gate Road
Fairbanks, AK 99701

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Tanana Middle School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.71749878,64.84190369),"
Ticasuk Brown Elementary School
520 Fifth Avenue
Fairbanks, AK 99701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ticasuk Brown Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.71749878,64.84190369),"
Two Rivers Elementary School
520 Fifth Avenue
Fairbanks, AK 99701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Two Rivers Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.84390259,64.84603882),"
University Park Elementary School
554 Loftus Rd.
Fairbanks, AK 99709

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("University Park Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.71749878,64.84190369),"
Weller Elementary School
520 Fifth Avenue
Fairbanks, AK 99701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Weller Elementary School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.81668091,64.84901428),"
West Valley High School
3800 Geist Road
Fairbanks, AK 99709

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Valley High School",'Fairbanks=' + Fairbanks.length); Fairbanks[Fairbanks.length] = createMarker(new GPoint(-147.87051392,64.83876801),"
Woodriver Elementary School
5000 Palo Verde Dr.
Fairbanks, AK 99709

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