function addMarkers(){ mySelect = document.getElementById('selection'); San_Mateo = [];San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.30337400,37.52455900),"
Alpha Beacon Christian School
525 W. 42nd Ave.
San Mateo, CA 94403
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alpha Beacon Christian School",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.31918300,37.54480900),"
The Carey School
One Carey School Lane
San Mateo, CA 94403
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Carey School",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.31173800,37.53760400),"
Grace Lutheran School
2825 Alameda De Las Pulgas
San Mateo, CA 94403
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Lutheran School",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.31735300,37.54634300),"
Junipero Serra High School
451 West 20th Avenue
San Mateo, CA 94403
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Junipero Serra High School",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.31925000,37.55771200),"
Neighborhood Montessori School
27 10th Avenue
San Mateo, CA 94401
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Neighborhood Montessori School",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.34983700,37.53406100),"
Odyssey School
201 Polhemus Road
San Mateo, CA 94402
Co-ed school, 6-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Odyssey School",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.33602200,37.57922100),"
Pacific Rim International School
454 Peninsula Avenue
San Mateo, CA 94401
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pacific Rim International School",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.33425400,37.57208600),"
Russell Bede School
446 Turner Ter
San Mateo, CA 94401
Co-ed school, 3-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Russell Bede School",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.30825800,37.54053900),"
St. Gregory School
2701 Hacienda Street
San Mateo, CA 94403
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Gregory School",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.32149800,37.55872400),"
St. Matthew Catholic School
910 S El Camino Real
San Mateo, CA 94402
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Matthew Catholic School",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.32768700,37.56547200),"
St. Matthew's Episcopal Day School
16 Baldwin Ave
San Mateo, CA 94401
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Matthew's Episcopal Day School",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.31068100,37.57523600),"
St. Timothy Elementary School
1515 Dolan Avenue
San Mateo, CA 94401
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Timothy Elementary School",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.33008200,37.57499000),"
Stanbridge Academy
515 E Poplar Ave
San Mateo, CA 94401
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Stanbridge Academy",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.30570100,37.52781100),"
Transfiguration Nursery School
3900 Alameda De Las Pulgas
San Mateo, CA 94403
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Transfiguration Nursery School",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.33693600,37.55391900),"
Tulane Montessori Children's House
315 Tulane Road
San Mateo, CA 94402
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tulane Montessori Children's House",'San_Mateo=' + San_Mateo.length); San_Mateo[San_Mateo.length] = createMarker(new GPoint(-122.32752200,37.56747100),"
Wings Learning Center
49 N San Mateo Drive
San Mateo, CA 94401
Co-ed school, 1-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wings Learning Center",'San_Mateo=' + San_Mateo.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//////' + showArray); map.removeOverlays(San_Mateo); 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(San_Mateo);map.removeOverlays(San_Mateo); map.addOverlays(San_Mateo); centerByArray(San_Mateo, false, false); cntMarker += San_Mateo.length; centerByArray(San_Mateo,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=&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; }