function addMarkers() { mySelect = document.getElementById('selection'); Concord = [];Concord[Concord.length] = createMarker(new GPoint(-121.95729828,37.96481705),"
Ayers Elementary School
5120 Myrtle Dr.
Concord, CA 94521

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ayers Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.04432678,37.95433426),"
Cambridge Elementary School
1135 Lacey Ln.
Concord, CA 94520

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cambridge Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-121.96818542,37.94838333),"
Clayton Valley High School
1101 Alberta Way
Concord, CA 94521

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clayton Valley High School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-121.99120331,37.97712326),"
Concord High School
4200 Concord Blvd.
Concord, CA 94521

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Concord High School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.02597809,37.96921921),"
Crossroads High Continuation School
1266 San Carlos Ave.
Concord, CA 94518

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Crossroads High Continuation School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.04421997,37.94493866),"
Diablo Day Community
3024 Willow Pass Rd.
Concord, CA 94519

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Diablo Day Community",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-121.99253082,37.97591782),"
El Dorado Middle School
1750 West St.
Concord, CA 94521

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("El Dorado Middle School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.01189423,37.96890640),"
El Monte Elementary School
1400 Dina Dr.
Concord, CA 94518

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("El Monte Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.03620148,37.99635696),"
Glenbrook Middle School
2351 Olivera Rd.
Concord, CA 94520

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Glenbrook Middle School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-121.95622253,37.94204712),"
Highlands Elementary School
1326 Pennsylvania Blvd.
Concord, CA 94521

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Highlands Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.02675629,37.99240875),"
Holbrook Elementary School
3333 Ronald Way
Concord, CA 94519

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holbrook Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.03872681,37.96550751),"
Meadow Homes Elementary School
1371 Detroit Ave.
Concord, CA 94520

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Meadow Homes Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.00471497,37.98900986),"
Monte Gardens Elementary School
3841 Larkspur Dr.
Concord, CA 94519

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Monte Gardens Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-121.98070526,37.96849442),"
Mountain View Elementary School
1705 Thornwood Dr.
Concord, CA 94521

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mountain View Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.03643036,37.98424149),"
Mt. Diablo High School
2455 Grant St.
Concord, CA 94520

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mt. Diablo High School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-121.96818542,37.94838333),"
Nueva Vista High Continuation School
1101 Alberta Way
Concord, CA 94521

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nueva Vista High Continuation School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.03479767,37.93978882),"
Oak Grove Middle School
2050 Minert Rd.
Concord, CA 94518

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Oak Grove Middle School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.02771759,37.98070908),"
Olympic Continuation High School
2730 Salvio St.
Concord, CA 94519

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Olympic Continuation High School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-121.95470428,37.94112778),"
Pine Hollow Middle School
5522 Pine Hollow Rd.
Concord, CA 94521

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Pine Hollow Middle School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-121.97140503,37.96295929),"
Silverwood Elementary School
1649 Claycord Ave.
Concord, CA 94521

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Silverwood Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.07025146,37.93520355),"
Special Education
2900 Avon Ave.
Concord, CA 94520

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Special Education",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-121.99120331,37.97712326),"
Summit High Continuation School
4200 Concord Blvd.
Concord, CA 94521

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Summit High Continuation School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.02938080,37.99999619),"
Sun Terrace Elementary School
2448 Floyd Ln.
Concord, CA 94520

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sun Terrace Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.00318146,37.98553467),"
Sunrise (special Education) Elementary School
1861 Silverwood Dr.
Concord, CA 94519

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sunrise (special Education) Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-121.99257660,37.97588348),"
Westwood Elementary School
1748 West St.
Concord, CA 94521

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Westwood Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.01792145,37.94076920),"
Woodside Elementary School
761 San Simeon Dr.
Concord, CA 94518

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodside Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.01554108,37.98028564),"
Wren Avenue Elementary School
3339 Wren Ave.
Concord, CA 94519

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Wren Avenue Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.02981567,37.94940186),"
Ygnacio Valley Elementary School
2217 Chalomar Rd.
Concord, CA 94518

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ygnacio Valley Elementary School",'Concord=' + Concord.length); Concord[Concord.length] = createMarker(new GPoint(-122.02388000,37.93721771),"
Ygnacio Valley High School
755 Oak Grove Rd.
Concord, CA 94518

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ygnacio Valley High School",'Concord=' + Concord.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,10); /* 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(Concord); 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(Concord);map.removeOverlays(Concord); map.addOverlays(Concord); centerByArray(Concord, false, false); cntMarker += Concord.length; centerByArray(Concord,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'); } }