function addMarkers() { mySelect = document.getElementById('selection'); Albany = [];mySelect.options[mySelect.options.length] = new Option("Albany schools",'all=Albany'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Albany[Albany.length] = createMarker(new GPoint(-84.16798401,31.58313751),"
Albany High School
801 Residence Avenue
Albany, GA 31701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Albany High School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.11296844,31.59276390),"
Albany Middle School
1700 Cordell Avenue
Albany, GA 31705

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Albany Middle School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.17127400,31.55245500),"
Albany Regional Youth Detention Center
2030 Newton Road
Albany, GA 31702

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Albany Regional Youth Detention Center",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.19061279,31.54923630),"
Alice Coachman Elementary School
1425 West Oakridge Drive
Albany, GA 31707

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Alice Coachman Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.38458252,33.49267578),"
Dougherty Comprehensive High School
1800 Pearce Avenue
Albany, GA 31705

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dougherty Comprehensive High School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.15950400,31.57528600),"
Dougherty Emergency Shelter
518 West Olglethorpe Blvd
Albany, GA 31706

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dougherty Emergency Shelter",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.10134125,31.56916237),"
Dougherty Middle School
1800 Massey Drive
Albany, GA 31705

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Dougherty Middle School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.18585968,31.60980034),"
Exceptional Students Program
400 South Madison Street
Albany, GA 31702

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Exceptional Students Program",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.17368317,31.57383728),"
Highland Middle School
1001 Highland Avenue
Albany, GA 31701

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Highland Middle School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.12260437,31.58643723),"
Jackson Heights Elementary School
1305 East Second Street
Albany, GA 31705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jackson Heights Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.20825958,31.59490395),"
Lake Park Elementary School
605 Meadowlark Drive
Albany, GA 31707

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lake Park Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.16412354,31.51359558),"
Lamar Reese Elementary School
1215 Lily Pond Road
Albany, GA 31701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lamar Reese Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.16485596,31.56616211),"
Lincoln Elementary Magnet
700 Corn Avenue
Albany, GA 31701

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln Elementary Magnet",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.19075775,31.58016205),"
Magnolia Elementary School
1700 Samford Drive
Albany, GA 31707

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Magnolia Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.16101074,31.52132225),"
Martin Luther King, Junior Elementary School
3125 Martin Luther King, Jr.
Albany, GA 31707

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Martin Luther King, Junior Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.18995667,31.58760071),"
Merry Acres Middle School
1601 Florence Drive
Albany, GA 31707

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Merry Acres Middle School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.10064697,31.55433655),"
Mock Road Elementary School
2237 Cutts Drive
Albany, GA 31705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mock Road Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.17125702,31.55886269),"
Monroe High School
900 Lippitt Drive
Albany, GA 31701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Monroe High School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.13468170,31.55166245),"
Morningside Elementary School
120 Sunset Boulevard
Albany, GA 31705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Morningside Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.18585968,31.60980034),"
Northside Elementary School
901 14th Avenue
Albany, GA 31707

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northside Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.18585968,31.60980034),"
Oak Tree Psychoeducational Program
601 North Monroe Street
Albany, GA 31701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oak Tree Psychoeducational Program",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.12846375,31.53194237),"
Radium Springs Elementary School
2400 Roxanna Road
Albany, GA 31705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Radium Springs Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.13298035,31.52274895),"
Radium Springs Middle School
2600 Radium Springs Drive
Albany, GA 31705

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Radium Springs Middle School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.25154877,31.56219673),"
Robert A. Cross Middle Magnet
324 Lockett Station Road
Albany, GA 31721

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Robert A. Cross Middle Magnet",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.19963837,31.60743904),"
Sherwood Elementary School
2201 Doncaster Way
Albany, GA 31707

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sherwood Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.18585968,31.60980034),"
South Ga. Regional Achievement Center
1001 Highland Avenue
Albany, GA 31701

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Ga. Regional Achievement Center",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.16608429,31.55877876),"
Southside Middle School
1615 Newton Road
Albany, GA 31701

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Southside Middle School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.11431122,31.59276390),"
Sylvandale Elementary School
1520 Cordell Avenue
Albany, GA 31705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sylvandale Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.08294678,31.57295418),"
Sylvester Road Elementary School
2600 Trenton Lane
Albany, GA 31705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sylvester Road Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.10068512,31.57671165),"
Turner Elementary School
2001 Leonard Avenue
Albany, GA 31705

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Turner Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.20246124,31.56280899),"
West Town Elementary School
1113 University Avenue
Albany, GA 31707

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Town Elementary School",'Albany=' + Albany.length); Albany[Albany.length] = createMarker(new GPoint(-84.21230316,31.59128761),"
Westover High School
2600 Partridge Drive
Albany, GA 31707

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