function addMarkers() { mySelect = document.getElementById('selection'); Indianapolis = [];Fort_Wayne = [];Elkhart = [];mySelect.options[mySelect.options.length] = new Option("Elkhart magnet schools",'all=Elkhart'); mySelect.options[mySelect.options.length] = new Option("Fort Wayne magnet schools",'all=Fort_Wayne'); mySelect.options[mySelect.options.length] = new Option("Indianapolis magnet schools",'all=Indianapolis'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.06481934,39.84334564),"
Arlington High School
4825 N Arlington Ave
Indianapolis, IN 46226

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Arlington High School",'Indianapolis=' + Indianapolis.length); Fort_Wayne[Fort_Wayne.length] = createMarker(new GPoint(-85.12290955,41.06623840),"
Bunche Elementary School
1111 Greene St
Fort Wayne, IN 46803

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bunche Elementary School",'Fort_Wayne=' + Fort_Wayne.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.15022278,39.77735901),"
Center For Inquiry
725 N New Jersey St
Indianapolis, IN 46202

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Center For Inquiry",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.01609802,39.83053589),"
Charles W Fairbanks School 105
8620 Montery Rd
Indianapolis, IN 46226

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Charles W Fairbanks School 105",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.20217896,39.82028580),"
Cold Spring School
3650 Cold Spring Rd
Indianapolis, IN 46222

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cold Spring School",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.11105347,39.83327866),"
Edgar H Evans School 11
3202 E 42nd St
Indianapolis, IN 46205

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edgar H Evans School 11",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.11209869,39.73910141),"
Emma Donnan Middle School
1202 E Troy Ave
Indianapolis, IN 46203

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Emma Donnan Middle School",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-85.96700287,39.88830185),"
Forest Glen Elementary School
6333 Lee Rd
Indianapolis, IN 46236

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Forest Glen Elementary School",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.13667297,39.80051422),"
Frances W Parker School 56
2353 Columbia Ave
Indianapolis, IN 46205

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Frances W Parker School 56",'Indianapolis=' + Indianapolis.length); Fort_Wayne[Fort_Wayne.length] = createMarker(new GPoint(-85.05603790,41.11322784),"
Fred H Croninger Elementary School
6700 Trier Rd
Fort Wayne, IN 46815

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fred H Croninger Elementary School",'Fort_Wayne=' + Fort_Wayne.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.15808105,39.76789856),"
George W Carver School 87
2411 Indpls Ave
Indianapolis, IN 46208

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George W Carver School 87",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-85.97543335,39.85566330),"
Indian Creek Elementary School
10833 E 56th St
Indianapolis, IN 46236

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Indian Creek Elementary School",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-85.98851013,39.82616425),"
John Marshall Middle School
10101 E 38th St
Indianapolis, IN 46236

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John Marshall Middle School",'Indianapolis=' + Indianapolis.length); Fort_Wayne[Fort_Wayne.length] = createMarker(new GPoint(-85.11341858,41.05329895),"
John S Irwin Elementary School
3501 S Anthony Blvd
Fort Wayne, IN 46806

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("John S Irwin Elementary School",'Fort_Wayne=' + Fort_Wayne.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.12144470,39.81856537),"
Joyce Kilmer School 69
3421 N Keystone Ave
Indianapolis, IN 46218

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Joyce Kilmer School 69",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.17622375,39.75703049),"
Key Learning Community
777 S White River Pkwy W Dr
Indianapolis, IN 46221

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Key Learning Community",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.11009216,39.73803711),"
Margaret Mcfarland Middle School
3200 E Raymond St
Indianapolis, IN 46203

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Margaret Mcfarland Middle School",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.13520050,39.82749939),"
Mary E Nicholson School 70
510 E 46th St
Indianapolis, IN 46205

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mary E Nicholson School 70",'Indianapolis=' + Indianapolis.length); Fort_Wayne[Fort_Wayne.length] = createMarker(new GPoint(-85.10919952,41.07547379),"
Memorial Park Middle School
2200 Maumee Ave
Fort Wayne, IN 46803

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Memorial Park Middle School",'Fort_Wayne=' + Fort_Wayne.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.12769318,39.74836731),"
Otis E Brown School 20
1849 Plsnt Rn Pkw S Dr
Indianapolis, IN 46203

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Otis E Brown School 20",'Indianapolis=' + Indianapolis.length); Elkhart[Elkhart.length] = createMarker(new GPoint(-85.96373749,41.67376328),"
Roosevelt Elementary School
215 E Indiana Ave
Elkhart, IN 46516

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Elkhart=' + Elkhart.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.12641907,39.84566498),"
Rousseau Mc Clellan 91 Elementary School
5111 Evanston Ave
Indianapolis, IN 46205

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Rousseau Mc Clellan 91 Elementary School",'Indianapolis=' + Indianapolis.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.08471680,39.76913834),"
Thomas Carr Howe Academy
4900 Julian Ave
Indianapolis, IN 46201

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Thomas Carr Howe Academy",'Indianapolis=' + Indianapolis.length); Fort_Wayne[Fort_Wayne.length] = createMarker(new GPoint(-85.12519836,41.05746460),"
Weisser Park Elementary School
902 Colerick St
Fort Wayne, IN 46806

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Weisser Park Elementary School",'Fort_Wayne=' + Fort_Wayne.length); Fort_Wayne[Fort_Wayne.length] = createMarker(new GPoint(-85.10310364,41.07020187),"
Whitney M Young Early Childhood Elementary School
1026 E Pontiac St
Fort Wayne, IN 46803

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Whitney M Young Early Childhood Elementary School",'Fort_Wayne=' + Fort_Wayne.length); Indianapolis[Indianapolis.length] = createMarker(new GPoint(-86.15457916,39.81637192),"
William A Bell School 60
3330 N Pennsylvania
Indianapolis, IN 46205

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("William A Bell School 60",'Indianapolis=' + Indianapolis.length); maxLng = -85.05603790; maxLat = 41.67376328; minLng = -86.20217896; minLat = 39.73803711; reCenterMap(); map.removeOverlays(Elkhart); map.removeOverlays(Fort_Wayne); map.removeOverlays(Indianapolis); setTimeout(function(){map.addOverlays(Elkhart)},1000); setTimeout(function(){map.addOverlays(Fort_Wayne)},1000); setTimeout(function(){map.addOverlays(Indianapolis)},1000); } // 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(Elkhart); map.removeOverlays(Fort_Wayne); map.removeOverlays(Indianapolis); 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(Indianapolis);map.removeOverlays(Elkhart); map.removeOverlays(Fort_Wayne); map.removeOverlays(Indianapolis); map.addOverlays(Elkhart); centerByArray(Elkhart, false, false); cntMarker += Elkhart.length; map.addOverlays(Fort_Wayne); centerByArray(Fort_Wayne, false, false); cntMarker += Fort_Wayne.length; map.addOverlays(Indianapolis); centerByArray(Indianapolis, false, false); cntMarker += Indianapolis.length; centerByArray(Indianapolis,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'); } }