function addMarkers() { mySelect = document.getElementById('selection'); Bossier_City = [];Benton = [];Plain_Dealing = [];Elm_Grove = [];Haughton = [];Princeton = [];mySelect.options[mySelect.options.length] = new Option("Benton schools",'all=Benton'); mySelect.options[mySelect.options.length] = new Option("Bossier City schools",'all=Bossier_City'); mySelect.options[mySelect.options.length] = new Option("Elm Grove schools",'all=Elm_Grove'); mySelect.options[mySelect.options.length] = new Option("Haughton schools",'all=Haughton'); mySelect.options[mySelect.options.length] = new Option("Plain Dealing schools",'all=Plain_Dealing'); mySelect.options[mySelect.options.length] = new Option("Princeton schools",'all=Princeton'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.70929718,32.54872131),"
Airline High School
2801 Airline Drive
Bossier City, LA 71111

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Airline High School",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.72547913,32.55464935),"
Apollo Elementary School
2400 Viking Drive
Bossier City, LA 71111

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Apollo Elementary School",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.67797852,32.48607635),"
Bellaire Elementary School
1310 Bellaire Boulevard
Bossier City, LA 71112

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bellaire Elementary School",'Bossier_City=' + Bossier_City.length); Benton[Benton.length] = createMarker(new GPoint(-93.71733856,32.69705582),"
Benton Elementary School
562 Highway 162
Benton, LA 71006

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Benton Elementary School",'Benton=' + Benton.length); Benton[Benton.length] = createMarker(new GPoint(-93.74737549,32.66674423),"
Benton High School
6136 Highway 3
Benton, LA 71006

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Benton High School",'Benton=' + Benton.length); Benton[Benton.length] = createMarker(new GPoint(-93.74733734,32.66704559),"
Benton Middle School
6140 Highway 3
Benton, LA 71006

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Benton Middle School",'Benton=' + Benton.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.73748016,32.52194977),"
Bossier Elementary School
322 Colquitt Street
Bossier City, LA 71111

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bossier Elementary School",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.72884369,32.51845551),"
Bossier High School
777 Bearkat Drive
Bossier City, LA 71111

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bossier High School",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.73134613,32.52396774),"
Butler Educational Complex High School
541 Detroit Street
Bossier City, LA 71111

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Butler Educational Complex High School",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.72941589,32.52240372),"
Butler Elementary School
541 Detroit Street
Bossier City, LA 71111

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Butler Elementary School",'Bossier_City=' + Bossier_City.length); Plain_Dealing[Plain_Dealing.length] = createMarker(new GPoint(-93.68689728,32.91049957),"
Carrie Martin Elementary School
P O Box 386
Plain Dealing, LA 71064

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carrie Martin Elementary School",'Plain_Dealing=' + Plain_Dealing.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.71447754,32.51015091),"
Central Park Elementary School
900 Central Park Boulevard
Bossier City, LA 71112

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Park Elementary School",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.72055817,32.52165222),"
Charlotte Ann Mitchell Educational Center
1518 Cox Street
Bossier City, LA 71111

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charlotte Ann Mitchell Educational Center",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.66913605,32.54465103),"
Cope Middle School
4814 Shed Road
Bossier City, LA 71111

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Cope Middle School",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.65023041,32.44490051),"
Curtis Elementary School
5600 Barksdale Boulevard
Bossier City, LA 71112

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Curtis Elementary School",'Bossier_City=' + Bossier_City.length); Elm_Grove[Elm_Grove.length] = createMarker(new GPoint(-93.55853400,32.35332500),"
Elm Grove Middle School
P O Box 108
Elm Grove, LA 71051

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Elm Grove Middle School",'Elm_Grove=' + Elm_Grove.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.70386505,32.53045654),"
Greenacres Middle School
2220 Airline Drive
Bossier City, LA 71111

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Greenacres Middle School",'Bossier_City=' + Bossier_City.length); Haughton[Haughton.length] = createMarker(new GPoint(-93.49273682,32.53498077),"
Haughton High School
210 East Mckinley Avenue
Haughton, LA 71037

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Haughton High School",'Haughton=' + Haughton.length); Haughton[Haughton.length] = createMarker(new GPoint(-93.51592255,32.52002716),"
Haughton Middle School
395 South Elm Street
Haughton, LA 71037

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Haughton Middle School",'Haughton=' + Haughton.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.67028046,32.54415131),"
Johnny Gray Jones Youth Shltr & Detention Cntr
4815 Shed Road
Bossier City, LA 71111

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Johnny Gray Jones Youth Shltr & Detention Cntr",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.67958069,32.54298019),"
Life Skills Center
415 Monroe Street
Bossier City, LA 71111

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Life Skills Center",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.68107605,32.54244995),"
Meadowview Elementary School
4312 Shed Road
Bossier City, LA 71111

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Meadowview Elementary School",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.65511322,32.55980682),"
Northwest Developmental Center
5401 Shed Road
Bossier City, LA 71111

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northwest Developmental Center",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.67087555,32.47255325),"
Parkway High School
4301 Panther Drive
Bossier City, LA 71112

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parkway High School",'Bossier_City=' + Bossier_City.length); Plain_Dealing[Plain_Dealing.length] = createMarker(new GPoint(-93.68689728,32.91049957),"
Plain Dealing High School
300 East Vance Street
Plain Dealing, LA 71064

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Plain Dealing High School",'Plain_Dealing=' + Plain_Dealing.length); Plain_Dealing[Plain_Dealing.length] = createMarker(new GPoint(-93.68689728,32.91049957),"
Plain Dealing Middle School
300 East Vance Street
Plain Dealing, LA 71064

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Plain Dealing Middle School",'Plain_Dealing=' + Plain_Dealing.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.71549225,32.54126358),"
Plantation Park Elementary School
2410 Plantation Drive
Bossier City, LA 71111

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Plantation Park Elementary School",'Bossier_City=' + Bossier_City.length); Haughton[Haughton.length] = createMarker(new GPoint(-93.56805420,32.55614853),"
Platt Elementary School
4680 East Highway 80
Haughton, LA 71037

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Platt Elementary School",'Haughton=' + Haughton.length); Princeton[Princeton.length] = createMarker(new GPoint(-93.53257751,32.58648682),"
Princeton Elementary School
1895 Winfield Road
Princeton, LA 71067

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Princeton Elementary School",'Princeton=' + Princeton.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.69554138,32.51835251),"
R. V. Kerr Elementary School
1700 Airline Drive
Bossier City, LA 71112

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("R. V. Kerr Elementary School",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.70645905,32.54405212),"
Red River Marine Institute, Inc.
2890 Douglas Drive
Bossier City, LA 71111

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Red River Marine Institute, Inc.",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.70462036,32.51903152),"
Rusheon Middle School
2401 Old Minden Road
Bossier City, LA 71112

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Rusheon Middle School",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.64527893,32.56144714),"
Stockwell Place Elementary School
5801 Shed Road
Bossier City, LA 71111

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Stockwell Place Elementary School",'Bossier_City=' + Bossier_City.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.66756439,32.47517395),"
Sun City Elementary School
4230 Van Deeman Street
Bossier City, LA 71112

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sun City Elementary School",'Bossier_City=' + Bossier_City.length); Haughton[Haughton.length] = createMarker(new GPoint(-93.56838226,32.55613327),"
T.l. Rodes Elementary School
4670 East Highway 80
Haughton, LA 71037

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("T.l. Rodes Elementary School",'Haughton=' + Haughton.length); Bossier_City[Bossier_City.length] = createMarker(new GPoint(-93.69847870,32.50855255),"
Waller Elementary School
1130 Patricia Drive
Bossier City, LA 71112

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Waller Elementary School",'Bossier_City=' + Bossier_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(Benton); map.removeOverlays(Bossier_City); map.removeOverlays(Elm_Grove); map.removeOverlays(Haughton); map.removeOverlays(Plain_Dealing); map.removeOverlays(Princeton); 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(Bossier_City);map.removeOverlays(Benton); map.removeOverlays(Bossier_City); map.removeOverlays(Elm_Grove); map.removeOverlays(Haughton); map.removeOverlays(Plain_Dealing); map.removeOverlays(Princeton); map.addOverlays(Benton); centerByArray(Benton, false, false); cntMarker += Benton.length; map.addOverlays(Bossier_City); centerByArray(Bossier_City, false, false); cntMarker += Bossier_City.length; map.addOverlays(Elm_Grove); centerByArray(Elm_Grove, false, false); cntMarker += Elm_Grove.length; map.addOverlays(Haughton); centerByArray(Haughton, false, false); cntMarker += Haughton.length; map.addOverlays(Plain_Dealing); centerByArray(Plain_Dealing, false, false); cntMarker += Plain_Dealing.length; map.addOverlays(Princeton); centerByArray(Princeton, false, false); cntMarker += Princeton.length; centerByArray(Bossier_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'); } }