function addMarkers() { mySelect = document.getElementById('selection'); Lake_City = [];Fort_White = [];mySelect.options[mySelect.options.length] = new Option("Fort White schools",'all=Fort_White'); mySelect.options[mySelect.options.length] = new Option("Lake City schools",'all=Lake_City'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.66230011,30.19589996),"
Challenge Learning Center
1301 Nw Labonte Lane
Lake City, FL 32055

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Challenge Learning Center",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.65632629,30.19411659),"
Challenge Learning Center (formerly Kin
2683 W Leon St
Lake City, FL 32055

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Challenge Learning Center (formerly Kin",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.63857269,30.18939018),"
Columbia City Elementary School
7438 Sw State Road 47
Lake City, FL 32024

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Columbia City Elementary School",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-81.48692500,28.56840600),"
Columbia County Superintendent's Office
0372 W Duval Street
Lake City, FL 32055

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Columbia County Superintendent's Office",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.63857269,30.18939018),"
Columbia High School
469 Fighting Tiger Drive
Lake City, FL 32025

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Columbia High School",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.60630035,30.29879951),"
Damascus Road Project
519 E. Washington St.
Lake City, FL 32056

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Damascus Road Project",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.60715485,30.18523216),"
Eastside Elementary School
256 Se Beech Street
Lake City, FL 32025

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Eastside Elementary School",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.63857269,30.18939018),"
Five Points Elementary School
303 Nw Johnson Street
Lake City, FL 32055

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Five Points Elementary School",'Lake_City=' + Lake_City.length); Fort_White[Fort_White.length] = createMarker(new GPoint(-82.69589996,29.93589973),"
Fort White Elementary School
18119 Sw State Road 47
Fort White, FL 32038

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fort White Elementary School",'Fort_White=' + Fort_White.length); Fort_White[Fort_White.length] = createMarker(new GPoint(-82.69589996,29.93589973),"
Fort White High School
17828 Sw State Road 47
Fort White, FL 32038

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fort White High School",'Fort_White=' + Fort_White.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.63857269,30.18939018),"
Lake City Middle School
843 Sw Arlington Blvd.
Lake City, FL 32025

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lake City Middle School",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.63069153,30.18535042),"
Melrose Park Elementary School
820 Se Putnam Street
Lake City, FL 32025

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Melrose Park Elementary School",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.62897491,30.20007133),"
Niblack Elementary School
837 Ne Broadway Avenue
Lake City, FL 32055

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Niblack Elementary School",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.62817383,30.20015526),"
Niblack Elementary School (formerly Niblack Middl
1500 N Broadway St
Lake City, FL 32055

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Niblack Elementary School (formerly Niblack Middl",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.62709808,30.18199921),"
Richardson Middle School
646 Se Pennsylvania St.
Lake City, FL 32025

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Richardson Middle School",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.63021851,30.18189240),"
Richardson Middle School (formerly Columbia High S
1000 Pennsylvania Ave
Lake City, FL 32025

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Richardson Middle School (formerly Columbia High S",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.64910126,30.18075943),"
Summers Elementary School
1388 Sw Mcfarlane Avenue
Lake City, FL 32025

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Summers Elementary School",'Lake_City=' + Lake_City.length); Lake_City[Lake_City.length] = createMarker(new GPoint(-82.63857269,30.18939018),"
Westside Elementary School
1956 Sw Cr 252b
Lake City, FL 32024

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westside Elementary School",'Lake_City=' + Lake_City.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(Fort_White); map.removeOverlays(Lake_City); 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(Lake_City);map.removeOverlays(Fort_White); map.removeOverlays(Lake_City); map.addOverlays(Fort_White); centerByArray(Fort_White, false, false); cntMarker += Fort_White.length; map.addOverlays(Lake_City); centerByArray(Lake_City, false, false); cntMarker += Lake_City.length; centerByArray(Lake_City,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'); } }