function addMarkers() { mySelect = document.getElementById('selection'); Olathe = [];Olathe[Olathe.length] = createMarker(new GPoint(-94.77241516,38.83455276),"
Arbor Creek Elementary School
16150 S Brougham
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Arbor Creek Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.76966095,38.86171722),"
Black Bob Elementary School
14701 S Brougham Dr
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Black Bob Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.76561737,38.87276459),"
Briarwood Elementary School
14101 S Brougham Dr
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Briarwood Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.77172089,38.84708023),"
Brougham Elementary School
15500 S Brougham Dr
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Brougham Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.74626923,38.88702774),"
California Trail Junior High School
13775 W 133 Street
Olathe, KS 66062

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("California Trail Junior High School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.77957916,38.84024429),"
Chisholm Trail Junior Middle School
16700 W. 159th Street
Olathe, KS 66062

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Chisholm Trail Junior Middle School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.77531433,38.90240097),"
Countryside Elementary School
15800 W 124th Terr
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Countryside Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.76351166,38.86908722),"
Frontier Trail Junior High School
15300 W 143rd Street
Olathe, KS 66062

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Frontier Trail Junior High School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.75687408,38.86234283),"
Green Springs Elementary School
14675 S Alden
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Green Springs Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.79148102,38.86946106),"
Havencroft Elementary School
1700 E Sheridan
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Havencroft Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.74690247,38.90602875),"
Heatherstone Elementary School
13745 W 123rd
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Heatherstone Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.78792572,38.85909653),"
Heritage Elementary School
1700 E Pawnee Dr
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Heritage Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.77996826,38.81107330),"
Hilltop Elementary School
16740 West 175th Street
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hilltop Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.76101685,38.89469147),"
Indian Creek Elementary School
15800 W Indian Creek Pkwy
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Indian Creek Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.79441071,38.85463333),"
Indian Trail Junior High School
1440 E 151st St
Olathe, KS 66062

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Indian Trail Junior High School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.75008392,38.85942078),"
Liberty View Elementary School
14800 S Greenwood Street
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Liberty View Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.75555420,38.89815140),"
Olathe East Senior High School
14545 W 127th
Olathe, KS 66062

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Olathe East Senior High School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.79020691,38.85468674),"
Olathe South Senior High School
1640 E 151st St
Olathe, KS 66062

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Olathe South Senior High School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.76101685,38.89817047),"
Pioneer Trail Junior High School
15100 West 127th
Olathe, KS 66062

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pioneer Trail Junior High School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.74968719,38.88751221),"
Regency Place Elementary School
13250 S Greenwood
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Regency Place Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.79002380,38.84989548),"
Scarborough Elementary School
2000 Lindenwood
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Scarborough Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.78720093,38.84080124),"
Sunnyside Elementary School
16025 S. Lindenwood
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunnyside Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.76922607,38.87768173),"
Tomahawk Elementary School
13820 S Brougham Dr
Olathe, KS 66062

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tomahawk Elementary School",'Olathe=' + Olathe.length); Olathe[Olathe.length] = createMarker(new GPoint(-94.74247742,38.91455460),"
Walnut Grove Elementary School
11800 S Pflumm Road
Olathe, KS 66062

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