function addMarkers()
{
mySelect = document.getElementById('selection');
Shreveport = [];Shreveport[Shreveport.length] = createMarker(new GPoint(-93.72198486,32.46688080),"
",iconRd);
mySelect.options[mySelect.options.length] = new Option("A. C. Steere Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.74575806,32.44670105),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Alexander Learning Center",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.71958160,32.45945358),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Arthur Circle Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.75863647,32.43558121),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Atkins Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.75228119,32.48685074),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Barret Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.81217194,32.46405411),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Bethune Middle School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.89503479,32.57683945),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Blanchard Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.77384186,32.50355148),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Booker T. Washington High School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.77748871,32.54711914),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Bossier Parish Technical School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.73270416,32.46329117),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Broadmoor Middle Laboratory School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.74607849,32.48015213),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("C.e. Byrd High School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.77165985,32.45378113),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Caddo Career Center",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.76452637,32.46365356),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Caddo Heights Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.89215900,32.58144500),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Caddo Learning Center",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.76946259,32.44822311),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Caddo Middle Career And Technology School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.72013855,32.49615479),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Caddo Parish Magnet High School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.74419403,32.43592834),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Caddo Parish Middle Magnet School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.75875854,32.48003387),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Caddo School For Exceptional Children",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.70938110,32.45110703),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Captain Shreve High School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.76363373,32.50085068),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.75947571,32.54251099),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cherokee Park Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.77466583,32.47805405),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Claiborne Fundamental Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.74177551,32.48345184),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Creswell Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.87306213,32.60873413),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Donnie Bickham Middle School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.72079468,32.49175262),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("E.b. Williams Stoner Hill Elementary Lab School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.74337769,32.43049622),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eden Gardens Fundamental Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.75006866,32.43067932),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eighty-first Street Ece Center",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.78882599,32.47901917),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Fair Park High School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.74997711,32.44923782),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Fairfield Magnet School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.78997803,32.39410400),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Forest Hill Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.81401062,32.55405045),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Green Oaks High School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.74493408,32.50193787),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Hamilton Terrace Learning Center",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.82472992,32.47370529),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Hillsdale Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.85818481,32.44391632),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Huntington High School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.75102234,32.52534866),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Ingersoll Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.78028107,32.50915146),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("J. S. Clark Middle School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.97512054,32.54804993),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Jack P. Timmons Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.79929352,32.48850632),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Judson Fundamental Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.79297638,32.49439621),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Lakeshore Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.81568146,32.54634094),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Linear Middle School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.76297760,32.44185257),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Linwood Middle School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.80381775,32.47170639),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Midway Professional Development Center",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.80183411,32.45275116),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mooretown Elementary Professional Develop. School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.82896423,32.54373550),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Newton Smith Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.78250122,32.57304764),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("North Highlands Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.79817963,32.54178619),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Northside Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.84329224,32.60206604),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Northwood High School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.82018280,32.46037674),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Oak Park Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.79336548,32.44502258),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Oak Terrace/j.b. Harville Alternative School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.81478119,32.55048752),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pine Grove Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.78018188,32.48665237),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Queensborough Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.78938293,32.39975357),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Ridgewood Middle School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.76770020,32.48809814),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Right Step Academy Of Excellence",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.69447327,32.45775223),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Riverside Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.71172333,32.47843933),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Shreve Island Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.78272247,32.49176407),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Shreveport Job Corps Opportunity Center",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.73844147,32.46043777),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("South Highlands Elementary Magnet School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.78008270,32.40291977),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Southern Hills Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.81448364,32.41045380),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Southwood High School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.80809784,32.40206146),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Summer Grove Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.81741333,32.38620758),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Summerfield Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.78603363,32.44775391),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sunset Acres Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.85537720,32.44233704),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Turner Elementary Middle School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.70271301,32.41405487),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("University Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.90013123,32.39080429),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Walnut Hill Elementary Middle School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.78005981,32.46355438),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Werner Park Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.77557373,32.50019455),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("West Shreveport Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.79713440,32.43637848),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Westwood Elementary School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.77375793,32.43717194),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Woodlawn High School",'Shreveport=' + Shreveport.length);
Shreveport[Shreveport.length] = createMarker(new GPoint(-93.72225952,32.45288849),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Youree Drive Middle School",'Shreveport=' + Shreveport.length);
maxLng = -93.69447327;
maxLat = 32.60873413;
minLng = -93.97512054;
minLat = 32.38620758;
reCenterMap();
} // 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(Shreveport);
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(Shreveport);map.removeOverlays(Shreveport);
map.addOverlays(Shreveport);
centerByArray(Shreveport, false, false);
cntMarker += Shreveport.length;
centerByArray(Shreveport,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');
}
}