function addMarkers(){ mySelect = document.getElementById('selection'); Toledo = [];Portland = [];Coos_Bay = [];Hood_River = [];Hillsboro = [];Milwaukie = [];Cornelius = [];Medford = [];Klamath_Falls = [];Tigard = [];Ashland = [];Aloha = [];Eugene = [];Bend = [];Oregon_City = [];Roseburg = [];Gladstone = [];Beaverton = [];Salem = [];mySelect.options[mySelect.options.length] = new Option("Aloha schools",'all=Aloha'); mySelect.options[mySelect.options.length] = new Option("Ashland schools",'all=Ashland'); mySelect.options[mySelect.options.length] = new Option("Beaverton schools",'all=Beaverton'); mySelect.options[mySelect.options.length] = new Option("Bend schools",'all=Bend'); mySelect.options[mySelect.options.length] = new Option("Coos Bay schools",'all=Coos_Bay'); mySelect.options[mySelect.options.length] = new Option("Cornelius schools",'all=Cornelius'); mySelect.options[mySelect.options.length] = new Option("Eugene schools",'all=Eugene'); mySelect.options[mySelect.options.length] = new Option("Gladstone schools",'all=Gladstone'); mySelect.options[mySelect.options.length] = new Option("Hillsboro schools",'all=Hillsboro'); mySelect.options[mySelect.options.length] = new Option("Hood River schools",'all=Hood_River'); mySelect.options[mySelect.options.length] = new Option("Klamath Falls schools",'all=Klamath_Falls'); mySelect.options[mySelect.options.length] = new Option("Medford schools",'all=Medford'); mySelect.options[mySelect.options.length] = new Option("Milwaukie schools",'all=Milwaukie'); mySelect.options[mySelect.options.length] = new Option("Oregon City schools",'all=Oregon_City'); mySelect.options[mySelect.options.length] = new Option("Portland schools",'all=Portland'); mySelect.options[mySelect.options.length] = new Option("Roseburg schools",'all=Roseburg'); mySelect.options[mySelect.options.length] = new Option("Salem schools",'all=Salem'); mySelect.options[mySelect.options.length] = new Option("Tigard schools",'all=Tigard'); mySelect.options[mySelect.options.length] = new Option("Toledo schools",'all=Toledo'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Toledo[Toledo.length] = createMarker(new GPoint(-123.93910600,44.62752300),"
Abundant Life Academy
1154 Nw A Street
Toledo, OR 97391
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Abundant Life Academy",'Toledo=' + Toledo.length); Portland[Portland.length] = createMarker(new GPoint(-122.67530300,45.54978700),"
Albina Youth Opportunity School
3710 North Mississippi Avenue
Portland, OR 97227
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Albina Youth Opportunity School",'Portland=' + Portland.length); Coos_Bay[Coos_Bay.length] = createMarker(new GPoint(-124.27564700,43.38518400),"
Alternative Youth Activities, Inc
575 S. Main St.
Coos Bay, OR 97420
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alternative Youth Activities, Inc",'Coos_Bay=' + Coos_Bay.length); Hood_River[Hood_River.length] = createMarker(new GPoint(-121.51691600,45.70825500),"
Bright Beginnings
616 State Street
Hood River, OR 97031
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bright Beginnings",'Hood_River=' + Hood_River.length); Hillsboro[Hillsboro.length] = createMarker(new GPoint(-122.97785200,45.54414400),"
Carden Cascade Academy
770 NE Rogahn St.
Hillsboro, OR 97124
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carden Cascade Academy",'Hillsboro=' + Hillsboro.length); Milwaukie[Milwaukie.length] = createMarker(new GPoint(-122.58783000,45.43987500),"
Christ The King Parish School
7414 SE Michael Drive
Milwaukie, OR 97222
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ The King Parish School",'Milwaukie=' + Milwaukie.length); Cornelius[Cornelius.length] = createMarker(new GPoint(-123.05071900,45.48941000),"
Forest Hills Lutheran School
4221 Sw Golf Course Road
Cornelius, OR 97113
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Forest Hills Lutheran School",'Cornelius=' + Cornelius.length); Medford[Medford.length] = createMarker(new GPoint(-122.86200200,42.33556700),"
Grace Christian School
649 Crater Lake Avenue
Medford, OR 97504
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Christian School",'Medford=' + Medford.length); Klamath_Falls[Klamath_Falls.length] = createMarker(new GPoint(-121.94257100,42.25640100),"
Integral Youth Services Step-thru School
Po Box 1385 1011 Main Street
Klamath Falls, OR 97601
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Integral Youth Services Step-thru School",'Klamath_Falls=' + Klamath_Falls.length); Portland[Portland.length] = createMarker(new GPoint(-122.67680500,45.50653100),"
The International School
025 SW Sherman Street
Portland, OR 97201
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The International School",'Portland=' + Portland.length); Tigard[Tigard.length] = createMarker(new GPoint(-122.80546000,45.44197700),"
Kindercare Learning Centers
12658 SW North Dakota Street
Tigard, OR 97223
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kindercare Learning Centers",'Tigard=' + Tigard.length); Tigard[Tigard.length] = createMarker(new GPoint(-122.81075600,45.44237100),"
Knowledge Beginnings
10751 Sw 130th Avenue
Tigard, OR 97223
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Knowledge Beginnings",'Tigard=' + Tigard.length); Ashland[Ashland.length] = createMarker(new GPoint(-122.66912000,42.18088900),"
Lithia Springs School
695 Mistletoe Road Ste H
Ashland, OR 97520
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lithia Springs School",'Ashland=' + Ashland.length); Aloha[Aloha.length] = createMarker(new GPoint(-122.86202800,45.49451200),"
Little Lambs Christian Montessori Center
17950 Sw Alexander Street
Aloha, OR 97006
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Lambs Christian Montessori Center",'Aloha=' + Aloha.length); Klamath_Falls[Klamath_Falls.length] = createMarker(new GPoint(-121.78113800,42.22856800),"
Little Lambs Learning Center
1025 High St
Klamath Falls, OR 97601
Co-ed school, PK-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Lambs Learning Center",'Klamath_Falls=' + Klamath_Falls.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); Bend[Bend.length] = createMarker(new GPoint(-121.33816400,43.99327800),"
Morning Star Christian School
19741 Baker Road
Bend, OR 97702
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Morning Star Christian School",'Bend=' + Bend.length); Bend[Bend.length] = createMarker(new GPoint(-121.29990000,44.07220000),"
New Leaf Academy
Po Box 6454 21335 Bear Crk Road
Bend, OR 97708
All-girls school, 5-9
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New Leaf Academy",'Bend=' + Bend.length); Oregon_City[Oregon_City.length] = createMarker(new GPoint(-122.57948500,45.32270000),"
North Clackamas Christian School
19575 Sebastian Way
Oregon City, OR 97045
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Clackamas Christian School",'Oregon_City=' + Oregon_City.length); Roseburg[Roseburg.length] = createMarker(new GPoint(-123.31102000,43.21286300),"
Phoenix School Of Roseburg
3131 Ne Diamond Lake Blvd
Roseburg, OR 97470
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Phoenix School Of Roseburg",'Roseburg=' + Roseburg.length); Portland[Portland.length] = createMarker(new GPoint(-122.70375400,45.47614300),"
Portland Jewish Academy
6651 Southwest Capitol Highway
Portland, OR 97219
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Portland Jewish Academy",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.56847500,45.48617100),"
Portland Youth Builders
4816 Se 92nd Avenue
Portland, OR 97266
Co-ed school, 12-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Portland Youth Builders",'Portland=' + Portland.length); Gladstone[Gladstone.length] = createMarker(new GPoint(-122.57792200,45.39191300),"
Rivergate Adventist Elementary School
1505 Ohlson Road
Gladstone, OR 97027
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rivergate Adventist Elementary School",'Gladstone=' + Gladstone.length); Medford[Medford.length] = createMarker(new GPoint(-122.87325900,42.32069100),"
Sacred Heart Catholic School
431 S Ivy Street
Medford, OR 97501
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Catholic School",'Medford=' + Medford.length); Beaverton[Beaverton.length] = createMarker(new GPoint(-122.82860300,45.48748200),"
St. Mary Of The Valley Elementary School
4440 Sw 148th Avenue
Beaverton, OR 97007
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary Of The Valley Elementary School",'Beaverton=' + Beaverton.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.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); Portland[Portland.length] = createMarker(new GPoint(-122.63622000,45.49025700),"
Tucker-Maxon Oral School
2860 SE Holgate Blvd
Portland, OR 97202
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tucker-Maxon Oral School",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.70007400,45.46691900),"
West Hills Christian School
7945 Sw Capitol Hill Road
Portland, OR 97219
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Hills Christian School",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.62179500,45.47972400),"
Whole Child Montessori Center
5909 Se 40th Avenue
Portland, OR 97202
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Whole Child Montessori Center",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.66560300,45.51855200),"
Youth Progress Association
604 Se Water Avenue
Portland, OR 97214
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Youth Progress Association",'Portland=' + Portland.length); map.removeOverlays(Aloha); map.removeOverlays(Ashland); map.removeOverlays(Beaverton); map.removeOverlays(Bend); map.removeOverlays(Coos_Bay); map.removeOverlays(Cornelius); map.removeOverlays(Eugene); map.removeOverlays(Gladstone); map.removeOverlays(Hillsboro); map.removeOverlays(Hood_River); map.removeOverlays(Klamath_Falls); map.removeOverlays(Medford); map.removeOverlays(Milwaukie); map.removeOverlays(Oregon_City); map.removeOverlays(Portland); map.removeOverlays(Roseburg); map.removeOverlays(Salem); map.removeOverlays(Tigard); map.removeOverlays(Toledo); setTimeout(function(){map.addOverlays(Aloha)},1000); setTimeout(function(){map.addOverlays(Ashland)},1000); setTimeout(function(){map.addOverlays(Beaverton)},1000); setTimeout(function(){map.addOverlays(Bend)},1000); setTimeout(function(){map.addOverlays(Coos_Bay)},1000); setTimeout(function(){map.addOverlays(Cornelius)},1000); setTimeout(function(){map.addOverlays(Eugene)},1000); setTimeout(function(){map.addOverlays(Gladstone)},1000); setTimeout(function(){map.addOverlays(Hillsboro)},1000); setTimeout(function(){map.addOverlays(Hood_River)},1000); setTimeout(function(){map.addOverlays(Klamath_Falls)},1000); setTimeout(function(){map.addOverlays(Medford)},1000); setTimeout(function(){map.addOverlays(Milwaukie)},1000); setTimeout(function(){map.addOverlays(Oregon_City)},1000); setTimeout(function(){map.addOverlays(Portland)},1000); setTimeout(function(){map.addOverlays(Roseburg)},1000); setTimeout(function(){map.addOverlays(Salem)},1000); setTimeout(function(){map.addOverlays(Tigard)},1000); setTimeout(function(){map.addOverlays(Toledo)},1000); maxLng = -121.29990000; maxLat = 45.70825500; minLng = -124.27564700; minLat = 42.18088900; 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,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//////' + showArray); map.removeOverlays(Aloha); map.removeOverlays(Ashland); map.removeOverlays(Beaverton); map.removeOverlays(Bend); map.removeOverlays(Coos_Bay); map.removeOverlays(Cornelius); map.removeOverlays(Eugene); map.removeOverlays(Gladstone); map.removeOverlays(Hillsboro); map.removeOverlays(Hood_River); map.removeOverlays(Klamath_Falls); map.removeOverlays(Medford); map.removeOverlays(Milwaukie); map.removeOverlays(Oregon_City); map.removeOverlays(Portland); map.removeOverlays(Roseburg); map.removeOverlays(Salem); map.removeOverlays(Tigard); map.removeOverlays(Toledo); 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(Toledo);map.removeOverlays(Aloha); map.removeOverlays(Ashland); map.removeOverlays(Beaverton); map.removeOverlays(Bend); map.removeOverlays(Coos_Bay); map.removeOverlays(Cornelius); map.removeOverlays(Eugene); map.removeOverlays(Gladstone); map.removeOverlays(Hillsboro); map.removeOverlays(Hood_River); map.removeOverlays(Klamath_Falls); map.removeOverlays(Medford); map.removeOverlays(Milwaukie); map.removeOverlays(Oregon_City); map.removeOverlays(Portland); map.removeOverlays(Roseburg); map.removeOverlays(Salem); map.removeOverlays(Tigard); map.removeOverlays(Toledo); map.addOverlays(Aloha); centerByArray(Aloha, false, false); cntMarker += Aloha.length; map.addOverlays(Ashland); centerByArray(Ashland, false, false); cntMarker += Ashland.length; map.addOverlays(Beaverton); centerByArray(Beaverton, false, false); cntMarker += Beaverton.length; map.addOverlays(Bend); centerByArray(Bend, false, false); cntMarker += Bend.length; map.addOverlays(Coos_Bay); centerByArray(Coos_Bay, false, false); cntMarker += Coos_Bay.length; map.addOverlays(Cornelius); centerByArray(Cornelius, false, false); cntMarker += Cornelius.length; map.addOverlays(Eugene); centerByArray(Eugene, false, false); cntMarker += Eugene.length; map.addOverlays(Gladstone); centerByArray(Gladstone, false, false); cntMarker += Gladstone.length; map.addOverlays(Hillsboro); centerByArray(Hillsboro, false, false); cntMarker += Hillsboro.length; map.addOverlays(Hood_River); centerByArray(Hood_River, false, false); cntMarker += Hood_River.length; map.addOverlays(Klamath_Falls); centerByArray(Klamath_Falls, false, false); cntMarker += Klamath_Falls.length; map.addOverlays(Medford); centerByArray(Medford, false, false); cntMarker += Medford.length; map.addOverlays(Milwaukie); centerByArray(Milwaukie, false, false); cntMarker += Milwaukie.length; map.addOverlays(Oregon_City); centerByArray(Oregon_City, false, false); cntMarker += Oregon_City.length; map.addOverlays(Portland); centerByArray(Portland, false, false); cntMarker += Portland.length; map.addOverlays(Roseburg); centerByArray(Roseburg, false, false); cntMarker += Roseburg.length; map.addOverlays(Salem); centerByArray(Salem, false, false); cntMarker += Salem.length; map.addOverlays(Tigard); centerByArray(Tigard, false, false); cntMarker += Tigard.length; map.addOverlays(Toledo); centerByArray(Toledo, false, false); cntMarker += Toledo.length; centerByArray(Toledo,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///36058,22799,22810,36055,36059,36057,22812,22618,36060,22979,22834,22862,22614,36052,22901,22799,22810,22710,36059,22853,32782,36056,36057,22981,22722,22859,22661,22812,22933,22844,22950,22960,22969,22865,31704,36053,22614,/all'); //window.open('/map.php?type=2&schools=36058,22799,22810,36055,36059,36057,22812,22618,36060,22979,22834,22862,22614,36052,22901,22799,22810,22710,36059,22853,32782,36056,36057,22981,22722,22859,22661,22812,22933,22844,22950,22960,22969,22865,31704,36053,22614,&school_level=&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; }