function addMarkers() { mySelect = document.getElementById('selection'); Villa_Rica = [];Bowdon = [];Carrollton = [];Mount_Zion = [];Roopville = [];Temple = [];Whitesburg = [];mySelect.options[mySelect.options.length] = new Option("Bowdon schools",'all=Bowdon'); mySelect.options[mySelect.options.length] = new Option("Carrollton schools",'all=Carrollton'); mySelect.options[mySelect.options.length] = new Option("Mount Zion schools",'all=Mount_Zion'); mySelect.options[mySelect.options.length] = new Option("Roopville schools",'all=Roopville'); mySelect.options[mySelect.options.length] = new Option("Temple schools",'all=Temple'); mySelect.options[mySelect.options.length] = new Option("Villa Rica schools",'all=Villa_Rica'); mySelect.options[mySelect.options.length] = new Option("Whitesburg schools",'all=Whitesburg'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Villa_Rica[Villa_Rica.length] = createMarker(new GPoint(-84.93815613,33.68929291),"
Bay Springs Middle School
122 Bay Springs Road
Villa Rica, GA 30180

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bay Springs Middle School",'Villa_Rica=' + Villa_Rica.length); Bowdon[Bowdon.length] = createMarker(new GPoint(-85.25363922,33.52643585),"
Bowdon Elementary School
223 Kent Avenue
Bowdon, GA 30108

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bowdon Elementary School",'Bowdon=' + Bowdon.length); Bowdon[Bowdon.length] = createMarker(new GPoint(-85.26062775,33.53741837),"
Bowdon High School
504 West College Street
Bowdon, GA 30108

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bowdon High School",'Bowdon=' + Bowdon.length); Carrollton[Carrollton.length] = createMarker(new GPoint(-85.08037800,33.58053900),"
Burwell Psychoeducational Program
423 Alabama Street
Carrollton, GA 30117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Burwell Psychoeducational Program",'Carrollton=' + Carrollton.length); Bowdon[Bowdon.length] = createMarker(new GPoint(-85.23114014,33.53179932),"
Carroll County/carrollton City Alternative
225 E. College Street
Bowdon, GA 30108

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carroll County/carrollton City Alternative",'Bowdon=' + Bowdon.length); Carrollton[Carrollton.length] = createMarker(new GPoint(-85.08263397,33.55764389),"
Carrollton Elementary School
401 Ben Scott Boulevard
Carrollton, GA 30117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carrollton Elementary School",'Carrollton=' + Carrollton.length); Carrollton[Carrollton.length] = createMarker(new GPoint(-85.07963562,33.56733322),"
Carrollton High School
202 Trojan Drive
Carrollton, GA 30117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carrollton High School",'Carrollton=' + Carrollton.length); Carrollton[Carrollton.length] = createMarker(new GPoint(-85.08296204,33.55814743),"
Carrollton Junior High School
510 Ben Scott Boulevard
Carrollton, GA 30117

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Carrollton Junior High School",'Carrollton=' + Carrollton.length); Carrollton[Carrollton.length] = createMarker(new GPoint(-10.00000000,10.00000000),"
Carrollton Middle-upper Elementary School
Tom Reeve Drive
Carrollton, GA 30117

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Carrollton Middle-upper Elementary School",'Carrollton=' + Carrollton.length); Carrollton[Carrollton.length] = createMarker(new GPoint(-85.06934357,33.54141235),"
Central Elementary School
175 Primary School Road
Carrollton, GA 30116

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Carrollton=' + Carrollton.length); Bowdon[Bowdon.length] = createMarker(new GPoint(-85.25123596,33.53889847),"
Central Evening Program High School
225 E. College Street
Bowdon, GA 30108

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Evening Program High School",'Bowdon=' + Bowdon.length); Carrollton[Carrollton.length] = createMarker(new GPoint(-85.07688904,33.55510330),"
Central High School
113 Central Road
Carrollton, GA 30116

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central High School",'Carrollton=' + Carrollton.length); Carrollton[Carrollton.length] = createMarker(new GPoint(-85.06211090,33.53670502),"
Central Middle School
155 Whooping Creek Road
Carrollton, GA 30116

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Central Middle School",'Carrollton=' + Carrollton.length); Villa_Rica[Villa_Rica.length] = createMarker(new GPoint(-84.94715100,33.67922900),"
Ithica Elementary School
75 Whitworth Road
Villa Rica, GA 30180

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ithica Elementary School",'Villa_Rica=' + Villa_Rica.length); Bowdon[Bowdon.length] = createMarker(new GPoint(-85.23053741,33.56347275),"
Jonesville Middle School
129 North Jonesville Road
Bowdon, GA 30108

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Jonesville Middle School",'Bowdon=' + Bowdon.length); Bowdon[Bowdon.length] = createMarker(new GPoint(-10.00000000,10.00000000),"
Kidspeace
101 Kidspeace Drive
Bowdon, GA 30108

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Kidspeace",'Bowdon=' + Bowdon.length); Mount_Zion[Mount_Zion.length] = createMarker(new GPoint(-85.18571472,33.63433838),"
Mount Zion Elementary School
4485 Mount Zion Road
Mount Zion, GA 30150

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mount Zion Elementary School",'Mount_Zion=' + Mount_Zion.length); Mount_Zion[Mount_Zion.length] = createMarker(new GPoint(-85.18437958,33.63695908),"
Mount Zion High School
132 Eagle Drive
Mount Zion, GA 30150

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount Zion High School",'Mount_Zion=' + Mount_Zion.length); Roopville[Roopville.length] = createMarker(new GPoint(-85.12881470,33.46220016),"
Roopville Elementary School
60 Old Carrollton Road
Roopville, GA 30170

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roopville Elementary School",'Roopville=' + Roopville.length); Carrollton[Carrollton.length] = createMarker(new GPoint(-84.99240112,33.63790131),"
Sand Hill Elementary School
45 Sand Hill School Road
Carrollton, GA 30117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sand Hill Elementary School",'Carrollton=' + Carrollton.length); Carrollton[Carrollton.length] = createMarker(new GPoint(-85.04898834,33.64916229),"
Sharp Creek Elementary School
115 Old Muse Road
Carrollton, GA 30117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sharp Creek Elementary School",'Carrollton=' + Carrollton.length); Carrollton[Carrollton.length] = createMarker(new GPoint(-85.16517639,33.55812073),"
Technical High School Of Carroll County
1075 Newnan Highway
Carrollton, GA 30116

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Technical High School Of Carroll County",'Carrollton=' + Carrollton.length); Temple[Temple.length] = createMarker(new GPoint(-85.03847504,33.73949432),"
Temple Elementary School
95 Otis Street
Temple, GA 30179

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Temple Elementary School",'Temple=' + Temple.length); Temple[Temple.length] = createMarker(new GPoint(-85.02510834,33.73278809),"
Temple High School
589 Sage Street
Temple, GA 30179

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Temple High School",'Temple=' + Temple.length); Temple[Temple.length] = createMarker(new GPoint(-85.01885986,33.76940155),"
Temple Middle School
Rainey Road
Temple, GA 30179

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Temple Middle School",'Temple=' + Temple.length); Villa_Rica[Villa_Rica.length] = createMarker(new GPoint(-84.92685699,33.73491669),"
Villa Rica Elementary School
314 Peachtreet Street
Villa Rica, GA 30180

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Villa Rica Elementary School",'Villa_Rica=' + Villa_Rica.length); Villa_Rica[Villa_Rica.length] = createMarker(new GPoint(-84.94543457,33.72946167),"
Villa Rica High School
600 Rocky Branch Road
Villa Rica, GA 30180

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Villa Rica High School",'Villa_Rica=' + Villa_Rica.length); Temple[Temple.length] = createMarker(new GPoint(-84.97430700,33.77807800),"
Villa Rica Middle School
614 Tumlin Lake Road
Temple, GA 30179

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Villa Rica Middle School",'Temple=' + Temple.length); Villa_Rica[Villa_Rica.length] = createMarker(new GPoint(-84.91366577,33.72872925),"
Villa Rica Primary School
118 Glanton Street
Villa Rica, GA 30180

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Villa Rica Primary School",'Villa_Rica=' + Villa_Rica.length); Whitesburg[Whitesburg.length] = createMarker(new GPoint(-84.91746521,33.49837112),"
Whitesburg Elementary School
868 Main Street
Whitesburg, GA 30185

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