function addMarkers(){ mySelect = document.getElementById('selection'); Memphis = [];Chattanooga = [];Cleveland = [];Columbia = [];Clarksville = [];Nashville = [];Dyersburg = [];Knoxville = [];Madisonville = [];Cordova = [];Jackson = [];Cookeville = [];Tullahoma = [];Blountville = [];Goodlettsville = [];Harriman = [];Gallatin = [];Morristown = [];mySelect.options[mySelect.options.length] = new Option("Blountville Schools",'all=Blountville'); mySelect.options[mySelect.options.length] = new Option("Chattanooga Schools",'all=Chattanooga'); mySelect.options[mySelect.options.length] = new Option("Clarksville Schools",'all=Clarksville'); mySelect.options[mySelect.options.length] = new Option("Cleveland Schools",'all=Cleveland'); mySelect.options[mySelect.options.length] = new Option("Columbia Schools",'all=Columbia'); mySelect.options[mySelect.options.length] = new Option("Cookeville Schools",'all=Cookeville'); mySelect.options[mySelect.options.length] = new Option("Cordova Schools",'all=Cordova'); mySelect.options[mySelect.options.length] = new Option("Dyersburg Schools",'all=Dyersburg'); mySelect.options[mySelect.options.length] = new Option("Gallatin Schools",'all=Gallatin'); mySelect.options[mySelect.options.length] = new Option("Goodlettsville Schools",'all=Goodlettsville'); mySelect.options[mySelect.options.length] = new Option("Harriman Schools",'all=Harriman'); mySelect.options[mySelect.options.length] = new Option("Jackson Schools",'all=Jackson'); mySelect.options[mySelect.options.length] = new Option("Knoxville Schools",'all=Knoxville'); mySelect.options[mySelect.options.length] = new Option("Madisonville Schools",'all=Madisonville'); mySelect.options[mySelect.options.length] = new Option("Memphis Schools",'all=Memphis'); mySelect.options[mySelect.options.length] = new Option("Morristown Schools",'all=Morristown'); mySelect.options[mySelect.options.length] = new Option("Nashville Schools",'all=Nashville'); mySelect.options[mySelect.options.length] = new Option("Tullahoma Schools",'all=Tullahoma'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); var tmpLatLng=0; var tmpLen=0; tmpLatLng=new GLatLng(35.138949,-90.028189); tmpLen=Memphis.length; Memphis[tmpLen] = createMarker(tmpLatLng,"
Baptist Memorial College Of Health Sciences
1003 Monroe Ave
Memphis, TN 38104

[ View School Profile ]
",iconRd); Memphis[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Baptist Memorial College Of Health Sciences",'Memphis=' + Memphis.length); tmpLatLng=new GLatLng(35.09631799999999657,-85.2373369999999965); tmpLen=Chattanooga.length; Chattanooga[tmpLen] = createMarker(tmpLatLng,"
Chattanooga State Technical Community College
4501 Amnicola Hwy
Chattanooga, TN 37406

[ View School Profile ]
",iconGr); Chattanooga[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Chattanooga State Technical Community College",'Chattanooga=' + Chattanooga.length); tmpLatLng=new GLatLng(35.20401999999999986,-84.8766600000000011); tmpLen=Cleveland.length; Cleveland[tmpLen] = createMarker(tmpLatLng,"
Cleveland State Community College
3535 Adkisson Drive
Cleveland, TN 37320

[ View School Profile ]
",iconGr); Cleveland[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Cleveland State Community College",'Cleveland=' + Cleveland.length); tmpLatLng=new GLatLng(35.61844399999999666,-87.1007620000000031); tmpLen=Columbia.length; Columbia[tmpLen] = createMarker(tmpLatLng,"
Columbia State Community College
1665 Hampshire Pike
Columbia, TN 38401

[ View School Profile ]
",iconGr); Columbia[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Columbia State Community College",'Columbia=' + Columbia.length); tmpLatLng=new GLatLng(36.55556399999999683,-87.3223480000000051); tmpLen=Clarksville.length; Clarksville[tmpLen] = createMarker(tmpLatLng,"
Draughons Junior College
1860 Wilma Rudolph Blvd
Clarksville, TN 37040

[ View School Profile ]
",iconRd); Clarksville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Draughons Junior College",'Clarksville=' + Clarksville.length); tmpLatLng=new GLatLng(36.16534000000000048,-86.7843170000000014); tmpLen=Nashville.length; Nashville[tmpLen] = createMarker(tmpLatLng,"
Draughons Junior College Inc
340 Plus Park Blvd
Nashville, TN 37217

[ View School Profile ]
",iconRd); Nashville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Draughons Junior College Inc",'Nashville=' + Nashville.length); tmpLatLng=new GLatLng(36.04681000000000068,-89.3927829999999943); tmpLen=Dyersburg.length; Dyersburg[tmpLen] = createMarker(tmpLatLng,"
Dyersburg State Community College
1510 Lake Road
Dyersburg, TN 38024

[ View School Profile ]
",iconGr); Dyersburg[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Dyersburg State Community College",'Dyersburg=' + Dyersburg.length); tmpLatLng=new GLatLng(35.02243899999999854,-85.2423890000000028); tmpLen=Chattanooga.length; Chattanooga[tmpLen] = createMarker(tmpLatLng,"
Electronic Computer Programming College Inc
3805 Brainerd Rd
Chattanooga, TN 37411

[ View School Profile ]
",iconRd); Chattanooga[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Electronic Computer Programming College Inc",'Chattanooga=' + Chattanooga.length); tmpLatLng=new GLatLng(36.02841399999999794,-83.9216980000000063); tmpLen=Knoxville.length; Knoxville[tmpLen] = createMarker(tmpLatLng,"
Fountainhead College Of Technology
3203 Tazewell Pke
Knoxville, TN 37918

[ View School Profile ]
",iconRd); Knoxville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Fountainhead College Of Technology",'Knoxville=' + Knoxville.length); tmpLatLng=new GLatLng(35.55864199999999897,-84.3620540000000005); tmpLen=Madisonville.length; Madisonville[tmpLen] = createMarker(tmpLatLng,"
Hiwassee College
225 Hiwassee College Drive
Madisonville, TN 37354

[ View School Profile ]
",iconRd); Madisonville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Hiwassee College",'Madisonville=' + Madisonville.length); tmpLatLng=new GLatLng(35.14876900000000148,-90.0454560000000014); tmpLen=Cordova.length; Cordova[tmpLen] = createMarker(tmpLatLng,"
Itt Technical Institute-cordova
7260 Goodlett Farms Parkway
Cordova, TN 38016

[ View School Profile ]
",iconRd); Cordova[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Itt Technical Institute-cordova",'Cordova=' + Cordova.length); tmpLatLng=new GLatLng(35.64790699999999645,-88.7962260000000043); tmpLen=Jackson.length; Jackson[tmpLen] = createMarker(tmpLatLng,"
Jackson State Community College
2046 North Pky
Jackson, TN 38301

[ View School Profile ]
",iconGr); Jackson[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Jackson State Community College",'Jackson=' + Jackson.length); tmpLatLng=new GLatLng(36.15655699999999939,-86.7945260000000047); tmpLen=Nashville.length; Nashville[tmpLen] = createMarker(tmpLatLng,"
John A Gupton College
1616 Church St
Nashville, TN 37203

[ View School Profile ]
",iconRd); Nashville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("John A Gupton College",'Nashville=' + Nashville.length); tmpLatLng=new GLatLng(36.14226000000000027,-85.4781349999999946); tmpLen=Cookeville.length; Cookeville[tmpLen] = createMarker(tmpLatLng,"
Medvance Institute-cookeville
1025 Highway 111
Cookeville, TN 38501

[ View School Profile ]
",iconRd); Cookeville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Medvance Institute-cookeville",'Cookeville=' + Cookeville.length); tmpLatLng=new GLatLng(36.55512800000000339,-87.3250670000000042); tmpLen=Clarksville.length; Clarksville[tmpLen] = createMarker(tmpLatLng,"
Miller-motte Technical College
1820 Business Park Dr
Clarksville, TN 37040

[ View School Profile ]
",iconRd); Clarksville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Miller-motte Technical College",'Clarksville=' + Clarksville.length); tmpLatLng=new GLatLng(35.36515299999999939,-86.3009050000000002); tmpLen=Tullahoma.length; Tullahoma[tmpLen] = createMarker(tmpLatLng,"
Motlow State Community College
6015 Ledford Mill Road
Tullahoma, TN 37388

[ View School Profile ]
",iconGr); Tullahoma[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Motlow State Community College",'Tullahoma=' + Tullahoma.length); tmpLatLng=new GLatLng(36.19411800000000312,-86.7436359999999950); tmpLen=Nashville.length; Nashville[tmpLen] = createMarker(tmpLatLng,"
Nashville Auto Diesel College Inc
1524 Gallatin Rd
Nashville, TN 37206

[ View School Profile ]
",iconRd); Nashville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Nashville Auto Diesel College Inc",'Nashville=' + Nashville.length); tmpLatLng=new GLatLng(36.13434199999999663,-86.8581140000000004); tmpLen=Nashville.length; Nashville[tmpLen] = createMarker(tmpLatLng,"
Nashville State Technical Community College
120 White Bridge Rd
Nashville, TN 37209

[ View School Profile ]
",iconGr); Nashville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Nashville State Technical Community College",'Nashville=' + Nashville.length); tmpLatLng=new GLatLng(36.09150700000000000,-86.7349799999999930); tmpLen=Nashville.length; Nashville[tmpLen] = createMarker(tmpLatLng,"
National College Of Business And Technology-nashvi
3748 Nolensville Pk
Nashville, TN 37211

[ View School Profile ]
",iconRd); Nashville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("National College Of Business And Technology-nashvi",'Nashville=' + Nashville.length); tmpLatLng=new GLatLng(36.61560800000000170,-87.4263650000000041); tmpLen=Clarksville.length; Clarksville[tmpLen] = createMarker(tmpLatLng,"
North Central Institute
168 Jack Miller Blvd
Clarksville, TN 37042

[ View School Profile ]
",iconRd); Clarksville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("North Central Institute",'Clarksville=' + Clarksville.length); tmpLatLng=new GLatLng(36.48460800000000148,-82.4101979999999940); tmpLen=Blountville.length; Blountville[tmpLen] = createMarker(tmpLatLng,"
Northeast State Technical Community College
2425 Hwy 75
Blountville, TN 37617

[ View School Profile ]
",iconGr); Blountville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Northeast State Technical Community College",'Blountville=' + Blountville.length); tmpLatLng=new GLatLng(36.30013900000000148,-86.7007729999999980); tmpLen=Goodlettsville.length; Goodlettsville[tmpLen] = createMarker(tmpLatLng,"
Nossi College Of Art
907 Rivergate Pky Bldg E6
Goodlettsville, TN 37072

[ View School Profile ]
",iconRd); Goodlettsville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Nossi College Of Art",'Goodlettsville=' + Goodlettsville.length); tmpLatLng=new GLatLng(35.94443199999999905,-84.1651839999999964); tmpLen=Knoxville.length; Knoxville[tmpLen] = createMarker(tmpLatLng,"
Pellissippi State Technical Community College
10915 Hardin Valley Road
Knoxville, TN 37933

[ View School Profile ]
",iconGr); Knoxville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Pellissippi State Technical Community College",'Knoxville=' + Knoxville.length); tmpLatLng=new GLatLng(35.87976299999999696,-84.6169689999999974); tmpLen=Harriman.length; Harriman[tmpLen] = createMarker(tmpLatLng,"
Roane State Community College
276 Patton Ln
Harriman, TN 37748

[ View School Profile ]
",iconGr); Harriman[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Roane State Community College",'Harriman=' + Harriman.length); tmpLatLng=new GLatLng(35.97743499999999983,-83.9165930000000059); tmpLen=Knoxville.length; Knoxville[tmpLen] = createMarker(tmpLatLng,"
South College
3904 Lonas Road
Knoxville, TN 37909

[ View School Profile ]
",iconRd); Knoxville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("South College",'Knoxville=' + Knoxville.length); tmpLatLng=new GLatLng(35.16298900000000315,-89.8638349999999945); tmpLen=Memphis.length; Memphis[tmpLen] = createMarker(tmpLatLng,"
Southwest Tennessee Community College
737 Union Avenue
Memphis, TN 38103

[ View School Profile ]
",iconGr); Memphis[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Southwest Tennessee Community College",'Memphis=' + Memphis.length); tmpLatLng=new GLatLng(36.36240699999999748,-86.4952569999999951); tmpLen=Gallatin.length; Gallatin[tmpLen] = createMarker(tmpLatLng,"
Volunteer State Community College
1480 Nashville Pike
Gallatin, TN 37066

[ View School Profile ]
",iconGr); Gallatin[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Volunteer State Community College",'Gallatin=' + Gallatin.length); tmpLatLng=new GLatLng(36.21134800000000098,-83.2618839999999948); tmpLen=Morristown.length; Morristown[tmpLen] = createMarker(tmpLatLng,"
Walters State Community College
500 S Davy Crockett Pky
Morristown, TN 37813

[ View School Profile ]
",iconGr); Morristown[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Walters State Community College",'Morristown=' + Morristown.length); tmpLatLng=new GLatLng(36.19349299999999658,-86.8067159999999944); tmpLen=Nashville.length; Nashville[tmpLen] = createMarker(tmpLatLng,"
Watkins College Of Art And Design
2298 Metrocenter Blvd
Nashville, TN 37228

[ View School Profile ]
",iconRd); Nashville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Watkins College Of Art And Design",'Nashville=' + Nashville.length); map.removeOverlays(Blountville); map.removeOverlays(Chattanooga); map.removeOverlays(Clarksville); map.removeOverlays(Cleveland); map.removeOverlays(Columbia); map.removeOverlays(Cookeville); map.removeOverlays(Cordova); map.removeOverlays(Dyersburg); map.removeOverlays(Gallatin); map.removeOverlays(Goodlettsville); map.removeOverlays(Harriman); map.removeOverlays(Jackson); map.removeOverlays(Knoxville); map.removeOverlays(Madisonville); map.removeOverlays(Memphis); map.removeOverlays(Morristown); map.removeOverlays(Nashville); map.removeOverlays(Tullahoma); setTimeout(function(){map.addOverlays(Blountville)},1000); setTimeout(function(){map.addOverlays(Chattanooga)},1000); setTimeout(function(){map.addOverlays(Clarksville)},1000); setTimeout(function(){map.addOverlays(Cleveland)},1000); setTimeout(function(){map.addOverlays(Columbia)},1000); setTimeout(function(){map.addOverlays(Cookeville)},1000); setTimeout(function(){map.addOverlays(Cordova)},1000); setTimeout(function(){map.addOverlays(Dyersburg)},1000); setTimeout(function(){map.addOverlays(Gallatin)},1000); setTimeout(function(){map.addOverlays(Goodlettsville)},1000); setTimeout(function(){map.addOverlays(Harriman)},1000); setTimeout(function(){map.addOverlays(Jackson)},1000); setTimeout(function(){map.addOverlays(Knoxville)},1000); setTimeout(function(){map.addOverlays(Madisonville)},1000); setTimeout(function(){map.addOverlays(Memphis)},1000); setTimeout(function(){map.addOverlays(Morristown)},1000); setTimeout(function(){map.addOverlays(Nashville)},1000); setTimeout(function(){map.addOverlays(Tullahoma)},1000); getPoly("","state","","TN");} // End addStateMarkers JavaScript Function //open all when map is defined function openAll() { if (map) { selectChange("all"); } else { setTimeout("openAll()",200); } } // 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].point.x; var markLat = myArray[i].point.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].point.x; maxLat = myArray[0].point.y; minLng = myArray[0].point.x; minLat = myArray[0].point.y; } // Recenter map based on global max/mins function reCenterMap(){ //alert('#' + minLat + '#' + minLng + '#' + maxLat + '#' + maxLng); 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) { if (selection.options) { var _openNewWindow=true; var myVal = selection.options[selection.selectedIndex].value; } else { var _openNewWindow=false; var myVal=selection; } 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('schools-by-distance') == -1) window.open(location.href + '/map/all'); else window.open('/search////all'); map.removeOverlays(Blountville); map.removeOverlays(Chattanooga); map.removeOverlays(Clarksville); map.removeOverlays(Cleveland); map.removeOverlays(Columbia); map.removeOverlays(Cookeville); map.removeOverlays(Cordova); map.removeOverlays(Dyersburg); map.removeOverlays(Gallatin); map.removeOverlays(Goodlettsville); map.removeOverlays(Harriman); map.removeOverlays(Jackson); map.removeOverlays(Knoxville); map.removeOverlays(Madisonville); map.removeOverlays(Memphis); map.removeOverlays(Morristown); map.removeOverlays(Nashville); map.removeOverlays(Tullahoma); 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(Memphis);map.removeOverlays(Blountville); map.removeOverlays(Chattanooga); map.removeOverlays(Clarksville); map.removeOverlays(Cleveland); map.removeOverlays(Columbia); map.removeOverlays(Cookeville); map.removeOverlays(Cordova); map.removeOverlays(Dyersburg); map.removeOverlays(Gallatin); map.removeOverlays(Goodlettsville); map.removeOverlays(Harriman); map.removeOverlays(Jackson); map.removeOverlays(Knoxville); map.removeOverlays(Madisonville); map.removeOverlays(Memphis); map.removeOverlays(Morristown); map.removeOverlays(Nashville); map.removeOverlays(Tullahoma); map.addOverlays(Blountville); centerByArray(Blountville, false, false); cntMarker += Blountville.length; map.addOverlays(Chattanooga); centerByArray(Chattanooga, false, false); cntMarker += Chattanooga.length; map.addOverlays(Clarksville); centerByArray(Clarksville, false, false); cntMarker += Clarksville.length; map.addOverlays(Cleveland); centerByArray(Cleveland, false, false); cntMarker += Cleveland.length; map.addOverlays(Columbia); centerByArray(Columbia, false, false); cntMarker += Columbia.length; map.addOverlays(Cookeville); centerByArray(Cookeville, false, false); cntMarker += Cookeville.length; map.addOverlays(Cordova); centerByArray(Cordova, false, false); cntMarker += Cordova.length; map.addOverlays(Dyersburg); centerByArray(Dyersburg, false, false); cntMarker += Dyersburg.length; map.addOverlays(Gallatin); centerByArray(Gallatin, false, false); cntMarker += Gallatin.length; map.addOverlays(Goodlettsville); centerByArray(Goodlettsville, false, false); cntMarker += Goodlettsville.length; map.addOverlays(Harriman); centerByArray(Harriman, false, false); cntMarker += Harriman.length; map.addOverlays(Jackson); centerByArray(Jackson, false, false); cntMarker += Jackson.length; map.addOverlays(Knoxville); centerByArray(Knoxville, false, false); cntMarker += Knoxville.length; map.addOverlays(Madisonville); centerByArray(Madisonville, false, false); cntMarker += Madisonville.length; map.addOverlays(Memphis); centerByArray(Memphis, false, false); cntMarker += Memphis.length; map.addOverlays(Morristown); centerByArray(Morristown, false, false); cntMarker += Morristown.length; map.addOverlays(Nashville); centerByArray(Nashville, false, false); cntMarker += Nashville.length; map.addOverlays(Tullahoma); centerByArray(Tullahoma, false, false); cntMarker += Tullahoma.length; reCenterMap(); //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'); } } function createMarker(point, label, icon){ var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }