function addMarkers(){ mySelect = document.getElementById('selection'); Chula_Vista = [];Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.02801100,32.63231200),"
Advocate School
900 Paseo Del Rey
Chula Vista, CA 91911
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Advocate School",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.05480000,32.60810000),"
Advocate School Rancho Del Ray
900 Pasco Del Rey
Chula Vista, CA 91911
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Advocate School Rancho Del Ray",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.05249500,32.64986500),"
Bonita Learning Academy
3368 Bonita Road
Chula Vista, CA 91910
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bonita Learning Academy",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.06527200,32.64806800),"
Bonita Road Christian School
73 Bonita Road
Chula Vista, CA 91910
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bonita Road Christian School",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-116.98227500,32.63174000),"
Calvary Christian Academy
1771 East Palomar Street
Chula Vista, CA 91913
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Christian Academy",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.03392200,32.62778600),"
Childrens World
612 Paseo Del Rey
Chula Vista, CA 91910
school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Childrens World",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.08898300,32.64244800),"
Christian Academy Of Chula Vista
494 E Street
Chula Vista, CA 91910
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Academy Of Chula Vista",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.07927000,32.61610400),"
Chula Vista Christian Elementary School
960 5th Avenue
Chula Vista, CA 91911
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chula Vista Christian Elementary School",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-116.96416700,32.64894100),"
Eastlake Community Church/preschool
2351 Otay Lakes Road
Chula Vista, CA 91915
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eastlake Community Church/preschool",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.08727900,32.63739300),"
Filipino And Amer Bible Bapt
345 Fifth Ave.
Chula Vista, CA 91910
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Filipino And Amer Bible Bapt",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-116.96134000,32.65229800),"
Green Hills Learning Center
2400 Fenton Street Suite B
Chula Vista, CA 91914
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Green Hills Learning Center",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.05580000,32.63790000),"
Love N Learn Bonita Chrtn School
73 Bonita Rdr
Chula Vista, CA 91910
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Love N Learn Bonita Chrtn School",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.00645100,32.64216000),"
Lutheran High Of San Diego
810 Buena Vista Way
Chula Vista, CA 91910
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lutheran High Of San Diego",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-116.98566300,32.63309400),"
Mater Dei Catholic High School
1615 Mater Dei Drive
Chula Vista, CA 91913
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mater Dei Catholic High School",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.04834700,32.65285500),"
Montessori American School
3604 Bonita Road
Chula Vista, CA 91910
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori American School",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.08923100,32.64269600),"
Pilgrim Lutheran School
497 E Street
Chula Vista, CA 91910
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pilgrim Lutheran School",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.05483800,32.61588500),"
St. Pius X School
37 E Emerson Street
Chula Vista, CA 91911
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Pius X School",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.09591300,32.64082300),"
Sam & Rose Stein Educ Center
647 E Street
Chula Vista, CA 91910
Co-ed school, Ungraded
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sam & Rose Stein Educ Center",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.08901700,32.64246800),"
School For Young Children
494 ''e'' Street
Chula Vista, CA 91910
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("School For Young Children",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.08639400,32.64726200),"
South Bay Christian Academy
395 D Street
Chula Vista, CA 91910
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Bay Christian Academy",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.07915700,32.61843200),"
Southwestern Christian School
482 L Street
Chula Vista, CA 91911
Co-ed school, NS-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southwestern Christian School",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.06561900,32.62744000),"
St John's Episcopal School
760 1st Avenue
Chula Vista, CA 91910
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John's Episcopal School",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.07739600,32.63536800),"
St Rose Of Lima School
473 3rd Avenue
Chula Vista, CA 91910
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Rose Of Lima School",'Chula_Vista=' + Chula_Vista.length); Chula_Vista[Chula_Vista.length] = createMarker(new GPoint(-117.08144500,32.65469500),"
Wee Care Preschool
73 N 2nd Avenue
Chula Vista, CA 91910
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wee Care Preschool",'Chula_Vista=' + Chula_Vista.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(Chula_Vista); 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(Chula_Vista);map.removeOverlays(Chula_Vista); map.addOverlays(Chula_Vista); centerByArray(Chula_Vista, false, false); cntMarker += Chula_Vista.length; centerByArray(Chula_Vista,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; }