function addMarkers() { mySelect = document.getElementById('selection'); Athens = [];Athens[Athens.length] = createMarker(new GPoint(-83.40913391,33.94534302),"
Alps Road Elementary School
200 Alps Road
Athens, GA 30606

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Alps Road Elementary School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.32731628,33.93497849),"
Alternative Placement Program
440 Dearing Extension
Athens, GA 30606

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alternative Placement Program",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.31968900,33.95463000),"
Athens Regional Youth Detention Center
55 Beaverdam Road Extension
Athens, GA 30608

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Athens Regional Youth Detention Center",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.33643341,33.90169525),"
Barnett Shoals Elementary School
3220 Barnett Shoals Road
Athens, GA 30605

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Barnett Shoals Elementary School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.38152313,33.94090652),"
Barrow Elementary School
100 Pinecrest Drive
Athens, GA 30605

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Barrow Elementary School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.47335815,33.98919296),"
Burney-harris-lyons Middle School
1600 Tallassee Road
Athens, GA 30606

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Burney-harris-lyons Middle School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.32984161,33.92301178),"
Cedar Shoals High School
1300 Cedar Shoals Drive
Athens, GA 30605

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cedar Shoals High School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.39310455,33.96501160),"
Chase Street Elementary School
757 North Chase Street
Athens, GA 30601

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chase Street Elementary School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.38736725,33.95156860),"
Clarke Central High School
350 South Milledge Avenue
Athens, GA 30605

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clarke Central High School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.32731628,33.93497849),"
Clarke County Evening School
440 Dearing Extension
Athens, GA 30606

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clarke County Evening School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.40367889,33.94588852),"
Clarke Middle School
1235 Baxter Street
Athens, GA 30606

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Clarke Middle School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.32731628,33.93497849),"
Classic City Performance Learning Center
280 Mitchell Bridge Road
Athens, GA 30606

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Classic City Performance Learning Center",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.30001831,33.98903275),"
Coile Middle School
110 Old Elberton Road
Athens, GA 30601

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Coile Middle School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.35759735,33.97276306),"
Fourth Street Elementary School
715 Fourth Street
Athens, GA 30601

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fourth Street Elementary School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.36241150,33.98897171),"
Fowler Drive Elementary School
400 Fowler Drive
Athens, GA 30601

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fowler Drive Elementary School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.32579803,33.93631744),"
Gaines Elementary School
280 Gaines School Road
Athens, GA 30605

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Gaines Elementary School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.33667755,33.92850876),"
Hilsman Middle School
870 Gaines School Road
Athens, GA 30605

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hilsman Middle School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.42245483,33.96256638),"
Oglethorpe Avenue Elementary School
1150 Oglethorpe Avenue
Athens, GA 30606

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oglethorpe Avenue Elementary School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.39768200,33.95239700),"
Rutland Psychoeducational Program
125 Minor Street
Athens, GA 30606

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rutland Psychoeducational Program",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.49925232,34.03984833),"
South Jackson Elementary School
8144 Jefferson Road
Athens, GA 30607

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Jackson Elementary School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.44791412,33.93696976),"
Timothy Elementary School
1900 Timothy Road
Athens, GA 30606

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Timothy Elementary School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.31575775,33.90226364),"
Whit Davis Road Elementary School
1450 Whit Davis Road
Athens, GA 30605

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Whit Davis Road Elementary School",'Athens=' + Athens.length); Athens[Athens.length] = createMarker(new GPoint(-83.43396759,33.97986221),"
Whitehead Road Elementary School
500 Whitehead Road
Athens, GA 30606

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Whitehead Road Elementary School",'Athens=' + Athens.length); map.removeOverlays(Athens); setTimeout(function(){map.addOverlays(Athens)},1000); maxLng = -83.30001831; maxLat = 34.03984833; minLng = -83.49925232; minLat = 33.90169525; reCenterMap(); } // 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(Athens); 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(Athens);map.removeOverlays(Athens); map.addOverlays(Athens); centerByArray(Athens, false, false); cntMarker += Athens.length; centerByArray(Athens,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'); } }