function addMarkers(){ mySelect = document.getElementById('selection'); Eugene = [];Junction_City = [];Creswell = [];Pleasant_Hill = [];Cottage_Grove = [];Jasper = [];Vida = [];Springfield = [];mySelect.options[mySelect.options.length] = new Option("Cottage Grove schools",'all=Cottage_Grove'); mySelect.options[mySelect.options.length] = new Option("Creswell schools",'all=Creswell'); mySelect.options[mySelect.options.length] = new Option("Eugene schools",'all=Eugene'); mySelect.options[mySelect.options.length] = new Option("Jasper schools",'all=Jasper'); mySelect.options[mySelect.options.length] = new Option("Junction City schools",'all=Junction_City'); mySelect.options[mySelect.options.length] = new Option("Pleasant Hill schools",'all=Pleasant_Hill'); mySelect.options[mySelect.options.length] = new Option("Springfield schools",'all=Springfield'); mySelect.options[mySelect.options.length] = new Option("Vida schools",'all=Vida'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Eugene[Eugene.length] = createMarker(new GPoint(-123.10364600,44.04864900),"
Children's Choice Main St. Montessori
708 W 10th Avenue
Eugene, OR 97402
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Children's Choice Main St. Montessori",'Eugene=' + Eugene.length); Junction_City[Junction_City.length] = createMarker(new GPoint(-123.20617800,44.22013700),"
Christ's Center School
530 W 7th Avenue
Junction City, OR 97448
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ's Center School",'Junction_City=' + Junction_City.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.08832500,44.01708300),"
College Hill Montessori
3575 Donald Street
Eugene, OR 97405
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("College Hill Montessori",'Eugene=' + Eugene.length); Creswell[Creswell.length] = createMarker(new GPoint(-123.02380000,43.90750000),"
Creswell Christian School
Po Box 217
Creswell, OR 97426
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Creswell Christian School",'Creswell=' + Creswell.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.08791600,43.99630900),"
Educational Environments Inc
5310 Fox Hollow Road
Eugene, OR 97405
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Educational Environments Inc",'Eugene=' + Eugene.length); Pleasant_Hill[Pleasant_Hill.length] = createMarker(new GPoint(-122.94922800,43.97980400),"
Emerald Christian Academy
35582 Zephyr Way
Pleasant Hill, OR 97455
Co-ed school, NS-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Emerald Christian Academy",'Pleasant_Hill=' + Pleasant_Hill.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.07585900,44.00632500),"
Eugene Christian School
4500 W Amazon Drive
Eugene, OR 97405
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eugene Christian School",'Eugene=' + Eugene.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.11390100,44.02515800),"
Eugene Waldorf School
1350 Mclean Blvd
Eugene, OR 97405
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eugene Waldorf School",'Eugene=' + Eugene.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.08633700,44.05523300),"
Eweb Cdc
500 E 4th Avenue
Eugene, OR 97401
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eweb Cdc",'Eugene=' + Eugene.length); Cottage_Grove[Cottage_Grove.length] = createMarker(new GPoint(-122.98348900,43.73649300),"
Faith Christian School
76132 Blue Mountain School Rd
Cottage Grove, OR 97424
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Christian School",'Cottage_Grove=' + Cottage_Grove.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.08179900,44.03228000),"
Far Horizons Montessori School
2490 Hilyard St
Eugene, OR 97405
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Far Horizons Montessori School",'Eugene=' + Eugene.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.06987800,44.07086800),"
International English Christian School
2691 Turnbull Lane
Eugene, OR 97401
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("International English Christian School",'Eugene=' + Eugene.length); Jasper[Jasper.length] = createMarker(new GPoint(-122.86169800,43.97301500),"
Jasper Mountain School.
37875 Jasper Lowell Road
Jasper, OR 97438
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jasper Mountain School.",'Jasper=' + Jasper.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.08130800,44.02207500),"
Kiddie Kollege
3195 Hilyard Street
Eugene, OR 97405
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kiddie Kollege",'Eugene=' + Eugene.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.07462300,44.06684400),"
Kinder Care Learn Center #1036
2506 Oakmont Way
Eugene, OR 97401
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kinder Care Learn Center #1036",'Eugene=' + Eugene.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.11829000,44.04426900),"
Kindercare Learning Ctrs
1410 Chambers St
Eugene, OR 97402
Co-ed school, K-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kindercare Learning Ctrs",'Eugene=' + Eugene.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.08185800,44.04096300),"
Life Lutheran School
710 E 17th Avenue
Eugene, OR 97401
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Life Lutheran School",'Eugene=' + Eugene.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.11976600,44.04757900),"
Looking Glass Center Point School
1790 W 11th Avenue
Eugene, OR 97402
Co-ed school, 6-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Looking Glass Center Point School",'Eugene=' + Eugene.length); Vida[Vida.length] = createMarker(new GPoint(-122.59253000,44.14474100),"
Mckenzie River Christian School
Po Box I
Vida, OR 97488
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mckenzie River Christian School",'Vida=' + Vida.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.10296500,44.04046700),"
O Hara Catholic School
715 W 18th Avenue
Eugene, OR 97402
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("O Hara Catholic School",'Eugene=' + Eugene.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.02830400,44.01250500),"
Oak Hill School
86397 Eldon Schafer Drive
Eugene, OR 97405
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oak Hill School",'Eugene=' + Eugene.length); Cottage_Grove[Cottage_Grove.length] = createMarker(new GPoint(-123.04360000,43.75820000),"
Oak Park Christian School
Po Box 1358
Cottage Grove, OR 97424
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oak Park Christian School",'Cottage_Grove=' + Cottage_Grove.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.05890800,44.07553700),"
St. Paul Parish School
1201 Satre Street
Eugene, OR 97401
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Paul Parish School",'Eugene=' + Eugene.length); Cottage_Grove[Cottage_Grove.length] = createMarker(new GPoint(-123.05535900,43.78749000),"
South Lane Christian School
P.O.Box 1504
Cottage Grove, OR 97424
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Lane Christian School",'Cottage_Grove=' + Cottage_Grove.length); Springfield[Springfield.length] = createMarker(new GPoint(-122.99673400,44.06600100),"
Springfield Christian Kindergarten & Preschool
2080 N 19th Street
Springfield, OR 97477
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Springfield Christian Kindergarten & Preschool",'Springfield=' + Springfield.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.05209000,44.06881000),"
Unity School, Inc.
580 N Garden Way
Eugene, OR 97401
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Unity School, Inc.",'Eugene=' + Eugene.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.08220000,44.06480000),"
Willakinzie Christ Learn Center
Po Box 7591
Eugene, OR 97401
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Willakinzie Christ Learn Center",'Eugene=' + Eugene.length); Eugene[Eugene.length] = createMarker(new GPoint(-123.13160800,44.04036300),"
Willamette Christian School
Po Box 22108 2500 W 18th Avenue
Eugene, OR 97402
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Willamette Christian School",'Eugene=' + Eugene.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(Cottage_Grove); map.removeOverlays(Creswell); map.removeOverlays(Eugene); map.removeOverlays(Jasper); map.removeOverlays(Junction_City); map.removeOverlays(Pleasant_Hill); map.removeOverlays(Springfield); map.removeOverlays(Vida); 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(Eugene);map.removeOverlays(Cottage_Grove); map.removeOverlays(Creswell); map.removeOverlays(Eugene); map.removeOverlays(Jasper); map.removeOverlays(Junction_City); map.removeOverlays(Pleasant_Hill); map.removeOverlays(Springfield); map.removeOverlays(Vida); map.addOverlays(Cottage_Grove); centerByArray(Cottage_Grove, false, false); cntMarker += Cottage_Grove.length; map.addOverlays(Creswell); centerByArray(Creswell, false, false); cntMarker += Creswell.length; map.addOverlays(Eugene); centerByArray(Eugene, false, false); cntMarker += Eugene.length; map.addOverlays(Jasper); centerByArray(Jasper, false, false); cntMarker += Jasper.length; map.addOverlays(Junction_City); centerByArray(Junction_City, false, false); cntMarker += Junction_City.length; map.addOverlays(Pleasant_Hill); centerByArray(Pleasant_Hill, false, false); cntMarker += Pleasant_Hill.length; map.addOverlays(Springfield); centerByArray(Springfield, false, false); cntMarker += Springfield.length; map.addOverlays(Vida); centerByArray(Vida, false, false); cntMarker += Vida.length; centerByArray(Eugene,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; }