function addMarkers(){ mySelect = document.getElementById('selection'); Bakersfield = [];Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.01331200,35.36092100),"
Agapeland Christian Academy
1030 4th Street
Bakersfield, CA 93304
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Agapeland Christian Academy",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.11726700,35.37986300),"
Apostolic Christian Academy
2203 Dean Avenue
Bakersfield, CA 93312
Co-ed school, 7-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Apostolic Christian Academy",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.95501600,35.39203400),"
Bakersfield Adventist Academy
3333 Bernard Street
Bakersfield, CA 93306
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bakersfield Adventist Academy",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.96744700,35.36187300),"
Bakersfield Apostolic Faith Academy
519 Mount Vernon Avenue
Bakersfield, CA 93307
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bakersfield Apostolic Faith Academy",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.14383300,35.35401700),"
Bakersfield Christian High School
12775 Stockdale Highway
Bakersfield, CA 93314
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bakersfield Christian High School",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.01774900,35.39833700),"
Bethel Apostolic Academy
1418 W Columbus Street
Bakersfield, CA 93301
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethel Apostolic Academy",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.96689200,35.36877700),"
Bethel Christian School
2236 E Calif. Avenue
Bakersfield, CA 93307
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethel Christian School",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.91646500,35.39797100),"
Canyon Hills Christian School
7001 Auburn Street
Bakersfield, CA 93306
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Canyon Hills Christian School",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.98687300,35.39769800),"
Carden School Of Bakersfield
714 Columbus Street A
Bakersfield, CA 93305
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Carden School Of Bakersfield",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.95370000,35.37640000),"
Chapel School
Po Box 60815
Bakersfield, CA 93386
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chapel School",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.11688500,35.38168000),"
Country Christian School
2416 Dean Avenue
Bakersfield, CA 93312
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Country Christian School",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.02613100,35.37707800),"
Eternity Preparatory High School & Academy
2119 20th Street
Bakersfield, CA 93301
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Eternity Preparatory High School & Academy",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.05408200,35.35439200),"
First Experience Preschool
4600 Stockdale Highway
Bakersfield, CA 93309
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Experience Preschool",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.99866700,35.40013900),"
Garces Memorial High School
2800 Loma Linda Drive
Bakersfield, CA 93305
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Garces Memorial High School",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.02847600,35.41626300),"
Golden State Baptist Schools
427 Woodrow Avenue
Bakersfield, CA 93308
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Golden State Baptist Schools",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.00429100,35.27424500),"
Harvest Christian Academy
110 Mckee Road
Bakersfield, CA 93307
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harvest Christian Academy",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.96595600,35.39016300),"
Heritage Christian
2401 Bernard Street
Bakersfield, CA 93306
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.14460600,35.38856100),"
J. C. Worthy Institute
12801 Allen Lane
Bakersfield, CA 93312
Co-ed school, 2-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("J. C. Worthy Institute",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.98751600,35.38099800),"
Junester's School Of Achieveme
915 Niles St
Bakersfield, CA 93305
Co-ed school, 4-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Junester's School Of Achieveme",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.02138100,35.37075200),"
Lighthouse Christian
1417 H Street
Bakersfield, CA 93301
Co-ed school, 2-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lighthouse Christian",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.05364900,35.36541000),"
Little Red School House
4601 California Avenue
Bakersfield, CA 93309
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Red School House",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.04059700,35.34685600),"
Montessori Children's Center Of Bakersfield
3234 Belle Ter
Bakersfield, CA 93309
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Children's Center Of Bakersfield",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.05694100,35.31682800),"
New Life Christian School
4201 Stine Road
Bakersfield, CA 93313
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Life Christian School",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.07476700,35.41613700),"
Olive Knolls Christian School
6201 Fruitvale Avenue
Bakersfield, CA 93308
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Olive Knolls Christian School",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.99730700,35.36826300),"
Our Lady Of Guadalupe School
609 E California Avenue
Bakersfield, CA 93307
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Guadalupe School",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.99997900,35.39763700),"
Our Lady Of Perpetual Help School
124 Columbus Street
Bakersfield, CA 93305
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Perpetual Help School",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.37397300,35.34590500),"
Rosewall Christian Academy
35891 Big Springs Drive
Bakersfield, CA 93518
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rosewall Christian Academy",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.03080600,35.36143700),"
St. Francis School
2516 Palm Street
Bakersfield, CA 93304
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Francis School",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.03021400,35.32200300),"
Southwest Education Center
3637 Hughes Lane
Bakersfield, CA 93304
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southwest Education Center",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.12778300,35.31374900),"
St Johns Lutheran School
4500 Buena Vista Road
Bakersfield, CA 93311
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Johns Lutheran School",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-119.05599600,35.36416800),"
Stockdale Christian Schools
4901 California Avenue
Bakersfield, CA 93309
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Stockdale Christian Schools",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.89846600,35.36522600),"
Turner Christian Academy
9517 Eucalyptus Drive
Bakersfield, CA 93306
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Turner Christian Academy",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.96597200,35.35420300),"
Valley Schools
2300 E. Brundage Lane
Bakersfield, CA 93307
Co-ed school, K-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valley Schools",'Bakersfield=' + Bakersfield.length); Bakersfield[Bakersfield.length] = createMarker(new GPoint(-118.91608800,35.40309000),"
Wonder Window Preschool & Kindergarten
8001 Panorama Drive
Bakersfield, CA 93306
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wonder Window Preschool & Kindergarten",'Bakersfield=' + Bakersfield.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(Bakersfield); 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(Bakersfield);map.removeOverlays(Bakersfield); map.addOverlays(Bakersfield); centerByArray(Bakersfield, false, false); cntMarker += Bakersfield.length; centerByArray(Bakersfield,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; }