function addMarkers(){ mySelect = document.getElementById('selection'); Ashland = [];Florence = [];Prestonsburg = [];Hopkinsville = [];Louisville = [];Fort_Mitchell = [];Owensboro = [];Bowling_Green = [];Elizabethtown = [];Hazard = [];Henderson = [];Lexington = [];Madisonville = [];Maysville = [];Paducah = [];Saint_Catharine = [];Somerset = [];Cumberland = [];mySelect.options[mySelect.options.length] = new Option("Ashland Schools",'all=Ashland'); mySelect.options[mySelect.options.length] = new Option("Bowling Green Schools",'all=Bowling_Green'); mySelect.options[mySelect.options.length] = new Option("Cumberland Schools",'all=Cumberland'); mySelect.options[mySelect.options.length] = new Option("Elizabethtown Schools",'all=Elizabethtown'); mySelect.options[mySelect.options.length] = new Option("Florence Schools",'all=Florence'); mySelect.options[mySelect.options.length] = new Option("Fort Mitchell Schools",'all=Fort_Mitchell'); mySelect.options[mySelect.options.length] = new Option("Hazard Schools",'all=Hazard'); mySelect.options[mySelect.options.length] = new Option("Henderson Schools",'all=Henderson'); mySelect.options[mySelect.options.length] = new Option("Hopkinsville Schools",'all=Hopkinsville'); mySelect.options[mySelect.options.length] = new Option("Lexington Schools",'all=Lexington'); mySelect.options[mySelect.options.length] = new Option("Louisville Schools",'all=Louisville'); mySelect.options[mySelect.options.length] = new Option("Madisonville Schools",'all=Madisonville'); mySelect.options[mySelect.options.length] = new Option("Maysville Schools",'all=Maysville'); mySelect.options[mySelect.options.length] = new Option("Owensboro Schools",'all=Owensboro'); mySelect.options[mySelect.options.length] = new Option("Paducah Schools",'all=Paducah'); mySelect.options[mySelect.options.length] = new Option("Prestonsburg Schools",'all=Prestonsburg'); mySelect.options[mySelect.options.length] = new Option("Saint Catharine Schools",'all=Saint_Catharine'); mySelect.options[mySelect.options.length] = new Option("Somerset Schools",'all=Somerset'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); var tmpLatLng=0; var tmpLen=0; tmpLatLng=new GLatLng(38.46963600000000127,-82.6518839999999954); tmpLen=Ashland.length; Ashland[tmpLen] = createMarker(tmpLatLng,"
Ashland Community And Technical College
1400 College Drive
Ashland, KY 41101

[ View School Profile ]
",iconGr); Ashland[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Ashland Community And Technical College",'Ashland=' + Ashland.length); tmpLatLng=new GLatLng(39.01622400000000112,-84.6394700000000028); tmpLen=Florence.length; Florence[tmpLen] = createMarker(tmpLatLng,"
Beckfield College
16 Spiral Drive
Florence, KY 41042

[ View School Profile ]
",iconRd); Florence[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Beckfield College",'Florence=' + Florence.length); tmpLatLng=new GLatLng(37.68780000000000285,-82.7777600000000006); tmpLen=Prestonsburg.length; Prestonsburg[tmpLen] = createMarker(tmpLatLng,"
Big Sandy Community And Technical College
One Bert Combs Dr
Prestonsburg, KY 41653

[ View School Profile ]
",iconGr); Prestonsburg[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Big Sandy Community And Technical College",'Prestonsburg=' + Prestonsburg.length); tmpLatLng=new GLatLng(36.83266799999999818,-87.4737049999999953); tmpLen=Hopkinsville.length; Hopkinsville[tmpLen] = createMarker(tmpLatLng,"
Brown Mackie College-hopkinsville
4001 Fort Campbell Boulevard
Hopkinsville, KY 42240

[ View School Profile ]
",iconRd); Hopkinsville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Brown Mackie College-hopkinsville",'Hopkinsville=' + Hopkinsville.length); tmpLatLng=new GLatLng(38.15907399999999682,-85.7153380000000026); tmpLen=Louisville.length; Louisville[tmpLen] = createMarker(tmpLatLng,"
Brown Mackie College-louisville
300 High Rise Dr
Louisville, KY 40213

[ View School Profile ]
",iconRd); Louisville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Brown Mackie College-louisville",'Louisville=' + Louisville.length); tmpLatLng=new GLatLng(39.04286599999999651,-84.5711419999999947); tmpLen=Fort_Mitchell.length; Fort_Mitchell[tmpLen] = createMarker(tmpLatLng,"
Brown Mackie College-northern Kentucky
309 Buttermilk Pke
Fort Mitchell, KY 41017

[ View School Profile ]
",iconRd); Fort_Mitchell[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Brown Mackie College-northern Kentucky",'Fort_Mitchell=' + Fort_Mitchell.length); tmpLatLng=new GLatLng(37.73110100000000244,-87.1501879999999999); tmpLen=Owensboro.length; Owensboro[tmpLen] = createMarker(tmpLatLng,"
Daymar College
3361 Buckland Sq
Owensboro, KY 42301

[ View School Profile ]
",iconRd); Owensboro[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Daymar College",'Owensboro=' + Owensboro.length); tmpLatLng=new GLatLng(38.18269200000000296,-85.6263859999999965); tmpLen=Louisville.length; Louisville[tmpLen] = createMarker(tmpLatLng,"
Daymar College-louisville
4112 Fern Valley
Louisville, KY 40219

[ View School Profile ]
",iconGr); Louisville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Daymar College-louisville",'Louisville=' + Louisville.length); tmpLatLng=new GLatLng(36.96895399999999654,-86.4717959999999976); tmpLen=Bowling_Green.length; Bowling_Green[tmpLen] = createMarker(tmpLatLng,"
Draughons Junior College
2421 Fitzgerald Industrial Dr.
Bowling Green, KY 42101

[ View School Profile ]
",iconRd); Bowling_Green[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Draughons Junior College",'Bowling_Green=' + Bowling_Green.length); tmpLatLng=new GLatLng(37.68972000000000122,-85.8827650000000062); tmpLen=Elizabethtown.length; Elizabethtown[tmpLen] = createMarker(tmpLatLng,"
Elizabethtown Community And Technical College
600 College Street Rd
Elizabethtown, KY 42701

[ View School Profile ]
",iconGr); Elizabethtown[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Elizabethtown Community And Technical College",'Elizabethtown=' + Elizabethtown.length); tmpLatLng=new GLatLng(37.23374100000000197,-83.1744269999999943); tmpLen=Hazard.length; Hazard[tmpLen] = createMarker(tmpLatLng,"
Hazard Community And Technical College
One Community College Drive
Hazard, KY 41701

[ View School Profile ]
",iconGr); Hazard[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Hazard Community And Technical College",'Hazard=' + Hazard.length); tmpLatLng=new GLatLng(37.79780399999999929,-87.6535619999999937); tmpLen=Henderson.length; Henderson[tmpLen] = createMarker(tmpLatLng,"
Henderson Community College
2660 S Green St
Henderson, KY 42420

[ View School Profile ]
",iconGr); Henderson[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Henderson Community College",'Henderson=' + Henderson.length); tmpLatLng=new GLatLng(36.88061199999999928,-87.4942580000000020); tmpLen=Hopkinsville.length; Hopkinsville[tmpLen] = createMarker(tmpLatLng,"
Hopkinsville Community College
720 North Dr
Hopkinsville, KY 42241

[ View School Profile ]
",iconGr); Hopkinsville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Hopkinsville Community College",'Hopkinsville=' + Hopkinsville.length); tmpLatLng=new GLatLng(38.23391500000000320,-85.5737510000000014); tmpLen=Louisville.length; Louisville[tmpLen] = createMarker(tmpLatLng,"
Itt Technical Institute-louisville
10509 Timberwood Cir
Louisville, KY 40223

[ View School Profile ]
",iconRd); Louisville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Itt Technical Institute-louisville",'Louisville=' + Louisville.length); tmpLatLng=new GLatLng(38.24573999999999784,-85.7532240000000030); tmpLen=Louisville.length; Louisville[tmpLen] = createMarker(tmpLatLng,"
Jefferson Community College
109 E Broadway
Louisville, KY 40202

[ View School Profile ]
",iconGr); Louisville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Jefferson Community College",'Louisville=' + Louisville.length); tmpLatLng=new GLatLng(38.02557999999999793,-84.5016399999999947); tmpLen=Lexington.length; Lexington[tmpLen] = createMarker(tmpLatLng,"
Lexington Community College
Cooper Dr
Lexington, KY 40506

[ View School Profile ]
",iconGr); Lexington[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Lexington Community College",'Lexington=' + Lexington.length); tmpLatLng=new GLatLng(38.20024099999999833,-85.6895700000000033); tmpLen=Louisville.length; Louisville[tmpLen] = createMarker(tmpLatLng,"
Louisville Technical Institute
3901 Atkinson Square Dr
Louisville, KY 40218

[ View School Profile ]
",iconGr); Louisville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Louisville Technical Institute",'Louisville=' + Louisville.length); tmpLatLng=new GLatLng(37.36176700000000039,-87.4976060000000046); tmpLen=Madisonville.length; Madisonville[tmpLen] = createMarker(tmpLatLng,"
Madisonville Community College
2000 College Drive
Madisonville, KY 42431

[ View School Profile ]
",iconGr); Madisonville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Madisonville Community College",'Madisonville=' + Madisonville.length); tmpLatLng=new GLatLng(38.62753800000000126,-83.8006369999999947); tmpLen=Maysville.length; Maysville[tmpLen] = createMarker(tmpLatLng,"
Maysville Community And Technical College
1755 U.s. 68
Maysville, KY 41056

[ View School Profile ]
",iconGr); Maysville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Maysville Community And Technical College",'Maysville=' + Maysville.length); tmpLatLng=new GLatLng(38.03694300000000083,-84.4863979999999941); tmpLen=Lexington.length; Lexington[tmpLen] = createMarker(tmpLatLng,"
National College-lexington
2376 Sir Barton Way
Lexington, KY 40509

[ View School Profile ]
",iconRd); Lexington[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("National College-lexington",'Lexington=' + Lexington.length); tmpLatLng=new GLatLng(37.72404800000000335,-87.0836790000000036); tmpLen=Owensboro.length; Owensboro[tmpLen] = createMarker(tmpLatLng,"
Owensboro Community And Technical College
4800 New Hartford Rd
Owensboro, KY 42303

[ View School Profile ]
",iconGr); Owensboro[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Owensboro Community And Technical College",'Owensboro=' + Owensboro.length); tmpLatLng=new GLatLng(37.07562500000000227,-88.6383340000000004); tmpLen=Paducah.length; Paducah[tmpLen] = createMarker(tmpLatLng,"
Paducah Technical College
509 South 30th Street
Paducah, KY 42001

[ View School Profile ]
",iconRd); Paducah[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Paducah Technical College",'Paducah=' + Paducah.length); tmpLatLng=new GLatLng(37.71029599999999959,-85.2602320000000020); tmpLen=Saint_Catharine.length; Saint_Catharine[tmpLen] = createMarker(tmpLatLng,"
Saint Catharine College
2735 Bardstown Rd
Saint Catharine, KY 40061

[ View School Profile ]
",iconRd); Saint_Catharine[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Saint Catharine College",'Saint_Catharine=' + Saint_Catharine.length); tmpLatLng=new GLatLng(37.06045300000000253,-84.6187479999999965); tmpLen=Somerset.length; Somerset[tmpLen] = createMarker(tmpLatLng,"
Somerset Community College
808 Monticello Street
Somerset, KY 42501

[ View School Profile ]
",iconGr); Somerset[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Somerset Community College",'Somerset=' + Somerset.length); tmpLatLng=new GLatLng(36.97120199999999812,-82.9936639999999954); tmpLen=Cumberland.length; Cumberland[tmpLen] = createMarker(tmpLatLng,"
Southeast Kentucky Community And Technical College
700 College Rd
Cumberland, KY 40823

[ View School Profile ]
",iconGr); Cumberland[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Southeast Kentucky Community And Technical College",'Cumberland=' + Cumberland.length); tmpLatLng=new GLatLng(38.98881899999999944,-84.6523329999999987); tmpLen=Florence.length; Florence[tmpLen] = createMarker(tmpLatLng,"
Southwestern College
8095 Connector Dr
Florence, KY 41042

[ View School Profile ]
",iconRd); Florence[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Southwestern College",'Florence=' + Florence.length); tmpLatLng=new GLatLng(38.17681900000000183,-85.8207380000000057); tmpLen=Louisville.length; Louisville[tmpLen] = createMarker(tmpLatLng,"
Spencerian College
4627 Dixie Hwy
Louisville, KY 40216

[ View School Profile ]
",iconRd); Louisville[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Spencerian College",'Louisville=' + Louisville.length); tmpLatLng=new GLatLng(38.02109999999999701,-84.5436579999999935); tmpLen=Lexington.length; Lexington[tmpLen] = createMarker(tmpLatLng,"
Spencerian College-lexington
1575 Winchester Road
Lexington, KY 40505

[ View School Profile ]
",iconRd); Lexington[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Spencerian College-lexington",'Lexington=' + Lexington.length); tmpLatLng=new GLatLng(37.05684600000000017,-88.6571619999999995); tmpLen=Paducah.length; Paducah[tmpLen] = createMarker(tmpLatLng,"
West Kentucky Community And Technical College
4810 Alben Barkley Drive
Paducah, KY 42002

[ View School Profile ]
",iconGr); Paducah[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("West Kentucky Community And Technical College",'Paducah=' + Paducah.length); map.removeOverlays(Ashland); map.removeOverlays(Bowling_Green); map.removeOverlays(Cumberland); map.removeOverlays(Elizabethtown); map.removeOverlays(Florence); map.removeOverlays(Fort_Mitchell); map.removeOverlays(Hazard); map.removeOverlays(Henderson); map.removeOverlays(Hopkinsville); map.removeOverlays(Lexington); map.removeOverlays(Louisville); map.removeOverlays(Madisonville); map.removeOverlays(Maysville); map.removeOverlays(Owensboro); map.removeOverlays(Paducah); map.removeOverlays(Prestonsburg); map.removeOverlays(Saint_Catharine); map.removeOverlays(Somerset); setTimeout(function(){map.addOverlays(Ashland)},1000); setTimeout(function(){map.addOverlays(Bowling_Green)},1000); setTimeout(function(){map.addOverlays(Cumberland)},1000); setTimeout(function(){map.addOverlays(Elizabethtown)},1000); setTimeout(function(){map.addOverlays(Florence)},1000); setTimeout(function(){map.addOverlays(Fort_Mitchell)},1000); setTimeout(function(){map.addOverlays(Hazard)},1000); setTimeout(function(){map.addOverlays(Henderson)},1000); setTimeout(function(){map.addOverlays(Hopkinsville)},1000); setTimeout(function(){map.addOverlays(Lexington)},1000); setTimeout(function(){map.addOverlays(Louisville)},1000); setTimeout(function(){map.addOverlays(Madisonville)},1000); setTimeout(function(){map.addOverlays(Maysville)},1000); setTimeout(function(){map.addOverlays(Owensboro)},1000); setTimeout(function(){map.addOverlays(Paducah)},1000); setTimeout(function(){map.addOverlays(Prestonsburg)},1000); setTimeout(function(){map.addOverlays(Saint_Catharine)},1000); setTimeout(function(){map.addOverlays(Somerset)},1000); getPoly("","state","","KY");} // 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(Ashland); map.removeOverlays(Bowling_Green); map.removeOverlays(Cumberland); map.removeOverlays(Elizabethtown); map.removeOverlays(Florence); map.removeOverlays(Fort_Mitchell); map.removeOverlays(Hazard); map.removeOverlays(Henderson); map.removeOverlays(Hopkinsville); map.removeOverlays(Lexington); map.removeOverlays(Louisville); map.removeOverlays(Madisonville); map.removeOverlays(Maysville); map.removeOverlays(Owensboro); map.removeOverlays(Paducah); map.removeOverlays(Prestonsburg); map.removeOverlays(Saint_Catharine); map.removeOverlays(Somerset); 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(Ashland);map.removeOverlays(Ashland); map.removeOverlays(Bowling_Green); map.removeOverlays(Cumberland); map.removeOverlays(Elizabethtown); map.removeOverlays(Florence); map.removeOverlays(Fort_Mitchell); map.removeOverlays(Hazard); map.removeOverlays(Henderson); map.removeOverlays(Hopkinsville); map.removeOverlays(Lexington); map.removeOverlays(Louisville); map.removeOverlays(Madisonville); map.removeOverlays(Maysville); map.removeOverlays(Owensboro); map.removeOverlays(Paducah); map.removeOverlays(Prestonsburg); map.removeOverlays(Saint_Catharine); map.removeOverlays(Somerset); map.addOverlays(Ashland); centerByArray(Ashland, false, false); cntMarker += Ashland.length; map.addOverlays(Bowling_Green); centerByArray(Bowling_Green, false, false); cntMarker += Bowling_Green.length; map.addOverlays(Cumberland); centerByArray(Cumberland, false, false); cntMarker += Cumberland.length; map.addOverlays(Elizabethtown); centerByArray(Elizabethtown, false, false); cntMarker += Elizabethtown.length; map.addOverlays(Florence); centerByArray(Florence, false, false); cntMarker += Florence.length; map.addOverlays(Fort_Mitchell); centerByArray(Fort_Mitchell, false, false); cntMarker += Fort_Mitchell.length; map.addOverlays(Hazard); centerByArray(Hazard, false, false); cntMarker += Hazard.length; map.addOverlays(Henderson); centerByArray(Henderson, false, false); cntMarker += Henderson.length; map.addOverlays(Hopkinsville); centerByArray(Hopkinsville, false, false); cntMarker += Hopkinsville.length; map.addOverlays(Lexington); centerByArray(Lexington, false, false); cntMarker += Lexington.length; map.addOverlays(Louisville); centerByArray(Louisville, false, false); cntMarker += Louisville.length; map.addOverlays(Madisonville); centerByArray(Madisonville, false, false); cntMarker += Madisonville.length; map.addOverlays(Maysville); centerByArray(Maysville, false, false); cntMarker += Maysville.length; map.addOverlays(Owensboro); centerByArray(Owensboro, false, false); cntMarker += Owensboro.length; map.addOverlays(Paducah); centerByArray(Paducah, false, false); cntMarker += Paducah.length; map.addOverlays(Prestonsburg); centerByArray(Prestonsburg, false, false); cntMarker += Prestonsburg.length; map.addOverlays(Saint_Catharine); centerByArray(Saint_Catharine, false, false); cntMarker += Saint_Catharine.length; map.addOverlays(Somerset); centerByArray(Somerset, false, false); cntMarker += Somerset.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; }