function addMarkers() { mySelect = document.getElementById('selection'); Rome = [];Armuchee = [];Cave_Spring = [];Silver_Creek = [];Lindale = [];Arome = [];mySelect.options[mySelect.options.length] = new Option("Armuchee schools",'all=Armuchee'); mySelect.options[mySelect.options.length] = new Option("Arome schools",'all=Arome'); mySelect.options[mySelect.options.length] = new Option("Cave Spring schools",'all=Cave_Spring'); mySelect.options[mySelect.options.length] = new Option("Lindale schools",'all=Lindale'); mySelect.options[mySelect.options.length] = new Option("Rome schools",'all=Rome'); mySelect.options[mySelect.options.length] = new Option("Silver Creek schools",'all=Silver_Creek'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Rome[Rome.length] = createMarker(new GPoint(-85.23311615,34.25914001),"
Alto Park Elementary School
528 Burnett Ferry Road, Sw
Rome, GA 30165

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Alto Park Elementary School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.18544769,34.24799347),"
Anna K. Davie Elementary School
301 Nixon Avenue
Rome, GA 30161

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Anna K. Davie Elementary School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.17262268,34.35694122),"
Armuchee 6-8 Middle School
4203 Martha Berry Hwy
Rome, GA 30165

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Armuchee 6-8 Middle School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.17279053,34.35730362),"
Armuchee Elementary School
5075 Martha Berry Highway, Nw
Rome, GA 30165

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Armuchee Elementary School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.18208313,34.27956009),"
Armuchee High School
4203 Martha Berry Blvd.
Rome, GA 30165

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Armuchee High School",'Rome=' + Rome.length); Armuchee[Armuchee.length] = createMarker(new GPoint(-85.16410828,34.38406372),"
Armuchee Middle School
471 Floyd Springs Road Ne
Armuchee, GA 30105

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Armuchee Middle School",'Armuchee=' + Armuchee.length); Rome[Rome.length] = createMarker(new GPoint(-10.00000000,10.00000000),"
Bob Richards Regional Youth Detention Center
200 Marable Way
Rome, GA 30165

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bob Richards Regional Youth Detention Center",'Rome=' + Rome.length); Cave_Spring[Cave_Spring.length] = createMarker(new GPoint(-85.33404541,34.11130142),"
Cave Spring Elementary School
13 Rome Street
Cave Spring, GA 30124

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cave Spring Elementary School",'Cave_Spring=' + Cave_Spring.length); Rome[Rome.length] = createMarker(new GPoint(-85.30411530,34.26209259),"
Coosa High School
4454 Alabama Highway, Nw
Rome, GA 30165

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Coosa High School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.31510162,34.26330185),"
Coosa Middle School
212 Eagle Drive Nw
Rome, GA 30165

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Coosa Middle School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.15965271,34.23348236),"
East Central Elementary School
1502 Dean Avenue
Rome, GA 30161

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("East Central Elementary School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.20615387,34.26792908),"
Elm Street Elementary School
8 Elm Street
Rome, GA 30165

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Elm Street Elementary School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.20407867,34.26789856),"
Floyd County Education Center
1910 Morrison Campground Road
Rome, GA 30161

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Floyd County Education Center",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.20407867,34.26789856),"
Floyd County Technical High School
100 Vocational Drive, Sw
Rome, GA 30161

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Floyd County Technical High School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.23900604,34.28501892),"
Garden Lakes Elementary School
2903 Garden Lakes Boulevard, N
Rome, GA 30165

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Garden Lakes Elementary School",'Rome=' + Rome.length); Cave_Spring[Cave_Spring.length] = createMarker(new GPoint(-85.34581300,34.10005000),"
Georgia School For Deaf
232 Perry Farm Road
Cave Spring, GA 30214

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Georgia School For Deaf",'Cave_Spring=' + Cave_Spring.length); Rome[Rome.length] = createMarker(new GPoint(-85.16407776,34.31346130),"
Glenwood Primary School
75 Glenwood School Road, Ne
Rome, GA 30165

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glenwood Primary School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.06128693,34.25752258),"
Johnson Elementary School
1839 Morrison Campground Road
Rome, GA 30161

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Johnson Elementary School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.15474701,34.25910187),"
Main Elementary School
3 Watters Street
Rome, GA 30161

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Main Elementary School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.18337250,34.21893311),"
Mchenry Primary
100 Mchenry Drive, Sw
Rome, GA 30161

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mchenry Primary",'Rome=' + Rome.length); Silver_Creek[Silver_Creek.length] = createMarker(new GPoint(-85.14609528,34.17600632),"
Midway Primary
5 Midway School Road, Se
Silver Creek, GA 30173

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Midway Primary",'Silver_Creek=' + Silver_Creek.length); Rome[Rome.length] = createMarker(new GPoint(-85.09552765,34.31104279),"
Model 6-8 Middle School
164 Barron Road Ne
Rome, GA 30161

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Model 6-8 Middle School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.09927368,34.31032181),"
Model 9-12 High School
3252 Calhoun Hwy
Rome, GA 30161

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Model 9-12 High School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.10017395,34.30932999),"
Model Elementary School
3200 Calhoun Highway, Ne
Rome, GA 30161

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Model Elementary School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.14056396,34.26785660),"
North Heights Elementary School
26 Atteiram Drive
Rome, GA 30161

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North Heights Elementary School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.15832400,34.26750200),"
Northwest Psychoeducational Program
200 Reece Street
Rome, GA 30161

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northwest Psychoeducational Program",'Rome=' + Rome.length); Lindale[Lindale.length] = createMarker(new GPoint(-85.18269348,34.16429138),"
Pepperell Elementary School
270 Hughes Dairy Road
Lindale, GA 30147

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pepperell Elementary School",'Lindale=' + Lindale.length); Lindale[Lindale.length] = createMarker(new GPoint(-85.17540741,34.18096161),"
Pepperell High School
3 Dragon Drive, Se
Lindale, GA 30147

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pepperell High School",'Lindale=' + Lindale.length); Lindale[Lindale.length] = createMarker(new GPoint(-85.18280029,34.16466141),"
Pepperell Middle School
200 Hughes Dairy Road, Se
Lindale, GA 30147

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pepperell Middle School",'Lindale=' + Lindale.length); Lindale[Lindale.length] = createMarker(new GPoint(-85.17536163,34.18096161),"
Pepperell Primary
One Dragon Drive, Se
Lindale, GA 30147

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pepperell Primary",'Lindale=' + Lindale.length); Rome[Rome.length] = createMarker(new GPoint(-85.20407867,34.26789856),"
Rome City Transitional Academy
1162 Spider Web Drive
Rome, GA 30161

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rome City Transitional Academy",'Rome=' + Rome.length); Arome[Arome.length] = createMarker(new GPoint(-87.67981800,41.87996300),"
Rome High School
1000 Veteran''s Memorial Highw
Arome, GA 30161

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rome High School",'Arome=' + Arome.length); Arome[Arome.length] = createMarker(new GPoint(-87.71792400,41.86225500),"
Rome Middle School
1020 Veteran''s Memorial Highw
Arome, GA 30161

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rome Middle School",'Arome=' + Arome.length); Rome[Rome.length] = createMarker(new GPoint(-85.17443085,34.22528076),"
S.p.i.c.e. High School
100 Vocational Drive, Sw
Rome, GA 30161

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("S.p.i.c.e. High School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.16964722,34.23479462),"
Southeast Elementary School
1400 Crane Street
Rome, GA 30161

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southeast Elementary School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.20886993,34.27598953),"
West Central Elementary School
409 Lavender Drive, Nw
Rome, GA 30165

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West Central Elementary School",'Rome=' + Rome.length); Rome[Rome.length] = createMarker(new GPoint(-85.23325348,34.27150726),"
West End Elementary School
5 Brown Fox Drive
Rome, GA 30165

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("West End Elementary School",'Rome=' + Rome.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(Armuchee); map.removeOverlays(Arome); map.removeOverlays(Cave_Spring); map.removeOverlays(Lindale); map.removeOverlays(Rome); map.removeOverlays(Silver_Creek); 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(Rome);map.removeOverlays(Armuchee); map.removeOverlays(Arome); map.removeOverlays(Cave_Spring); map.removeOverlays(Lindale); map.removeOverlays(Rome); map.removeOverlays(Silver_Creek); map.addOverlays(Armuchee); centerByArray(Armuchee, false, false); cntMarker += Armuchee.length; map.addOverlays(Arome); centerByArray(Arome, false, false); cntMarker += Arome.length; map.addOverlays(Cave_Spring); centerByArray(Cave_Spring, false, false); cntMarker += Cave_Spring.length; map.addOverlays(Lindale); centerByArray(Lindale, false, false); cntMarker += Lindale.length; map.addOverlays(Rome); centerByArray(Rome, false, false); cntMarker += Rome.length; map.addOverlays(Silver_Creek); centerByArray(Silver_Creek, false, false); cntMarker += Silver_Creek.length; centerByArray(Rome,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'); } }