function addMarkers() { mySelect = document.getElementById('selection'); Norwalk = [];Norwalk[Norwalk.length] = createMarker(new GPoint(-118.07534027,33.90391159),"
Chavez (cesar) Elementary School
12110 East Walnut St.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Chavez (cesar) Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.06433105,33.91125870),"
Clarke (jack B.) High School
13200 South Bloomfield Ave.
Norwalk, CA 90650

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clarke (jack B.) High School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.09796906,33.90681458),"
Corvallis Middle School
11032 East Leffingwell Rd.
Norwalk, CA 90650

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Corvallis Middle School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.08428955,33.92966461),"
Cresson Elementary School
11650 East Cresson St.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Cresson Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.06436157,33.89466095),"
Dolland (john) Elementary School
15021 South Bloomfield Ave.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Dolland (john) Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.07636261,33.89385223),"
Edmondson (earl E.) Elementary School
15121 South Grayland Ave.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edmondson (earl E.) Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.10206604,33.89457703),"
Glazier (anna M.) Elementary School
10932 East Excelsior Dr.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Glazier (anna M.) Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.05523682,33.90824127),"
Glenn (john H.) High School
13520 Shoemaker Ave.
Norwalk, CA 90650

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Glenn (john H.) High School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.05725861,33.90946198),"
Hargitt (cora) Middle School
12940 East Foster Rd.
Norwalk, CA 90650

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Hargitt (cora) Middle School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.08266449,33.89081573),"
Huerta (dolores) Elementary School
15415 South Pioneer Blvd.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Huerta (dolores) Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.09506226,33.90937042),"
Johnston (d. D.) Elementary School
13421 South Fairford
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Johnston (d. D.) Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.07676697,33.92969894),"
Lakeland Elementary School
11224 Bombardier Ave.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lakeland Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.09903717,33.92786407),"
Lakeside Middle School
11000 East Kenney St.
Norwalk, CA 90650

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Lakeside Middle School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.09551239,33.89654541),"
Lampton (loretta) Elementary School
14716 Elmcroft Ave.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lampton (loretta) Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.08673096,33.89614105),"
Los Alisos Middle School
14800 South Jersey Ave.
Norwalk, CA 90650

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Los Alisos Middle School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.06583405,33.90972137),"
Moffitt (thomas B.) Elementary School
13323 South Goller Ave.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Moffitt (thomas B.) Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.08663177,33.90926743),"
Morrison (julia B.) Elementary School
13510 South Maidstone
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Morrison (julia B.) Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.10233307,33.90911865),"
New River Elementary School
13432 South Halcourt Ave.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("New River Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.09181213,33.90822983),"
Norwalk High School
11356 East Leffingwell Rd.
Norwalk, CA 90650

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Norwalk High School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.08706665,33.89590836),"
Nuffer (john H.) Elementary School
14821 South Jersey Ave.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Nuffer (john H.) Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.08603668,33.92141342),"
Orr (william W.) Elementary School
12130 South Jersey Ave.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Orr (william W.) Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.07533264,33.92056274),"
Paddison Elementary School
12100 Crewe St.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Paddison Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.07816315,33.88412476),"
Sanchez (arturo) Elementary School
11960 East 162nd St.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Sanchez (arturo) Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.10103607,33.92618942),"
Studebaker Elementary School
11800 Halcourt Ave.
Norwalk, CA 90650

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Studebaker Elementary School",'Norwalk=' + Norwalk.length); Norwalk[Norwalk.length] = createMarker(new GPoint(-118.07280731,33.90176010),"
Waite (nettie L.) Middle School
14320 South Norwalk Blvd.
Norwalk, CA 90650

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Waite (nettie L.) Middle School",'Norwalk=' + Norwalk.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(Norwalk); 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(Norwalk);map.removeOverlays(Norwalk); map.addOverlays(Norwalk); centerByArray(Norwalk, false, false); cntMarker += Norwalk.length; centerByArray(Norwalk,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'); } }