function addMarkers() { mySelect = document.getElementById('selection'); Evans = [];Grovetown = [];Harlem = [];Martinez = [];Appling = [];mySelect.options[mySelect.options.length] = new Option("Appling schools",'all=Appling'); mySelect.options[mySelect.options.length] = new Option("Evans schools",'all=Evans'); mySelect.options[mySelect.options.length] = new Option("Grovetown schools",'all=Grovetown'); mySelect.options[mySelect.options.length] = new Option("Harlem schools",'all=Harlem'); mySelect.options[mySelect.options.length] = new Option("Martinez schools",'all=Martinez'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Evans[Evans.length] = createMarker(new GPoint(-82.14163208,33.52191544),"
Bel Air Elementary School
325 North Belair Road
Evans, GA 30809

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bel Air Elementary School",'Evans=' + Evans.length); Evans[Evans.length] = createMarker(new GPoint(-82.10485840,33.53842926),"
Blue Ridge Elementary School
550 Blue Ridge Drive
Evans, GA 30809

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Blue Ridge Elementary School",'Evans=' + Evans.length); Grovetown[Grovetown.length] = createMarker(new GPoint(-82.15372467,33.48490524),"
Brookwood Elementary School
455 South Old Belair Road
Grovetown, GA 30813

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brookwood Elementary School",'Grovetown=' + Grovetown.length); Grovetown[Grovetown.length] = createMarker(new GPoint(-82.28173828,33.50445938),"
Columbia County Crossroads Academy
112 Ford Avenue
Grovetown, GA 30813

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Columbia County Crossroads Academy",'Grovetown=' + Grovetown.length); Grovetown[Grovetown.length] = createMarker(new GPoint(-82.26750946,33.52740860),"
Columbia Middle School
6000 Columbia Road
Grovetown, GA 30813

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Columbia Middle School",'Grovetown=' + Grovetown.length); Grovetown[Grovetown.length] = createMarker(new GPoint(-82.26734924,33.47967529),"
Euchee Creek Elementary School
795 Louisville Road
Grovetown, GA 30813

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Euchee Creek Elementary School",'Grovetown=' + Grovetown.length); Evans[Evans.length] = createMarker(new GPoint(-82.15324402,33.54418945),"
Evans Elementary School
628 Gibbs Road
Evans, GA 30809

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Evans Elementary School",'Evans=' + Evans.length); Evans[Evans.length] = createMarker(new GPoint(-82.14680481,33.52541733),"
Evans High School
4550 Cox Road
Evans, GA 30809

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Evans High School",'Evans=' + Evans.length); Evans[Evans.length] = createMarker(new GPoint(-82.12902832,33.53746414),"
Evans Middle School
4318 Washington Road
Evans, GA 30809

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Evans Middle School",'Evans=' + Evans.length); Evans[Evans.length] = createMarker(new GPoint(-82.18682861,33.58657074),"
Greenbrier Elementary School
5116 Riverwood Parkway
Evans, GA 30809

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greenbrier Elementary School",'Evans=' + Evans.length); Evans[Evans.length] = createMarker(new GPoint(-82.18666840,33.58677673),"
Greenbrier High School
5114 Riverwood Parkway
Evans, GA 30809

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greenbrier High School",'Evans=' + Evans.length); Evans[Evans.length] = createMarker(new GPoint(-82.18714905,33.58616257),"
Greenbrier Middle School
5120 Riverwood Parkway
Evans, GA 30809

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Greenbrier Middle School",'Evans=' + Evans.length); Grovetown[Grovetown.length] = createMarker(new GPoint(-82.19420624,33.44709396),"
Grovetown Elementary School
300 Ford Avenue
Grovetown, GA 30813

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Grovetown Elementary School",'Grovetown=' + Grovetown.length); Grovetown[Grovetown.length] = createMarker(new GPoint(-82.21484375,33.45174026),"
Grovetown Middle School
5463 Harlem Grovetown Road
Grovetown, GA 30813

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Grovetown Middle School",'Grovetown=' + Grovetown.length); Harlem[Harlem.length] = createMarker(new GPoint(-82.31230164,33.46115112),"
Harlem High School
1070 Appling-harlem Road
Harlem, GA 30814

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harlem High School",'Harlem=' + Harlem.length); Harlem[Harlem.length] = createMarker(new GPoint(-82.31856537,33.42005539),"
Harlem Middle School
375 West Forrest Street
Harlem, GA 30814

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Harlem Middle School",'Harlem=' + Harlem.length); Evans[Evans.length] = createMarker(new GPoint(-82.10436249,33.53719711),"
Lakeside High School
533 Blue Ridge Drive
Evans, GA 30809

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lakeside High School",'Evans=' + Evans.length); Evans[Evans.length] = createMarker(new GPoint(-82.10433197,33.53671265),"
Lakeside Middle School
527 Blue Ridge Drive
Evans, GA 30809

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lakeside Middle School",'Evans=' + Evans.length); Evans[Evans.length] = createMarker(new GPoint(-82.15245819,33.57757950),"
Lewiston Elementary School
5426 Hereford Farm Road
Evans, GA 30809

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lewiston Elementary School",'Evans=' + Evans.length); Martinez[Martinez.length] = createMarker(new GPoint(-82.10605621,33.50669098),"
Martinez Elementary School
213 Flowing Wells Road
Martinez, GA 30907

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Martinez Elementary School",'Martinez=' + Martinez.length); Evans[Evans.length] = createMarker(new GPoint(-82.09763300,33.57377200),"
New Elementary #5
4109 Mullikin Road
Evans, GA 30809

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Elementary #5",'Evans=' + Evans.length); Appling[Appling.length] = createMarker(new GPoint(-82.31815338,33.58860016),"
North Columbia Elementary School
2874 Ray Owens Road
Appling, GA 30802

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Columbia Elementary School",'Appling=' + Appling.length); Harlem[Harlem.length] = createMarker(new GPoint(-82.31997681,33.42330933),"
North Harlem Elementary School
525 Fairview Drive
Harlem, GA 30814

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Harlem Elementary School",'Harlem=' + Harlem.length); Evans[Evans.length] = createMarker(new GPoint(-82.12785339,33.57770920),"
Riverside Elementary School
4431 Hardy Mcmanus Road
Evans, GA 30809

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverside Elementary School",'Evans=' + Evans.length); Evans[Evans.length] = createMarker(new GPoint(-82.13053900,33.53218000),"
Riverside Middle School
1095 Fury''s Ferry Road
Evans, GA 30809

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Riverside Middle School",'Evans=' + Evans.length); Grovetown[Grovetown.length] = createMarker(new GPoint(-82.28173828,33.50445938),"
Sand Hills Psychoeducational Program
6000 Columbia Road
Grovetown, GA 30813

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sand Hills Psychoeducational Program",'Grovetown=' + Grovetown.length); Martinez[Martinez.length] = createMarker(new GPoint(-82.10475922,33.52392578),"
South Columbia Elementary School
325 Mccormick Road
Martinez, GA 30907

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("South Columbia Elementary School",'Martinez=' + Martinez.length); Martinez[Martinez.length] = createMarker(new GPoint(-82.08100891,33.55117798),"
Stevens Creek Elementary School
3780 Evans To Lock Road
Martinez, GA 30907

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stevens Creek Elementary School",'Martinez=' + Martinez.length); Martinez[Martinez.length] = createMarker(new GPoint(-82.14509583,33.49728012),"
Westmont Elementary School
4558 Oakley Pirkle Road
Martinez, GA 30907

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