function addMarkers() { mySelect = document.getElementById('selection'); Warner_Robins = [];Bonaire = [];Centerville = [];Byron = [];Perry = [];Kathleen = [];Robins_Afb = [];mySelect.options[mySelect.options.length] = new Option("Bonaire schools",'all=Bonaire'); mySelect.options[mySelect.options.length] = new Option("Byron schools",'all=Byron'); mySelect.options[mySelect.options.length] = new Option("Centerville schools",'all=Centerville'); mySelect.options[mySelect.options.length] = new Option("Kathleen schools",'all=Kathleen'); mySelect.options[mySelect.options.length] = new Option("Perry schools",'all=Perry'); mySelect.options[mySelect.options.length] = new Option("Robins Afb schools",'all=Robins_Afb'); mySelect.options[mySelect.options.length] = new Option("Warner Robins schools",'all=Warner_Robins'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.61325836,32.61324310),"
Bert Rumble Middle School
303 South Davis Drive
Warner Robins, GA 31088

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bert Rumble Middle School",'Warner_Robins=' + Warner_Robins.length); Bonaire[Bonaire.length] = createMarker(new GPoint(-83.60053253,32.54890823),"
Bonaire Elementary School
101 Elm Street
Bonaire, GA 31005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bonaire Elementary School",'Bonaire=' + Bonaire.length); Bonaire[Bonaire.length] = createMarker(new GPoint(-83.59622955,32.54547882),"
Bonaire Middle School
125 Highway 96 East
Bonaire, GA 31005

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bonaire Middle School",'Bonaire=' + Bonaire.length); Centerville[Centerville.length] = createMarker(new GPoint(-83.68953705,32.62870789),"
Centerville Elementary School
450 Houston Lake Road
Centerville, GA 31028

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Centerville Elementary School",'Centerville=' + Centerville.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.64679718,32.64319992),"
David A. Perdue Primary
150 Bear Country Blvd
Warner Robins, GA 31088

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("David A. Perdue Primary",'Warner_Robins=' + Warner_Robins.length); Byron[Byron.length] = createMarker(new GPoint(-83.70917511,32.63046265),"
Eagle Springs Elementary School
3591 U.s. Highway 41 North
Byron, GA 31008

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eagle Springs Elementary School",'Byron=' + Byron.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.67647552,32.57112122),"
Feagin Mill Middle School
1200 Feagin Mill Road
Warner Robins, GA 31088

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Feagin Mill Middle School",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.65583038,32.59580612),"
Houston County Career And Technology Center
1311 Corder Road
Warner Robins, GA 31088

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Houston County Career And Technology Center",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.64855957,32.64302063),"
Houston County High School
920 Highway 96
Warner Robins, GA 31088

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Houston County High School",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.62185669,32.65610504),"
Houston County Psychological Services Department
304 Elberta Road
Warner Robins, GA 31093

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Houston County Psychological Services Department",'Warner_Robins=' + Warner_Robins.length); Perry[Perry.length] = createMarker(new GPoint(-83.65343475,32.45701981),"
Kings Chapel Elementary School
460 Arena Road
Perry, GA 31069

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kings Chapel Elementary School",'Perry=' + Perry.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.64679718,32.64319992),"
Lake Joy Elementary School
995 Lake Joy Rd
Warner Robins, GA 31088

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lake Joy Elementary School",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.61540222,32.63863754),"
Lindsey Elementary School
81 Tabor Drive
Warner Robins, GA 31093

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lindsey Elementary School",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.60655975,32.61183929),"
Linwood Elementary School
1050 Education Way
Warner Robins, GA 31088

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Linwood Elementary School",'Warner_Robins=' + Warner_Robins.length); Kathleen[Kathleen.length] = createMarker(new GPoint(-83.60800171,32.49576187),"
Matthew Arthur Elementary School
2500 Highway 127
Kathleen, GA 31047

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Matthew Arthur Elementary School",'Kathleen=' + Kathleen.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.63867950,32.61255264),"
Miller Elementary School
101 Pine Valley Drive
Warner Robins, GA 31088

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Miller Elementary School",'Warner_Robins=' + Warner_Robins.length); Perry[Perry.length] = createMarker(new GPoint(-83.71113586,32.46177292),"
Morningside Elementary School
1206 Morningside Drive
Perry, GA 31069

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Morningside Elementary School",'Perry=' + Perry.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.65510559,32.65738297),"
Northside Elementary School
305 Sullivan Road
Warner Robins, GA 31093

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northside Elementary School",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.63005066,32.62643814),"
Northside High School
926 Green Street
Warner Robins, GA 31093

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northside High School",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.64566040,32.63463593),"
Northside Middle School
500 Johnson Road
Warner Robins, GA 31093

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Northside Middle School",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.62936401,32.62396622),"
Parkwood Elementary School
503 Parkwood Drive
Warner Robins, GA 31093

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Parkwood Elementary School",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.61732483,32.59999466),"
Pearl Stephens Elementary School
215 Scott Boulevard
Warner Robins, GA 31088

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pearl Stephens Elementary School",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.60015106,32.62147141),"
Perdue Elementary School
115 Sutherlin St
Warner Robins, GA 31088

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Perdue Elementary School",'Warner_Robins=' + Warner_Robins.length); Perry[Perry.length] = createMarker(new GPoint(-83.72708893,32.45722580),"
Perry Elementary School
906 School Street
Perry, GA 31069

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Perry Elementary School",'Perry=' + Perry.length); Perry[Perry.length] = createMarker(new GPoint(-83.72647858,32.46693802),"
Perry High School
1307 North Avenue
Perry, GA 31069

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Perry High School",'Perry=' + Perry.length); Perry[Perry.length] = createMarker(new GPoint(-83.74262238,32.49330139),"
Perry Middle School
1098 North Perry Parkway
Perry, GA 31069

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Perry Middle School",'Perry=' + Perry.length); Perry[Perry.length] = createMarker(new GPoint(-83.72303772,32.46106339),"
Perry Primary School
1500 Sunshine Avenue
Perry, GA 31069

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Perry Primary School",'Perry=' + Perry.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.68761444,32.60948944),"
Quail Run Elementary School
250 Smithville Church Road
Warner Robins, GA 31088

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Quail Run Elementary School",'Warner_Robins=' + Warner_Robins.length); Robins_Afb[Robins_Afb.length] = createMarker(new GPoint(-83.60655975,32.61183929),"
Robins Elementary School
1050 Education Way, Bldg 988
Robins Afb, GA 31098

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Robins Elementary School",'Robins_Afb=' + Robins_Afb.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.63458252,32.59523773),"
Russell Elementary School
101 Patriot Way
Warner Robins, GA 31088

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Russell Elementary School",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.65081024,32.60393143),"
Shirley Hills Elementary School
300 Mary Lane
Warner Robins, GA 31088

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shirley Hills Elementary School",'Warner_Robins=' + Warner_Robins.length); Centerville[Centerville.length] = createMarker(new GPoint(-83.62989044,32.62643814),"
Tabor Middle School
301 Thomson St
Centerville, GA 31028

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Tabor Middle School",'Centerville=' + Centerville.length); Perry[Perry.length] = createMarker(new GPoint(-83.72248840,32.44982147),"
Tucker Elementary School
1300 Tucker Road
Perry, GA 31069

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tucker Elementary School",'Perry=' + Perry.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.61293793,32.61234283),"
Warner Robins High School
401 South Davis Drive
Warner Robins, GA 31088

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Warner Robins High School",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.65376282,32.60002136),"
Warner Robins Middle School
425 Mary Lane
Warner Robins, GA 31088

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Warner Robins Middle School",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.61209869,32.60884094),"
Watson Center
401 Dover Drive
Warner Robins, GA 31088

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Watson Center",'Warner_Robins=' + Warner_Robins.length); Warner_Robins[Warner_Robins.length] = createMarker(new GPoint(-83.62266541,32.62033844),"
Westside Elementary School
201 North Pleasant Hill Road
Warner Robins, GA 31088

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westside Elementary School",'Warner_Robins=' + Warner_Robins.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(Bonaire); map.removeOverlays(Byron); map.removeOverlays(Centerville); map.removeOverlays(Kathleen); map.removeOverlays(Perry); map.removeOverlays(Robins_Afb); map.removeOverlays(Warner_Robins); 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(Warner_Robins);map.removeOverlays(Bonaire); map.removeOverlays(Byron); map.removeOverlays(Centerville); map.removeOverlays(Kathleen); map.removeOverlays(Perry); map.removeOverlays(Robins_Afb); map.removeOverlays(Warner_Robins); map.addOverlays(Bonaire); centerByArray(Bonaire, false, false); cntMarker += Bonaire.length; map.addOverlays(Byron); centerByArray(Byron, false, false); cntMarker += Byron.length; map.addOverlays(Centerville); centerByArray(Centerville, false, false); cntMarker += Centerville.length; map.addOverlays(Kathleen); centerByArray(Kathleen, false, false); cntMarker += Kathleen.length; map.addOverlays(Perry); centerByArray(Perry, false, false); cntMarker += Perry.length; map.addOverlays(Robins_Afb); centerByArray(Robins_Afb, false, false); cntMarker += Robins_Afb.length; map.addOverlays(Warner_Robins); centerByArray(Warner_Robins, false, false); cntMarker += Warner_Robins.length; centerByArray(Warner_Robins,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'); } }