function addMarkers(){
mySelect = document.getElementById('selection');
North_Kansas_City = [];Kansas_City = [];Nevada = [];Neosho = [];Union = [];Springfield = [];Saint_Louis = [];Hillsboro = [];Linn = [];Rolla = [];Jefferson_City = [];Cape_Girardeau = [];Lees_Summit = [];Park_Hills = [];West_Plains = [];Moberly = [];Trenton = [];Kirkwood = [];Fenton = [];Hazelwood = [];Sain_Peters = [];Cottleville = [];Sedalia = [];Poplar_Bluff = [];Saint_Ann = [];Saint_Joseph = [];Sunset_Hills = [];Lexington = [];mySelect.options[mySelect.options.length] = new Option("Cape Girardeau Schools",'all=Cape_Girardeau');
mySelect.options[mySelect.options.length] = new Option("Cottleville Schools",'all=Cottleville');
mySelect.options[mySelect.options.length] = new Option("Fenton Schools",'all=Fenton');
mySelect.options[mySelect.options.length] = new Option("Hazelwood Schools",'all=Hazelwood');
mySelect.options[mySelect.options.length] = new Option("Hillsboro Schools",'all=Hillsboro');
mySelect.options[mySelect.options.length] = new Option("Jefferson City Schools",'all=Jefferson_City');
mySelect.options[mySelect.options.length] = new Option("Kansas City Schools",'all=Kansas_City');
mySelect.options[mySelect.options.length] = new Option("Kirkwood Schools",'all=Kirkwood');
mySelect.options[mySelect.options.length] = new Option("Lees Summit Schools",'all=Lees_Summit');
mySelect.options[mySelect.options.length] = new Option("Lexington Schools",'all=Lexington');
mySelect.options[mySelect.options.length] = new Option("Linn Schools",'all=Linn');
mySelect.options[mySelect.options.length] = new Option("Moberly Schools",'all=Moberly');
mySelect.options[mySelect.options.length] = new Option("Neosho Schools",'all=Neosho');
mySelect.options[mySelect.options.length] = new Option("Nevada Schools",'all=Nevada');
mySelect.options[mySelect.options.length] = new Option("North Kansas City Schools",'all=North_Kansas_City');
mySelect.options[mySelect.options.length] = new Option("Park Hills Schools",'all=Park_Hills');
mySelect.options[mySelect.options.length] = new Option("Poplar Bluff Schools",'all=Poplar_Bluff');
mySelect.options[mySelect.options.length] = new Option("Rolla Schools",'all=Rolla');
mySelect.options[mySelect.options.length] = new Option("Sain Peters Schools",'all=Sain_Peters');
mySelect.options[mySelect.options.length] = new Option("Saint Ann Schools",'all=Saint_Ann');
mySelect.options[mySelect.options.length] = new Option("Saint Joseph Schools",'all=Saint_Joseph');
mySelect.options[mySelect.options.length] = new Option("Saint Louis Schools",'all=Saint_Louis');
mySelect.options[mySelect.options.length] = new Option("Sedalia Schools",'all=Sedalia');
mySelect.options[mySelect.options.length] = new Option("Springfield Schools",'all=Springfield');
mySelect.options[mySelect.options.length] = new Option("Sunset Hills Schools",'all=Sunset_Hills');
mySelect.options[mySelect.options.length] = new Option("Trenton Schools",'all=Trenton');
mySelect.options[mySelect.options.length] = new Option("Union Schools",'all=Union');
mySelect.options[mySelect.options.length] = new Option("West Plains Schools",'all=West_Plains');
mySelect.options[mySelect.options.length] = new Option("---------------------------",'');
var tmpLatLng=0;
var tmpLen=0;
tmpLatLng=new GLatLng(39.14164199999999738,-94.5758060000000000);
tmpLen=North_Kansas_City.length;
North_Kansas_City[tmpLen] = createMarker(tmpLatLng,"
",iconRd);
North_Kansas_City[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Colorado Technical University",'North_Kansas_City=' + North_Kansas_City.length);
tmpLatLng=new GLatLng(39.06858600000000336,-94.5900170000000031);
tmpLen=Kansas_City.length;
Kansas_City[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Kansas_City[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Concorde Career Colleges",'Kansas_City=' + Kansas_City.length);
tmpLatLng=new GLatLng(37.83746800000000121,-94.3688619999999929);
tmpLen=Nevada.length;
Nevada[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Nevada[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Cottey College",'Nevada=' + Nevada.length);
tmpLatLng=new GLatLng(36.81190899999999999,-94.3633099999999984);
tmpLen=Neosho.length;
Neosho[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Neosho[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Crowder College",'Neosho=' + Neosho.length);
tmpLatLng=new GLatLng(38.42258100000000098,-90.9691729999999978);
tmpLen=Union.length;
Union[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Union[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("East Central College",'Union=' + Union.length);
tmpLatLng=new GLatLng(37.18250100000000202,-93.3045189999999990);
tmpLen=Springfield.length;
Springfield[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Springfield[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Everest College-springfield Campus",'Springfield=' + Springfield.length);
tmpLatLng=new GLatLng(38.69875100000000145,-90.4235170000000039);
tmpLen=Saint_Louis.length;
Saint_Louis[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Saint_Louis[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Hickey College",'Saint_Louis=' + Saint_Louis.length);
tmpLatLng=new GLatLng(38.25807199999999852,-90.5539799999999956);
tmpLen=Hillsboro.length;
Hillsboro[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Hillsboro[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Jefferson College",'Hillsboro=' + Hillsboro.length);
tmpLatLng=new GLatLng(38.48539999999999849,-91.8053000000000025);
tmpLen=Linn.length;
Linn[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Linn[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Linn State Technical College",'Linn=' + Linn.length);
tmpLatLng=new GLatLng(37.9507290000000026,-91.7716290000000043);
tmpLen=Rolla.length;
Rolla[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Rolla[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Metro Business College",'Rolla=' + Rolla.length);
tmpLatLng=new GLatLng(38.56406799999999890,-92.2000840000000039);
tmpLen=Jefferson_City.length;
Jefferson_City[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Jefferson_City[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Metro Business College",'Jefferson_City=' + Jefferson_City.length);
tmpLatLng=new GLatLng(37.33105499999999921,-89.5699960000000032);
tmpLen=Cape_Girardeau.length;
Cape_Girardeau[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Cape_Girardeau[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Metro Business College Of Cape Girardeau",'Cape_Girardeau=' + Cape_Girardeau.length);
tmpLatLng=new GLatLng(38.90522399999999692,-94.4298040000000042);
tmpLen=Lees_Summit.length;
Lees_Summit[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Lees_Summit[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Metropolitan Community College-longview",'Lees_Summit=' + Lees_Summit.length);
tmpLatLng=new GLatLng(39.24903199999999969,-94.5473759999999998);
tmpLen=Kansas_City.length;
Kansas_City[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Kansas_City[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Metropolitan Community College-maple Woods",'Kansas_City=' + Kansas_City.length);
tmpLatLng=new GLatLng(39.09978100000000012,-94.5773619999999937);
tmpLen=Kansas_City.length;
Kansas_City[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Kansas_City[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Metropolitan Community College-penn Valley",'Kansas_City=' + Kansas_City.length);
tmpLatLng=new GLatLng(37.85134500000000201,-90.5129139999999949);
tmpLen=Park_Hills.length;
Park_Hills[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Park_Hills[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Mineral Area College",'Park_Hills=' + Park_Hills.length);
tmpLatLng=new GLatLng(38.60211900000000184,-90.3896170000000012);
tmpLen=Saint_Louis.length;
Saint_Louis[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Saint_Louis[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Missouri College",'Saint_Louis=' + Saint_Louis.length);
tmpLatLng=new GLatLng(36.72866899999999645,-91.8561470000000070);
tmpLen=West_Plains.length;
West_Plains[tmpLen] = createMarker(tmpLatLng,"",iconGr);
West_Plains[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Missouri State University-west Plains",'West_Plains=' + West_Plains.length);
tmpLatLng=new GLatLng(39.41979099999999647,-92.4529660000000035);
tmpLen=Moberly.length;
Moberly[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Moberly[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Moberly Area Community College",'Moberly=' + Moberly.length);
tmpLatLng=new GLatLng(40.07752800000000093,-93.6174689999999998);
tmpLen=Trenton.length;
Trenton[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Trenton[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("North Central Missouri College",'Trenton=' + Trenton.length);
tmpLatLng=new GLatLng(37.21724700000000041,-93.2804969999999968);
tmpLen=Springfield.length;
Springfield[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Springfield[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ozarks Technical Community College",'Springfield=' + Springfield.length);
tmpLatLng=new GLatLng(38.62769600000000025,-90.1877740000000045);
tmpLen=Saint_Louis.length;
Saint_Louis[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Saint_Louis[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Patricia Stevens College",'Saint_Louis=' + Saint_Louis.length);
tmpLatLng=new GLatLng(38.84303100000000341,-94.5451910000000026);
tmpLen=Kansas_City.length;
Kansas_City[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Kansas_City[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Pinnacle Career Institute",'Kansas_City=' + Kansas_City.length);
tmpLatLng=new GLatLng(38.65284900000000334,-90.2488299999999981);
tmpLen=Saint_Louis.length;
Saint_Louis[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Saint_Louis[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Ranken Technical College",'Saint_Louis=' + Saint_Louis.length);
tmpLatLng=new GLatLng(38.77015500000000258,-90.2845750000000037);
tmpLen=Saint_Louis.length;
Saint_Louis[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Saint_Louis[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Saint Louis Community College-florissant Valley",'Saint_Louis=' + Saint_Louis.length);
tmpLatLng=new GLatLng(38.62965100000000262,-90.2745129999999988);
tmpLen=Saint_Louis.length;
Saint_Louis[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Saint_Louis[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Saint Louis Community College-forest Park",'Saint_Louis=' + Saint_Louis.length);
tmpLatLng=new GLatLng(38.56875200000000347,-90.3899169999999969);
tmpLen=Kirkwood.length;
Kirkwood[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Kirkwood[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Saint Louis Community College-meramec",'Kirkwood=' + Kirkwood.length);
tmpLatLng=new GLatLng(38.52335599999999971,-90.4717830000000020);
tmpLen=Fenton.length;
Fenton[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Fenton[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Sanford-brown College",'Fenton=' + Fenton.length);
tmpLatLng=new GLatLng(38.78084199999999981,-90.3619089999999971);
tmpLen=Hazelwood.length;
Hazelwood[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Hazelwood[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Sanford-brown College",'Hazelwood=' + Hazelwood.length);
tmpLatLng=new GLatLng(38.79633100000000212,-90.5634419999999948);
tmpLen=Sain_Peters.length;
Sain_Peters[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Sain_Peters[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Sanford-brown College",'Sain_Peters=' + Sain_Peters.length);
tmpLatLng=new GLatLng(38.74405200000000348,-90.6349239999999980);
tmpLen=Cottleville.length;
Cottleville[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Cottleville[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("St Charles Community College",'Cottleville=' + Cottleville.length);
tmpLatLng=new GLatLng(38.69924900000000178,-93.2719759999999951);
tmpLen=Sedalia.length;
Sedalia[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Sedalia[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("State Fair Community College",'Sedalia=' + Sedalia.length);
tmpLatLng=new GLatLng(36.77643799999999885,-90.4310550000000006);
tmpLen=Poplar_Bluff.length;
Poplar_Bluff[tmpLen] = createMarker(tmpLatLng,"",iconGr);
Poplar_Bluff[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Three Rivers Community College",'Poplar_Bluff=' + Poplar_Bluff.length);
tmpLatLng=new GLatLng(38.72756499999999846,-90.3802450000000021);
tmpLen=Saint_Ann.length;
Saint_Ann[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Saint_Ann[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Vatterott College",'Saint_Ann=' + Saint_Ann.length);
tmpLatLng=new GLatLng(37.21100799999999964,-93.2744990000000058);
tmpLen=Springfield.length;
Springfield[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Springfield[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Vatterott College",'Springfield=' + Springfield.length);
tmpLatLng=new GLatLng(39.05359500000000139,-94.4751119999999957);
tmpLen=Kansas_City.length;
Kansas_City[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Kansas_City[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Vatterott College",'Kansas_City=' + Kansas_City.length);
tmpLatLng=new GLatLng(39.77665900000000220,-94.8174790000000058);
tmpLen=Saint_Joseph.length;
Saint_Joseph[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Saint_Joseph[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Vatterott College",'Saint_Joseph=' + Saint_Joseph.length);
tmpLatLng=new GLatLng(38.52136899999999997,-90.4177810000000050);
tmpLen=Sunset_Hills.length;
Sunset_Hills[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Sunset_Hills[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Vatterott College",'Sunset_Hills=' + Sunset_Hills.length);
tmpLatLng=new GLatLng(39.18635100000000193,-93.8719490000000007);
tmpLen=Lexington.length;
Lexington[tmpLen] = createMarker(tmpLatLng,"",iconRd);
Lexington[tmpLen].point = tmpLatLng;
mySelect.options[mySelect.options.length] = new Option("Wentworth Military Academy",'Lexington=' + Lexington.length);
map.removeOverlays(Cape_Girardeau);
map.removeOverlays(Cottleville);
map.removeOverlays(Fenton);
map.removeOverlays(Hazelwood);
map.removeOverlays(Hillsboro);
map.removeOverlays(Jefferson_City);
map.removeOverlays(Kansas_City);
map.removeOverlays(Kirkwood);
map.removeOverlays(Lees_Summit);
map.removeOverlays(Lexington);
map.removeOverlays(Linn);
map.removeOverlays(Moberly);
map.removeOverlays(Neosho);
map.removeOverlays(Nevada);
map.removeOverlays(North_Kansas_City);
map.removeOverlays(Park_Hills);
map.removeOverlays(Poplar_Bluff);
map.removeOverlays(Rolla);
map.removeOverlays(Sain_Peters);
map.removeOverlays(Saint_Ann);
map.removeOverlays(Saint_Joseph);
map.removeOverlays(Saint_Louis);
map.removeOverlays(Sedalia);
map.removeOverlays(Springfield);
map.removeOverlays(Sunset_Hills);
map.removeOverlays(Trenton);
map.removeOverlays(Union);
map.removeOverlays(West_Plains);
setTimeout(function(){map.addOverlays(Cape_Girardeau)},1000);
setTimeout(function(){map.addOverlays(Cottleville)},1000);
setTimeout(function(){map.addOverlays(Fenton)},1000);
setTimeout(function(){map.addOverlays(Hazelwood)},1000);
setTimeout(function(){map.addOverlays(Hillsboro)},1000);
setTimeout(function(){map.addOverlays(Jefferson_City)},1000);
setTimeout(function(){map.addOverlays(Kansas_City)},1000);
setTimeout(function(){map.addOverlays(Kirkwood)},1000);
setTimeout(function(){map.addOverlays(Lees_Summit)},1000);
setTimeout(function(){map.addOverlays(Lexington)},1000);
setTimeout(function(){map.addOverlays(Linn)},1000);
setTimeout(function(){map.addOverlays(Moberly)},1000);
setTimeout(function(){map.addOverlays(Neosho)},1000);
setTimeout(function(){map.addOverlays(Nevada)},1000);
setTimeout(function(){map.addOverlays(North_Kansas_City)},1000);
setTimeout(function(){map.addOverlays(Park_Hills)},1000);
setTimeout(function(){map.addOverlays(Poplar_Bluff)},1000);
setTimeout(function(){map.addOverlays(Rolla)},1000);
setTimeout(function(){map.addOverlays(Sain_Peters)},1000);
setTimeout(function(){map.addOverlays(Saint_Ann)},1000);
setTimeout(function(){map.addOverlays(Saint_Joseph)},1000);
setTimeout(function(){map.addOverlays(Saint_Louis)},1000);
setTimeout(function(){map.addOverlays(Sedalia)},1000);
setTimeout(function(){map.addOverlays(Springfield)},1000);
setTimeout(function(){map.addOverlays(Sunset_Hills)},1000);
setTimeout(function(){map.addOverlays(Trenton)},1000);
setTimeout(function(){map.addOverlays(Union)},1000);
setTimeout(function(){map.addOverlays(West_Plains)},1000);
getPoly("","state","","MO");}
// 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(Cape_Girardeau);
map.removeOverlays(Cottleville);
map.removeOverlays(Fenton);
map.removeOverlays(Hazelwood);
map.removeOverlays(Hillsboro);
map.removeOverlays(Jefferson_City);
map.removeOverlays(Kansas_City);
map.removeOverlays(Kirkwood);
map.removeOverlays(Lees_Summit);
map.removeOverlays(Lexington);
map.removeOverlays(Linn);
map.removeOverlays(Moberly);
map.removeOverlays(Neosho);
map.removeOverlays(Nevada);
map.removeOverlays(North_Kansas_City);
map.removeOverlays(Park_Hills);
map.removeOverlays(Poplar_Bluff);
map.removeOverlays(Rolla);
map.removeOverlays(Sain_Peters);
map.removeOverlays(Saint_Ann);
map.removeOverlays(Saint_Joseph);
map.removeOverlays(Saint_Louis);
map.removeOverlays(Sedalia);
map.removeOverlays(Springfield);
map.removeOverlays(Sunset_Hills);
map.removeOverlays(Trenton);
map.removeOverlays(Union);
map.removeOverlays(West_Plains);
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(North_Kansas_City);map.removeOverlays(Cape_Girardeau);
map.removeOverlays(Cottleville);
map.removeOverlays(Fenton);
map.removeOverlays(Hazelwood);
map.removeOverlays(Hillsboro);
map.removeOverlays(Jefferson_City);
map.removeOverlays(Kansas_City);
map.removeOverlays(Kirkwood);
map.removeOverlays(Lees_Summit);
map.removeOverlays(Lexington);
map.removeOverlays(Linn);
map.removeOverlays(Moberly);
map.removeOverlays(Neosho);
map.removeOverlays(Nevada);
map.removeOverlays(North_Kansas_City);
map.removeOverlays(Park_Hills);
map.removeOverlays(Poplar_Bluff);
map.removeOverlays(Rolla);
map.removeOverlays(Sain_Peters);
map.removeOverlays(Saint_Ann);
map.removeOverlays(Saint_Joseph);
map.removeOverlays(Saint_Louis);
map.removeOverlays(Sedalia);
map.removeOverlays(Springfield);
map.removeOverlays(Sunset_Hills);
map.removeOverlays(Trenton);
map.removeOverlays(Union);
map.removeOverlays(West_Plains);
map.addOverlays(Cape_Girardeau);
centerByArray(Cape_Girardeau, false, false);
cntMarker += Cape_Girardeau.length;
map.addOverlays(Cottleville);
centerByArray(Cottleville, false, false);
cntMarker += Cottleville.length;
map.addOverlays(Fenton);
centerByArray(Fenton, false, false);
cntMarker += Fenton.length;
map.addOverlays(Hazelwood);
centerByArray(Hazelwood, false, false);
cntMarker += Hazelwood.length;
map.addOverlays(Hillsboro);
centerByArray(Hillsboro, false, false);
cntMarker += Hillsboro.length;
map.addOverlays(Jefferson_City);
centerByArray(Jefferson_City, false, false);
cntMarker += Jefferson_City.length;
map.addOverlays(Kansas_City);
centerByArray(Kansas_City, false, false);
cntMarker += Kansas_City.length;
map.addOverlays(Kirkwood);
centerByArray(Kirkwood, false, false);
cntMarker += Kirkwood.length;
map.addOverlays(Lees_Summit);
centerByArray(Lees_Summit, false, false);
cntMarker += Lees_Summit.length;
map.addOverlays(Lexington);
centerByArray(Lexington, false, false);
cntMarker += Lexington.length;
map.addOverlays(Linn);
centerByArray(Linn, false, false);
cntMarker += Linn.length;
map.addOverlays(Moberly);
centerByArray(Moberly, false, false);
cntMarker += Moberly.length;
map.addOverlays(Neosho);
centerByArray(Neosho, false, false);
cntMarker += Neosho.length;
map.addOverlays(Nevada);
centerByArray(Nevada, false, false);
cntMarker += Nevada.length;
map.addOverlays(North_Kansas_City);
centerByArray(North_Kansas_City, false, false);
cntMarker += North_Kansas_City.length;
map.addOverlays(Park_Hills);
centerByArray(Park_Hills, false, false);
cntMarker += Park_Hills.length;
map.addOverlays(Poplar_Bluff);
centerByArray(Poplar_Bluff, false, false);
cntMarker += Poplar_Bluff.length;
map.addOverlays(Rolla);
centerByArray(Rolla, false, false);
cntMarker += Rolla.length;
map.addOverlays(Sain_Peters);
centerByArray(Sain_Peters, false, false);
cntMarker += Sain_Peters.length;
map.addOverlays(Saint_Ann);
centerByArray(Saint_Ann, false, false);
cntMarker += Saint_Ann.length;
map.addOverlays(Saint_Joseph);
centerByArray(Saint_Joseph, false, false);
cntMarker += Saint_Joseph.length;
map.addOverlays(Saint_Louis);
centerByArray(Saint_Louis, false, false);
cntMarker += Saint_Louis.length;
map.addOverlays(Sedalia);
centerByArray(Sedalia, false, false);
cntMarker += Sedalia.length;
map.addOverlays(Springfield);
centerByArray(Springfield, false, false);
cntMarker += Springfield.length;
map.addOverlays(Sunset_Hills);
centerByArray(Sunset_Hills, false, false);
cntMarker += Sunset_Hills.length;
map.addOverlays(Trenton);
centerByArray(Trenton, false, false);
cntMarker += Trenton.length;
map.addOverlays(Union);
centerByArray(Union, false, false);
cntMarker += Union.length;
map.addOverlays(West_Plains);
centerByArray(West_Plains, false, false);
cntMarker += West_Plains.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;
}