function addMarkers(){ mySelect = document.getElementById('selection'); Lincoln = [];Roca = [];Waverly = [];mySelect.options[mySelect.options.length] = new Option("Lincoln schools",'all=Lincoln'); mySelect.options[mySelect.options.length] = new Option("Roca schools",'all=Roca'); mySelect.options[mySelect.options.length] = new Option("Waverly schools",'all=Waverly'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.62549700,40.69840700),"
Berniklan Education Solutions
11401 S 70th
Lincoln, NE 68516
Co-ed school, K-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Berniklan Education Solutions",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.69661800,40.78796200),"
Blessed Sacrament School
2500 S 17th Street
Lincoln, NE 68502
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blessed Sacrament School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.66825000,40.78032400),"
Cathedral Of The Risen Christ School
3245 South 37th Street
Lincoln, NE 68506
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cathedral Of The Risen Christ School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.61618000,40.81405200),"
Children's Circle Montessori Inc.
130 Skyway Road
Lincoln, NE 68505
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Children's Circle Montessori Inc.",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.65932000,40.79517200),"
Christ Elementary School
4325 Sumner Street
Lincoln, NE 68506
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ Elementary School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.63576700,40.83336300),"
Cornerstone Christian Academy
6251 Colby Street
Lincoln, NE 68505
Co-ed school, 4-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone Christian Academy",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.60161200,40.84245500),"
Faith Lutheran School
8701 Adams Street
Lincoln, NE 68507
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Lutheran School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.62788000,40.81315800),"
Gallup Child Dev Center
201 S 68th St
Lincoln, NE 68510
Co-ed school, KG-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gallup Child Dev Center",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.65381800,40.77486300),"
George Stone Elementary School
3800 South 48th Street
Lincoln, NE 68506
Co-ed school, 2-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("George Stone Elementary School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.66513700,40.75836300),"
Good Shepherd Lutheran School
3825 Wildbriar Lane
Lincoln, NE 68516
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Good Shepherd Lutheran School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.65003800,40.77713700),"
Helen Hyatt Elementary School
5140 Calvert Street
Lincoln, NE 68506
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Helen Hyatt Elementary School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.63584300,40.84263700),"
Lincoln Arborview Montessori
6200 Adams St
Lincoln, NE 68507
Co-ed school, KG-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lincoln Arborview Montessori",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.67164300,40.76979800),"
Lincoln Child's View Montessori
3341 Pioneers Blvd Ste 3
Lincoln, NE 68506
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lincoln Child's View Montessori",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.60635400,40.75413300),"
Lincoln Christian School
5801 S 84th Street
Lincoln, NE 68516
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lincoln Christian School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.64397900,40.82459900),"
Lincoln Lutheran Jr/sr High School
1100 N 56th Street
Lincoln, NE 68504
Co-ed school, 8-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lincoln Lutheran Jr/sr High School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.60581800,40.79466300),"
Messiah Lutheran School
1800 S 84th Street
Lincoln, NE 68506
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Messiah Lutheran School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.73699600,40.86196300),"
North American Martyrs School
1101 Isaac Drive
Lincoln, NE 68521
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North American Martyrs School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.72011500,40.85522100),"
Parkview Christian School
4400 N. 1st Street
Lincoln, NE 68521
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parkview Christian School",'Lincoln=' + Lincoln.length); Roca[Roca.length] = createMarker(new GPoint(-96.70574600,40.63454100),"
Prairie Hill Learning Center
17705 S. 12th St. Hwy 77
Roca, NE 68430
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Prairie Hill Learning Center",'Roca=' + Roca.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.67591800,40.81853300),"
Sacred Heart School
540 N 31st Street
Lincoln, NE 68503
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.65701100,40.75114800),"
St. Peter's Catholic School
4500 Duxhall Drive
Lincoln, NE 68516
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Peter's Catholic School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.61710300,40.82056300),"
St John School
7601 Vine Street
Lincoln, NE 68505
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.61476000,40.79242700),"
St Joseph School
1940 S 77th Street
Lincoln, NE 68506
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Joseph School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.69468000,40.77490000),"
St Mark Evangelical Lutheran School
3930 S 19th Street
Lincoln, NE 68502
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mark Evangelical Lutheran School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.70062700,40.80933700),"
St Marys School
1434 K Street
Lincoln, NE 68508
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Marys School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.63700600,40.85432000),"
St Patricks School
4142 N 61st Street
Lincoln, NE 68507
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Patricks School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.66909000,40.80779200),"
St Teresa Elementary School
616 S 36th Street
Lincoln, NE 68510
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Teresa Elementary School",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.69848000,40.79978800),"
Trinity Kindergarten Program
1345 S 16th Street
Lincoln, NE 68502
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Kindergarten Program",'Lincoln=' + Lincoln.length); Lincoln[Lincoln.length] = createMarker(new GPoint(-96.64398500,40.82582200),"
Trinity Lutheran School
1200 North 56th Street
Lincoln, NE 68504
Co-ed school, NS-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Lincoln=' + Lincoln.length); Waverly[Waverly.length] = createMarker(new GPoint(-96.52710000,40.93020000),"
Villa Marie School
Rt 1 Box 109
Waverly, NE 68462
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Villa Marie School",'Waverly=' + Waverly.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,11); /* 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/////1/' + showArray); map.removeOverlays(Lincoln); map.removeOverlays(Roca); map.removeOverlays(Waverly); 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(Lincoln);map.removeOverlays(Lincoln); map.removeOverlays(Roca); map.removeOverlays(Waverly); map.addOverlays(Lincoln); centerByArray(Lincoln, false, false); cntMarker += Lincoln.length; map.addOverlays(Roca); centerByArray(Roca, false, false); cntMarker += Roca.length; map.addOverlays(Waverly); centerByArray(Waverly, false, false); cntMarker += Waverly.length; centerByArray(Lincoln,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'); //window.open('/map.php?type=1&schools=&school_level=1&radius=&zipcode=&school_type_search=&school_type_code='); } } function createMarker(point, label, icon) { var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }