function addMarkers() { mySelect = document.getElementById('selection'); Wichita = [];Kansas_City = [];mySelect.options[mySelect.options.length] = new Option("Kansas City magnet schools",'all=Kansas_City'); mySelect.options[mySelect.options.length] = new Option("Wichita magnet schools",'all=Wichita'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Wichita[Wichita.length] = createMarker(new GPoint(-97.35301971,37.68275833),"
Allison Traditional Magnet Middle School
221 S Seneca
Wichita, KS 67213

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Allison Traditional Magnet Middle School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.38390350,37.70252991),"
Black Traditional Magnet Elementary School
1045 High
Wichita, KS 67203

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Black Traditional Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.24277496,37.67561340),"
Bostic Traditional Magnet Elementary School
8103 E Gilbert
Wichita, KS 67207

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bostic Traditional Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.29206085,37.73375702),"
Brooks Magnet Middle School
3802 E 27th N
Wichita, KS 67220

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Brooks Magnet Middle School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.39735413,37.70164490),"
Bryant Core Knowledge Magnet Elementary School
4702 W Ninth
Wichita, KS 67212

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bryant Core Knowledge Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.29489136,37.73371124),"
Buckner Performing Arts Magnet Elementary School
3530 E 27th N
Wichita, KS 67220

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Buckner Performing Arts Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.31500244,37.61750031),"
Carlton Math Science Magnet Elementary School
4900 S Clifton
Wichita, KS 67216

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Carlton Math Science Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.38146210,37.63325882),"
Cleaveland Traditional Magnet Elementary School
3345 W 33rd S
Wichita, KS 67217

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cleaveland Traditional Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.43830109,37.70270157),"
Dodge Literacy Magnet Elementary School
4801 W 2nd
Wichita, KS 67212

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dodge Literacy Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.39859772,37.68744278),"
Dodge/edison Partnership Elementary School
4801 W 2nd
Wichita, KS 67212

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dodge/edison Partnership Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.34490967,37.75329590),"
Earhart Environ Magnet Elementary School
4401 N Arkansas
Wichita, KS 67204

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Earhart Environ Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.36934662,37.71223068),"
Emerson Open Magnet Elementary School
2330 W 15th
Wichita, KS 67203

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Emerson Open Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.33687592,37.70520020),"
Horace Mann Foreign Language Elementary Magnet
1243 N Market
Wichita, KS 67214

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Horace Mann Foreign Language Elementary Magnet",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.28052521,37.68853760),"
Hyde Intl Studies/commun Elementary Magnet
210 N Oliver
Wichita, KS 67208

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hyde Intl Studies/commun Elementary Magnet",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.30918121,37.70276260),"
Ingalls Edison Academy
2316 E 10th
Wichita, KS 67214

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ingalls Edison Academy",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.30682373,37.71743774),"
Isely Traditional Magnet Elementary School
2500 E 18th St
Wichita, KS 67214

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Isely Traditional Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.26779938,37.63259888),"
Jardine Middle School Magnet
3550 Ross Parkway
Wichita, KS 67210

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Jardine Middle School Magnet",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.29502869,37.64191818),"
Jardine/edison Partnership Middle School
3550 Ross Parkway
Wichita, KS 67210

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Jardine/edison Partnership Middle School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.32341766,37.67927551),"
Kellogg Science/tech Magnet Elementary School
1220 E Kellogg
Wichita, KS 67211

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kellogg Science/tech Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.31671900,37.70447500),"
L'ouverture Computer Technology Magnet
01539 N Ohio
Wichita, KS 67214

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("L'ouverture Computer Technology Magnet",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.34802246,37.63966751),"
Lewis Open Magnet Elementary School
3030 S Osage
Wichita, KS 67217

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lewis Open Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.38034821,37.68206787),"
Mayberry Magnet Middle School
207 S Sheridan
Wichita, KS 67213

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Mayberry Magnet Middle School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.36721039,37.72492599),"
Mclean Science/tech Magnet Elementary School
2277 Marigold Lane
Wichita, KS 67204

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mclean Science/tech Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.22618103,37.69885254),"
Minneha Elementary School
701 N Webb Road
Wichita, KS 67206

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Minneha Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.30130768,37.71637726),"
Northeast Magnet/downtown Campus High School
1847 N Chautauqua
Wichita, KS 67214

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Northeast Magnet/downtown Campus High School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.25386900,37.70001100),"
Price/harris Communications Magnet
706 N Armour Dr
Wichita, KS 67206

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Price/harris Communications Magnet",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.26547400,37.70560500),"
Price/harris Communications Magnet Elementary School
6123 E 11th
Wichita, KS 67208

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Price/harris Communications Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.35788727,37.70117950),"
Riverside Cultural Arts / History Magnet Elementary School
1001 Porter
Wichita, KS 67203

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Riverside Cultural Arts / History Magnet Elementary School",'Wichita=' + Wichita.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.30898285,37.70283890),"
Spaght Accelerated Magnet Academy
2316 E 10th
Wichita, KS 67214

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Spaght Accelerated Magnet Academy",'Wichita=' + Wichita.length); Kansas_City[Kansas_City.length] = createMarker(new GPoint(-94.62977600,39.12201691),"
Sumner Academy Of Arts & Science
1610 N 8th Street
Kansas City, KS 66101

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sumner Academy Of Arts & Science",'Kansas_City=' + Kansas_City.length); Wichita[Wichita.length] = createMarker(new GPoint(-97.35173798,37.71355438),"
Woodland Health / Wellness Magnet Elementary Schoo
1705 Salina
Wichita, KS 67203

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodland Health / Wellness Magnet Elementary Schoo",'Wichita=' + Wichita.length); maxLng = -94.62977600; maxLat = 39.12201691; minLng = -97.43830109; minLat = 37.61750031; reCenterMap(); map.removeOverlays(Kansas_City); map.removeOverlays(Wichita); setTimeout(function(){map.addOverlays(Kansas_City)},1000); setTimeout(function(){map.addOverlays(Wichita)},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(Kansas_City); map.removeOverlays(Wichita); 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(Wichita);map.removeOverlays(Kansas_City); map.removeOverlays(Wichita); map.addOverlays(Kansas_City); centerByArray(Kansas_City, false, false); cntMarker += Kansas_City.length; map.addOverlays(Wichita); centerByArray(Wichita, false, false); cntMarker += Wichita.length; centerByArray(Wichita,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'); } }