function addMarkers() { mySelect = document.getElementById('selection'); Jeffersonville = [];Charlestown = [];Clarksville = [];Henryville = [];New_Washington = [];Sellersburg = [];Borden = [];mySelect.options[mySelect.options.length] = new Option("Borden schools",'all=Borden'); mySelect.options[mySelect.options.length] = new Option("Charlestown schools",'all=Charlestown'); mySelect.options[mySelect.options.length] = new Option("Clarksville schools",'all=Clarksville'); mySelect.options[mySelect.options.length] = new Option("Henryville schools",'all=Henryville'); mySelect.options[mySelect.options.length] = new Option("Jeffersonville schools",'all=Jeffersonville'); mySelect.options[mySelect.options.length] = new Option("New Washington schools",'all=New_Washington'); mySelect.options[mySelect.options.length] = new Option("Sellersburg schools",'all=Sellersburg'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Jeffersonville[Jeffersonville.length] = createMarker(new GPoint(-85.70931244,38.29023743),"
Bridgepoint Elementary School
420 Ewing Ln
Jeffersonville, IN 47130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bridgepoint Elementary School",'Jeffersonville=' + Jeffersonville.length); Charlestown[Charlestown.length] = createMarker(new GPoint(-85.67226410,38.43494415),"
Charlestown Middle School
8804 High Jackson Rd
Charlestown, IN 47111

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Charlestown Middle School",'Charlestown=' + Charlestown.length); Charlestown[Charlestown.length] = createMarker(new GPoint(-85.66605377,38.45336151),"
Charlestown Senior High School
1 Pirate Pl
Charlestown, IN 47111

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Charlestown Senior High School",'Charlestown=' + Charlestown.length); Clarksville[Clarksville.length] = createMarker(new GPoint(-85.76456451,38.30259705),"
Clarksville Middle School
101 Ettels Ln
Clarksville, IN 47129

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Clarksville Middle School",'Clarksville=' + Clarksville.length); Clarksville[Clarksville.length] = createMarker(new GPoint(-85.76856232,38.29927063),"
Clarksville Senior High School
800 High School Dr
Clarksville, IN 47129

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clarksville Senior High School",'Clarksville=' + Clarksville.length); Jeffersonville[Jeffersonville.length] = createMarker(new GPoint(-85.73602295,38.27749252),"
Corden Porter Edu Center
601 E Court Ave
Jeffersonville, IN 47130

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Corden Porter Edu Center",'Jeffersonville=' + Jeffersonville.length); Clarksville[Clarksville.length] = createMarker(new GPoint(-85.75348663,38.28456879),"
George Rogers Clark Elementary School
435 W Stansifer Ave
Clarksville, IN 47129

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George Rogers Clark Elementary School",'Clarksville=' + Clarksville.length); Clarksville[Clarksville.length] = createMarker(new GPoint(-85.76864624,38.29669189),"
Greenacres Elementary School
700 N Randolph Ave
Clarksville, IN 47129

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Greenacres Elementary School",'Clarksville=' + Clarksville.length); Henryville[Henryville.length] = createMarker(new GPoint(-85.76837158,38.54280472),"
Henryville Elementary School
213 N Ferguson St
Henryville, IN 47126

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Henryville Elementary School",'Henryville=' + Henryville.length); Henryville[Henryville.length] = createMarker(new GPoint(-85.76837158,38.54280472),"
Henryville Junior & Senior High School
213 N Ferguson St
Henryville, IN 47126

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Henryville Junior & Senior High School",'Henryville=' + Henryville.length); Jeffersonville[Jeffersonville.length] = createMarker(new GPoint(-85.73654175,38.27820206),"
Instr Srvs Cntr-options Alt Prog
630 Meigs Ave
Jeffersonville, IN 47130

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Instr Srvs Cntr-options Alt Prog",'Jeffersonville=' + Jeffersonville.length); Jeffersonville[Jeffersonville.length] = createMarker(new GPoint(-85.70838928,38.31753540),"
Jeffersonville High School
2315 Allison Ln
Jeffersonville, IN 47130

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jeffersonville High School",'Jeffersonville=' + Jeffersonville.length); Charlestown[Charlestown.length] = createMarker(new GPoint(-85.66515350,38.44596863),"
Jonathan Jennings Elementary School
603 Market St
Charlestown, IN 47111

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jonathan Jennings Elementary School",'Charlestown=' + Charlestown.length); Jeffersonville[Jeffersonville.length] = createMarker(new GPoint(-85.72772980,38.28035736),"
Maple Elementary School
429 Division St
Jeffersonville, IN 47130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Maple Elementary School",'Jeffersonville=' + Jeffersonville.length); New_Washington[New_Washington.length] = createMarker(new GPoint(-85.48619843,38.54909897),"
New Washington Elementary School
Po Box 130 - 224 Poplar
New Washington, IN 47162

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Washington Elementary School",'New_Washington=' + New_Washington.length); New_Washington[New_Washington.length] = createMarker(new GPoint(-85.54209900,38.55080032),"
New Washington Middle/high School
226 N Hwy 62
New Washington, IN 47162

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Washington Middle/high School",'New_Washington=' + New_Washington.length); Jeffersonville[Jeffersonville.length] = createMarker(new GPoint(-85.72470856,38.30810547),"
Northaven Elementary School
1907 Oak Ridge Dr
Jeffersonville, IN 47130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northaven Elementary School",'Jeffersonville=' + Jeffersonville.length); Jeffersonville[Jeffersonville.length] = createMarker(new GPoint(-85.72225952,38.28731537),"
Parkview Middle School
1600 Brigman Ave
Jeffersonville, IN 47130

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Parkview Middle School",'Jeffersonville=' + Jeffersonville.length); Clarksville[Clarksville.length] = createMarker(new GPoint(-85.77427673,38.32566833),"
Parkwood Elementary School
748 Spicewood Dr
Clarksville, IN 47129

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Parkwood Elementary School",'Clarksville=' + Clarksville.length); Charlestown[Charlestown.length] = createMarker(new GPoint(-85.66806030,38.45983505),"
Pleasant Ridge Elementary School
1250 Monroe St
Charlestown, IN 47111

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Ridge Elementary School",'Charlestown=' + Charlestown.length); Jeffersonville[Jeffersonville.length] = createMarker(new GPoint(-85.73609161,38.32830048),"
River Valley Middle School
2220 New Albany-charlestown Rd
Jeffersonville, IN 47130

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("River Valley Middle School",'Jeffersonville=' + Jeffersonville.length); Jeffersonville[Jeffersonville.length] = createMarker(new GPoint(-85.69354248,38.31056213),"
Riverside Elementary School
17 Laurel Dr
Jeffersonville, IN 47130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverside Elementary School",'Jeffersonville=' + Jeffersonville.length); Sellersburg[Sellersburg.length] = createMarker(new GPoint(-85.76339722,38.38769913),"
Sellersburg Elementary School
206 N New Albany St
Sellersburg, IN 47172

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sellersburg Elementary School",'Sellersburg=' + Sellersburg.length); Sellersburg[Sellersburg.length] = createMarker(new GPoint(-85.75387573,38.40354919),"
Silver Creek Elementary School
503 N Indiana Ave
Sellersburg, IN 47172

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Silver Creek Elementary School",'Sellersburg=' + Sellersburg.length); Sellersburg[Sellersburg.length] = createMarker(new GPoint(-85.75351715,38.40856552),"
Silver Creek High School
557 Renz Ave
Sellersburg, IN 47172

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Silver Creek High School",'Sellersburg=' + Sellersburg.length); Sellersburg[Sellersburg.length] = createMarker(new GPoint(-85.75391388,38.40342712),"
Silver Creek Middle School
495 N Indiana Ave
Sellersburg, IN 47172

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Silver Creek Middle School",'Sellersburg=' + Sellersburg.length); Jeffersonville[Jeffersonville.length] = createMarker(new GPoint(-85.74777222,38.28617477),"
Spring Hill Elementary School
201 E 15th St
Jeffersonville, IN 47130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Spring Hill Elementary School",'Jeffersonville=' + Jeffersonville.length); Jeffersonville[Jeffersonville.length] = createMarker(new GPoint(-85.74468994,38.30578613),"
Thomas Jefferson Elementary School
2710 Hamburg Pike
Jeffersonville, IN 47130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Thomas Jefferson Elementary School",'Jeffersonville=' + Jeffersonville.length); Jeffersonville[Jeffersonville.length] = createMarker(new GPoint(-85.68003845,38.33655548),"
Utica Elementary School
210 Maplehurst Dr
Jeffersonville, IN 47130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Utica Elementary School",'Jeffersonville=' + Jeffersonville.length); Jeffersonville[Jeffersonville.length] = createMarker(new GPoint(-85.72460175,38.33336639),"
W E Wilson Elementary School
2915 Charlestown Pk
Jeffersonville, IN 47130

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("W E Wilson Elementary School",'Jeffersonville=' + Jeffersonville.length); Borden[Borden.length] = createMarker(new GPoint(-85.94641876,38.46928024),"
William W Borden Elementary School
303 West St
Borden, IN 47106

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("William W Borden Elementary School",'Borden=' + Borden.length); Borden[Borden.length] = createMarker(new GPoint(-85.94641876,38.46928024),"
William W Borden High School
301 West St
Borden, IN 47106

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("William W Borden High School",'Borden=' + Borden.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(Borden); map.removeOverlays(Charlestown); map.removeOverlays(Clarksville); map.removeOverlays(Henryville); map.removeOverlays(Jeffersonville); map.removeOverlays(New_Washington); map.removeOverlays(Sellersburg); 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(Jeffersonville);map.removeOverlays(Borden); map.removeOverlays(Charlestown); map.removeOverlays(Clarksville); map.removeOverlays(Henryville); map.removeOverlays(Jeffersonville); map.removeOverlays(New_Washington); map.removeOverlays(Sellersburg); map.addOverlays(Borden); centerByArray(Borden, false, false); cntMarker += Borden.length; map.addOverlays(Charlestown); centerByArray(Charlestown, false, false); cntMarker += Charlestown.length; map.addOverlays(Clarksville); centerByArray(Clarksville, false, false); cntMarker += Clarksville.length; map.addOverlays(Henryville); centerByArray(Henryville, false, false); cntMarker += Henryville.length; map.addOverlays(Jeffersonville); centerByArray(Jeffersonville, false, false); cntMarker += Jeffersonville.length; map.addOverlays(New_Washington); centerByArray(New_Washington, false, false); cntMarker += New_Washington.length; map.addOverlays(Sellersburg); centerByArray(Sellersburg, false, false); cntMarker += Sellersburg.length; centerByArray(Jeffersonville,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'); } }