function addMarkers()
{
mySelect = document.getElementById('selection');
Pompano_Beach = [];Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.13076782,26.24290848),"
",iconGr);
mySelect.options[mySelect.options.length] = new Option("Blanche Ely High School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.12366486,26.27905846),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Bright Horizons",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.20726776,26.20486069),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Broadview Elementary School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-82.46710100,29.05127800),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Broward Children's Center",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-82.08665700,29.07122800),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Broward Children's Center North",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.15206909,26.26818848),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Broward Intensive Halfway",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.16560364,26.24073792),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Charles Drew Elementary School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.11206818,26.26195717),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cresthavenuen Elementary School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.16558838,26.24082565),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Cross Creek School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.11962128,26.27447510),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Crystal Lake Community Middle School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.12746429,26.21888733),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Cypress Elementary School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.15351105,26.25305939),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Cypress Run Alternative/ese",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.12583160,26.22936058),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Dave Thomas Education Center",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.09826300,26.28182000),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Eagles Nest Elementary Charter School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.09826300,26.28182000),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Eagles Nest Middle Charter School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.11031342,26.21272278),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Mcnab Elementary School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.10216522,26.27952766),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Norcrest Elementary School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.12316895,26.26615715),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Palmview Elementary School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.13591700,26.27140100),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Paragon Elementary Charter School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.11176300,26.29515648),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Park Ridge Elementary School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.11076355,26.23805809),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Pompano Beach Elementary School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.10958099,26.23698425),"",iconGr);
mySelect.options[mySelect.options.length] = new Option("Pompano Beach High School Institute",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.12085724,26.23695946),"",iconBl);
mySelect.options[mySelect.options.length] = new Option("Pompano Beach Middle School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.14347076,26.24565887),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Robert C. Markham Elementary School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.13211823,26.24925995),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Sanders Park Elementary School",'Pompano_Beach=' + Pompano_Beach.length);
Pompano_Beach[Pompano_Beach.length] = createMarker(new GPoint(-80.12374878,26.28249359),"",iconRd);
mySelect.options[mySelect.options.length] = new Option("Tedder Elementary School",'Pompano_Beach=' + Pompano_Beach.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(Pompano_Beach);
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(Pompano_Beach);map.removeOverlays(Pompano_Beach);
map.addOverlays(Pompano_Beach);
centerByArray(Pompano_Beach, false, false);
cntMarker += Pompano_Beach.length;
centerByArray(Pompano_Beach,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');
}
}