function addMarkers(){ mySelect = document.getElementById('selection'); Portland = [];Troutdale = [];Gresham = [];mySelect.options[mySelect.options.length] = new Option("Gresham schools",'all=Gresham'); mySelect.options[mySelect.options.length] = new Option("Portland schools",'all=Portland'); mySelect.options[mySelect.options.length] = new Option("Troutdale schools",'all=Troutdale'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); 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); Portland[Portland.length] = createMarker(new GPoint(-122.64129400,45.51943700),"
Central Catholic High School
2401 Se Stark Street
Portland, OR 97214
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Catholic High School",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.56874900,45.54871600),"
City Christian Schools
9200 Ne Fremont Street
Portland, OR 97220
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("City Christian Schools",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.57049500,45.52590900),"
Columbia Christian Schools
413 Ne 91st Avenue
Portland, OR 97220
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Columbia Christian Schools",'Portland=' + Portland.length); Troutdale[Troutdale.length] = createMarker(new GPoint(-122.41059300,45.53799900),"
Counterpoint Day Treatment
2408 Sw Halsey Street Bldg J
Troutdale, OR 97060
All-boys school, 8-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Counterpoint Day Treatment",'Troutdale=' + Troutdale.length); Portland[Portland.length] = createMarker(new GPoint(-122.69227200,45.57855400),"
De La Salle North Catholic High School
7654 N Delaware Avenue
Portland, OR 97217
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("De La Salle North Catholic High School",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.61794500,45.56163700),"
De Paul Alternative School
4411 N.e. Emerson
Portland, OR 97218
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("De Paul Alternative School",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.55839500,45.52710600),"
Eastside Education Center
631 Ne 102nd Ave
Portland, OR 97220
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eastside Education Center",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.48018100,45.51346800),"
Greater Portland Christian Academy
17800 SE Main St
Portland, OR 97233
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greater Portland Christian Academy",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.76955500,45.48626300),"
Jesuit High School
9000 Sw Beaverton Hwy
Portland, OR 97225
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jesuit High School",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.61217300,45.47933700),"
Lents Education Center
4905 Se Woodstock Blvd
Portland, OR 97206
Co-ed school, 6-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lents Education Center",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.68498200,45.51758600),"
The Northwest Academy
1130 SW Main
Portland, OR 97205
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Northwest Academy",'Portland=' + Portland.length); Troutdale[Troutdale.length] = createMarker(new GPoint(-122.37637100,45.50642600),"
Open Door Christian Academy
27710 Se Strebin Road
Troutdale, OR 97060
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Open Door Christian Academy",'Troutdale=' + Troutdale.length); Portland[Portland.length] = createMarker(new GPoint(-122.69970300,45.57795700),"
Open Meadow High School/crue
7654 N Crawford Street
Portland, OR 97203
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Open Meadow High School/crue",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.66138000,45.55043700),"
Oregon Outreach Inc - Mccoy Academy Ne
3802 Ne Mlk Jr Blvd
Portland, OR 97212
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oregon Outreach Inc - Mccoy Academy Ne",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.63576400,45.52379000),"
Pacific Crest Community School
116 NE 29th Avenue
Portland, OR 97232
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pacific Crest Community School",'Portland=' + Portland.length); Gresham[Gresham.length] = createMarker(new GPoint(-122.39101200,45.50430200),"
Pacific View Alternative School
4101 Ne Division
Gresham, OR 97030
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pacific View Alternative School",'Gresham=' + Gresham.length); Gresham[Gresham.length] = createMarker(new GPoint(-122.41005100,45.49842400),"
The Phonics Phactory
3333 Ne 8th Street
Gresham, OR 97030
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Phonics Phactory",'Gresham=' + Gresham.length); Portland[Portland.length] = createMarker(new GPoint(-122.56407100,45.51222000),"
Portland Adventist Academy
1500 Se 96th Avenue
Portland, OR 97216
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Portland Adventist Academy",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.53521500,45.53733700),"
Portland Christian School
12425 Ne San Rafael Street
Portland, OR 97230
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Portland Christian School",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.47558300,45.51743400),"
Portland Lutheran School
740 Se 182nd Avenue
Portland, OR 97233
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Portland Lutheran School",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.67421500,45.56203700),"
Portland Opportunities Industrialization Center
717 N Killingsworth Court
Portland, OR 97217
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Portland Opportunities Industrialization Center",'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); Portland[Portland.length] = createMarker(new GPoint(-122.68393000,45.45450700),"
Riverdale High School
9727 SW Terwilliger Blvd.
Portland, OR 97219
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Riverdale High School",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.68109300,45.51265600),"
St. Marys Academy
1615 Sw 5th Avenue
Portland, OR 97201
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("St. Marys Academy",'Portland=' + Portland.length); Portland[Portland.length] = createMarker(new GPoint(-122.67496900,45.51204000),"
Serendipity Center
Po Box 33350
Portland, OR 97292
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Serendipity Center",'Portland=' + Portland.length); Gresham[Gresham.length] = createMarker(new GPoint(-122.44220400,45.50435300),"
Serp Alternative School
968 Nw Division Street
Gresham, OR 97030
Co-ed school, 11-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Serp Alternative School",'Gresham=' + Gresham.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); } // 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/////2/' + showArray); map.removeOverlays(Gresham); map.removeOverlays(Portland); map.removeOverlays(Troutdale); 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(Portland);map.removeOverlays(Gresham); map.removeOverlays(Portland); map.removeOverlays(Troutdale); map.addOverlays(Gresham); centerByArray(Gresham, false, false); cntMarker += Gresham.length; map.addOverlays(Portland); centerByArray(Portland, false, false); cntMarker += Portland.length; map.addOverlays(Troutdale); centerByArray(Troutdale, false, false); cntMarker += Troutdale.length; centerByArray(Portland,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=2&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; }