function addMarkers() { mySelect = document.getElementById('selection'); Bellevue = [];Bellevue[Bellevue.length] = createMarker(new GPoint(-95.96829224,41.13234329),"
Anderson Grove Elementary School
11820 S 37th St
Bellevue, NE 68123

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Anderson Grove Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.92243195,41.16499329),"
Avery Elementary School
2107 Avery Rd
Bellevue, NE 68005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Avery Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.90818787,41.13619614),"
Belleaire Elementary School
1200 Mission Ave West
Bellevue, NE 68005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Belleaire Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.90660095,41.14559937),"
Bellevue East Senior High School
1401 High School Dr
Bellevue, NE 68005

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bellevue East Senior High School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.89628601,41.13705444),"
Bellevue Mission Middle School
2202 Washington St
Bellevue, NE 68005

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bellevue Mission Middle School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.93462372,41.16197586),"
Bellevue West Senior High School
1501 Thurston Ave
Bellevue, NE 68123

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bellevue West Senior High School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.89058685,41.14527893),"
Bertha Barber Elementary School
1402 Main St
Bellevue, NE 68005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Bertha Barber Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.90096283,41.12979889),"
Betz Elementary School
605 W 27th Ave
Bellevue, NE 68005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Betz Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.91229248,41.14749908),"
Birchcrest Elementary School
1212 Fairfax Dr
Bellevue, NE 68005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Birchcrest Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.90879822,41.15979767),"
C H A P School
1201 Gregg Rd
Bellevue, NE 68005

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("C H A P School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.89902496,41.13709641),"
Central Elementary School
510 W 22nd Ave
Bellevue, NE 68005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Central Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.93888092,41.10351181),"
Fairview Elementary School
14110 Tregaron Drive
Bellevue, NE 68123

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairview Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.94673157,41.12498856),"
Fort Crook Elementary School
12501 S 25th St
Bellevue, NE 68123

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fort Crook Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.95687866,41.13245010),"
Golden Hills Elementary School
2912 Coffey Ave
Bellevue, NE 68123

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Golden Hills Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.95278168,41.12700653),"
Lemay Elementary School
2726 Kennedy Dr
Bellevue, NE 68123

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lemay Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.95447540,41.11246109),"
Leonard Lawrence Elementary School
13204 S 29th St
Bellevue, NE 68123

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Leonard Lawrence Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.91439056,41.15329742),"
Logan Fontenelle Middle School
701 Kayleen Dr South
Bellevue, NE 68005

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Logan Fontenelle Middle School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.95649719,41.12240601),"
Peter Sarpy Elementary School
2908 Vandenberg Ave
Bellevue, NE 68123

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Peter Sarpy Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.92229462,41.14513397),"
Twin Ridge Elementary School
1400 Sunbury Dr
Bellevue, NE 68005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Twin Ridge Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.95543671,41.09954453),"
Two Springs Elementary School
3001 Spring Blvd
Bellevue, NE 68123

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Two Springs Elementary School",'Bellevue=' + Bellevue.length); Bellevue[Bellevue.length] = createMarker(new GPoint(-95.90898895,41.15409851),"
Wake Robin Elementary School
700 Lincoln Rd South
Bellevue, NE 68005

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wake Robin Elementary School",'Bellevue=' + Bellevue.length); map.removeOverlays(Bellevue); setTimeout(function(){map.addOverlays(Bellevue)},1000); maxLng = -95.89058685; maxLat = 41.16499329; minLng = -95.96829224; minLat = 41.09954453; reCenterMap(); } // 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(Bellevue); 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(Bellevue);map.removeOverlays(Bellevue); map.addOverlays(Bellevue); centerByArray(Bellevue, false, false); cntMarker += Bellevue.length; centerByArray(Bellevue,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'); } }