function addMarkers(){ mySelect = document.getElementById('selection'); Silverton = [];Salem = [];Keizer = [];Stayton = [];Gervais = [];Woodburn = [];Saint_Paul = [];Turner = [];Brooks = [];mySelect.options[mySelect.options.length] = new Option("Brooks schools",'all=Brooks'); mySelect.options[mySelect.options.length] = new Option("Gervais schools",'all=Gervais'); mySelect.options[mySelect.options.length] = new Option("Keizer schools",'all=Keizer'); mySelect.options[mySelect.options.length] = new Option("Saint Paul schools",'all=Saint_Paul'); mySelect.options[mySelect.options.length] = new Option("Salem schools",'all=Salem'); mySelect.options[mySelect.options.length] = new Option("Silverton schools",'all=Silverton'); mySelect.options[mySelect.options.length] = new Option("Stayton schools",'all=Stayton'); mySelect.options[mySelect.options.length] = new Option("Turner schools",'all=Turner'); mySelect.options[mySelect.options.length] = new Option("Woodburn schools",'all=Woodburn'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Silverton[Silverton.length] = createMarker(new GPoint(-122.73947800,45.02565800),"
Abiqua Children's Center Inc
6868 Cascade Highway Ne
Silverton, OR 97381
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Abiqua Children's Center Inc",'Silverton=' + Silverton.length); Salem[Salem.length] = createMarker(new GPoint(-123.01196400,44.88313600),"
Abiqua School
4985 Battle Creek Rd Se 107
Salem, OR 97302
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Abiqua School",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.03971400,44.91153700),"
Adventures Unlimited
669 Vista Ave Se
Salem, OR 97302
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Adventures Unlimited",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-122.97568400,44.95036000),"
Blanchet Catholic School
4373 Market Street Ne
Salem, OR 97301
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blanchet Catholic School",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.04730000,44.90520000),"
Bud To Blossom Children's School Of Discovery
Po Box 4297
Salem, OR 97302
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bud To Blossom Children's School Of Discovery",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.07713900,44.90561600),"
Buttercup Hill. Inc
3440 Mock Orange Court S
Salem, OR 97302
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Buttercup Hill. Inc",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-122.98312000,44.97695300),"
Chemeketa Child Development Center
Po Box 14007
Salem, OR 97309
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chemeketa Child Development Center",'Salem=' + Salem.length); Keizer[Keizer.length] = createMarker(new GPoint(-123.02003900,44.99687000),"
Concordia Lutheran School
Po Box 21778
Keizer, OR 97307
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Concordia Lutheran School",'Keizer=' + Keizer.length); Salem[Salem.length] = createMarker(new GPoint(-122.96320000,44.99140000),"
Concordia Lutheran School
4663 Lancaster Drive NE
Salem, OR 97305
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Concordia Lutheran School",'Salem=' + Salem.length); Keizer[Keizer.length] = createMarker(new GPoint(-123.02005900,44.99668000),"
Cornerstone Christian School
P.O. Box 21478
Keizer, OR 97307
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cornerstone Christian School",'Keizer=' + Keizer.length); Salem[Salem.length] = createMarker(new GPoint(-122.63657400,47.53377200),"
Discovery Montessori
1055 Electric Ave SE
Salem, OR 97366
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Discovery Montessori",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.03180700,44.94060800),"
First Presbyterian Child Dev.
770 Chemeketa Street N.e.
Salem, OR 97301
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Presbyterian Child Dev.",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.04730000,44.90520000),"
H.i.s. Academy
Po Box 4445
Salem, OR 97302
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("H.i.s. Academy",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.03369100,44.94012000),"
Heritage School, The
Po Box 2065
Salem, OR 97308
Co-ed school, 1-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage School, The",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.04454100,44.89068500),"
Immanuel Evangelical Lutheran School
510 Idylwood Drive Se
Salem, OR 97302
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Immanuel Evangelical Lutheran School",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.03915700,44.93608600),"
Little Village Learning Center
445 High Street Se 140
Salem, OR 97301
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Village Learning Center",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-122.94267500,44.94091400),"
Livingstone Adventist Academy
5771 Fruitland Road Ne
Salem, OR 97317
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Livingstone Adventist Academy",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.04730000,44.90520000),"
Queen Of Peace School
Po Box 3696
Salem, OR 97302
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Queen Of Peace School",'Salem=' + Salem.length); Stayton[Stayton.length] = createMarker(new GPoint(-122.79857800,44.80786300),"
Regis High School
550 W Regis Street
Stayton, OR 97383
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Regis High School",'Stayton=' + Stayton.length); Gervais[Gervais.length] = createMarker(new GPoint(-122.90870000,45.10740000),"
Sacred Heart Elementary School
Po Box 215
Gervais, OR 97026
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Elementary School",'Gervais=' + Gervais.length); Salem[Salem.length] = createMarker(new GPoint(-123.03104300,44.94139200),"
St. Joseph School
373 Winter Street Ne
Salem, OR 97301
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Joseph School",'Salem=' + Salem.length); Woodburn[Woodburn.length] = createMarker(new GPoint(-122.85724000,45.14649500),"
St. Luke School
529 Harrison Street
Woodburn, OR 97071
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Luke School",'Woodburn=' + Woodburn.length); Stayton[Stayton.length] = createMarker(new GPoint(-122.78890600,44.80262100),"
St. Mary Catholic School
1066 N 6th Avenue
Stayton, OR 97383
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary Catholic School",'Stayton=' + Stayton.length); Saint_Paul[Saint_Paul.length] = createMarker(new GPoint(-122.94870000,45.22240000),"
St. Paul Parochial School
Po Box 188 20327 Christie Street
Saint Paul, OR 97137
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Paul Parochial School",'Saint_Paul=' + Saint_Paul.length); Salem[Salem.length] = createMarker(new GPoint(-122.97331900,44.95198300),"
Salem Academy - East Elementary School
1850 45th Ave NE
Salem, OR 97305
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Salem Academy - East Elementary School",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-122.98314700,44.94272600),"
Salem Academy Middle & High School
942 Lancaster Drive Ne
Salem, OR 97301
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Salem Academy Middle & High School",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.02210000,45.00050000),"
Salem Child Development Center
Po Box 7422
Salem, OR 97303
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Salem Child Development Center",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.01590300,44.94866300),"
Salem Christian Day School
1550 Market Street Ne
Salem, OR 97301
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Salem Christian Day School",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.03369100,44.94012000),"
Salem Family Ymca Preschool & Kindergarten
685 Court Street Ne
Salem, OR 97301
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Salem Family Ymca Preschool & Kindergarten",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.02210000,45.00050000),"
Salem Montessori School
Po Box 7724
Salem, OR 97303
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Salem Montessori School",'Salem=' + Salem.length); Silverton[Silverton.length] = createMarker(new GPoint(-122.71900000,44.96850000),"
Silverton Christian School
Po Box 338
Silverton, OR 97381
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Silverton Christian School",'Silverton=' + Silverton.length); Salem[Salem.length] = createMarker(new GPoint(-123.03677100,44.94458600),"
Sonshine School
395 Marion Street Ne
Salem, OR 97301
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sonshine School",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.02440100,44.93742100),"
St John Lutheran Preschool & Kindergarten
1350 Court Street Ne
Salem, OR 97301
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John Lutheran Preschool & Kindergarten",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.03041100,44.94270500),"
St Mark Child Development Center
790 Marion Street Ne
Salem, OR 97301
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mark Child Development Center",'Salem=' + Salem.length); Salem[Salem.length] = createMarker(new GPoint(-123.02101100,44.95923700),"
St Vincents De Paul School
1015 Columbia Street Ne
Salem, OR 97301
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Vincents De Paul School",'Salem=' + Salem.length); Stayton[Stayton.length] = createMarker(new GPoint(-122.79353700,44.80084400),"
Stayton Christian School
189 E Washington Street
Stayton, OR 97383
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Stayton Christian School",'Stayton=' + Stayton.length); Salem[Salem.length] = createMarker(new GPoint(-122.99721000,44.95376300),"
Sunnyview Child Care
3032 Sunnyview Rd Ne
Salem, OR 97303
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sunnyview Child Care",'Salem=' + Salem.length); Turner[Turner.length] = createMarker(new GPoint(-123.00684300,44.83995200),"
Willamette Christian School
2707 Maranatha Court Se
Turner, OR 97392
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Willamette Christian School",'Turner=' + Turner.length); Brooks[Brooks.length] = createMarker(new GPoint(-122.96680000,44.98560000),"
Willamette Valley Christian
Po Box 9088
Brooks, OR 97305
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Willamette Valley Christian",'Brooks=' + Brooks.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/////3/' + showArray); map.removeOverlays(Brooks); map.removeOverlays(Gervais); map.removeOverlays(Keizer); map.removeOverlays(Saint_Paul); map.removeOverlays(Salem); map.removeOverlays(Silverton); map.removeOverlays(Stayton); map.removeOverlays(Turner); map.removeOverlays(Woodburn); 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(Silverton);map.removeOverlays(Brooks); map.removeOverlays(Gervais); map.removeOverlays(Keizer); map.removeOverlays(Saint_Paul); map.removeOverlays(Salem); map.removeOverlays(Silverton); map.removeOverlays(Stayton); map.removeOverlays(Turner); map.removeOverlays(Woodburn); map.addOverlays(Brooks); centerByArray(Brooks, false, false); cntMarker += Brooks.length; map.addOverlays(Gervais); centerByArray(Gervais, false, false); cntMarker += Gervais.length; map.addOverlays(Keizer); centerByArray(Keizer, false, false); cntMarker += Keizer.length; map.addOverlays(Saint_Paul); centerByArray(Saint_Paul, false, false); cntMarker += Saint_Paul.length; map.addOverlays(Salem); centerByArray(Salem, false, false); cntMarker += Salem.length; map.addOverlays(Silverton); centerByArray(Silverton, false, false); cntMarker += Silverton.length; map.addOverlays(Stayton); centerByArray(Stayton, false, false); cntMarker += Stayton.length; map.addOverlays(Turner); centerByArray(Turner, false, false); cntMarker += Turner.length; map.addOverlays(Woodburn); centerByArray(Woodburn, false, false); cntMarker += Woodburn.length; centerByArray(Silverton,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=3&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; }