function addMarkers(){ mySelect = document.getElementById('selection'); Carmel = [];La_Jolla = [];North_Hollywood = [];San_Francisco = [];Irvine = [];Coronado = [];Sierra_Madre = [];Barstow = [];Los_Angeles = [];Oxnard = [];Saratoga = [];Laguna_Hills = [];Temecula = [];Rancho_Santa_Margarita = [];Redondo_Beach = [];Merced = [];San_Juan_Capistrano = [];Palm_Desert = [];Altadena = [];Winnetka = [];Aliso_Viejo = [];San_Mateo = [];Pacific_Palisades = [];Carmichael = [];Visalia = [];Rancho_Cucamonga = [];San_Jose = [];Apple_Valley = [];Foster_City = [];South_Pasadena = [];Roseville = [];Chula_Vista = [];Downey = [];Thousand_Oaks = [];Oakland = [];Compton = [];Menlo_Park = [];Monterey = [];mySelect.options[mySelect.options.length] = new Option("Aliso Viejo schools",'all=Aliso_Viejo'); mySelect.options[mySelect.options.length] = new Option("Altadena schools",'all=Altadena'); mySelect.options[mySelect.options.length] = new Option("Apple Valley schools",'all=Apple_Valley'); mySelect.options[mySelect.options.length] = new Option("Barstow schools",'all=Barstow'); mySelect.options[mySelect.options.length] = new Option("Carmel schools",'all=Carmel'); mySelect.options[mySelect.options.length] = new Option("Carmichael schools",'all=Carmichael'); mySelect.options[mySelect.options.length] = new Option("Chula Vista schools",'all=Chula_Vista'); mySelect.options[mySelect.options.length] = new Option("Compton schools",'all=Compton'); mySelect.options[mySelect.options.length] = new Option("Coronado schools",'all=Coronado'); mySelect.options[mySelect.options.length] = new Option("Downey schools",'all=Downey'); mySelect.options[mySelect.options.length] = new Option("Foster City schools",'all=Foster_City'); mySelect.options[mySelect.options.length] = new Option("Irvine schools",'all=Irvine'); mySelect.options[mySelect.options.length] = new Option("La Jolla schools",'all=La_Jolla'); mySelect.options[mySelect.options.length] = new Option("Laguna Hills schools",'all=Laguna_Hills'); mySelect.options[mySelect.options.length] = new Option("Los Angeles schools",'all=Los_Angeles'); mySelect.options[mySelect.options.length] = new Option("Menlo Park schools",'all=Menlo_Park'); mySelect.options[mySelect.options.length] = new Option("Merced schools",'all=Merced'); mySelect.options[mySelect.options.length] = new Option("Monterey schools",'all=Monterey'); mySelect.options[mySelect.options.length] = new Option("North Hollywood schools",'all=North_Hollywood'); mySelect.options[mySelect.options.length] = new Option("Oakland schools",'all=Oakland'); mySelect.options[mySelect.options.length] = new Option("Oxnard schools",'all=Oxnard'); mySelect.options[mySelect.options.length] = new Option("Pacific Palisades schools",'all=Pacific_Palisades'); mySelect.options[mySelect.options.length] = new Option("Palm Desert schools",'all=Palm_Desert'); mySelect.options[mySelect.options.length] = new Option("Rancho Cucamonga schools",'all=Rancho_Cucamonga'); mySelect.options[mySelect.options.length] = new Option("Rancho Santa Margarita schools",'all=Rancho_Santa_Margarita'); mySelect.options[mySelect.options.length] = new Option("Redondo Beach schools",'all=Redondo_Beach'); mySelect.options[mySelect.options.length] = new Option("Roseville schools",'all=Roseville'); mySelect.options[mySelect.options.length] = new Option("San Francisco schools",'all=San_Francisco'); mySelect.options[mySelect.options.length] = new Option("San Jose schools",'all=San_Jose'); mySelect.options[mySelect.options.length] = new Option("San Juan Capistrano schools",'all=San_Juan_Capistrano'); mySelect.options[mySelect.options.length] = new Option("San Mateo schools",'all=San_Mateo'); mySelect.options[mySelect.options.length] = new Option("Saratoga schools",'all=Saratoga'); mySelect.options[mySelect.options.length] = new Option("Sierra Madre schools",'all=Sierra_Madre'); mySelect.options[mySelect.options.length] = new Option("South Pasadena schools",'all=South_Pasadena'); mySelect.options[mySelect.options.length] = new Option("Temecula schools",'all=Temecula'); mySelect.options[mySelect.options.length] = new Option("Thousand Oaks schools",'all=Thousand_Oaks'); mySelect.options[mySelect.options.length] = new Option("Visalia schools",'all=Visalia'); mySelect.options[mySelect.options.length] = new Option("Winnetka schools",'all=Winnetka'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Carmel[Carmel.length] = createMarker(new GPoint(-121.83476700,36.53088200),"
All Saints' Episcopal Day School
8060 Carmel Valley Road
Carmel, CA 93923
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("All Saints' Episcopal Day School",'Carmel=' + Carmel.length); La_Jolla[La_Jolla.length] = createMarker(new GPoint(-117.27939000,32.84145700),"
The Bishop's School
7607 La Jolla Blvd
La Jolla, CA 92037
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Bishop's School",'La_Jolla=' + La_Jolla.length); North_Hollywood[North_Hollywood.length] = createMarker(new GPoint(-118.39663200,34.15299200),"
Campbell Hall School
4533 Laurel Canyon Blvd
North Hollywood, CA 91607
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Campbell Hall School",'North_Hollywood=' + North_Hollywood.length); San_Francisco[San_Francisco.length] = createMarker(new GPoint(-122.41377500,37.79227700),"
Cathedral School For Boys
1275 Sacramento Street
San Francisco, CA 94108
All-boys school, K-8
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Cathedral School For Boys",'San_Francisco=' + San_Francisco.length); Irvine[Irvine.length] = createMarker(new GPoint(-117.80227100,33.68037900),"
The Children's Center Of St An
4400 Barranca Pkwy
Irvine, CA 92604
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Children's Center Of St An",'Irvine=' + Irvine.length); Coronado[Coronado.length] = createMarker(new GPoint(-117.17720000,32.68390000),"
Christ Church Day School
Po Box 180755
Coronado, CA 92178
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ Church Day School",'Coronado=' + Coronado.length); Sierra_Madre[Sierra_Madre.length] = createMarker(new GPoint(-118.05233300,34.16525100),"
The Gooden School
192 N Baldwin Avenue
Sierra Madre, CA 91024
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Gooden School",'Sierra_Madre=' + Sierra_Madre.length); North_Hollywood[North_Hollywood.length] = createMarker(new GPoint(-118.41263200,34.13785000),"
Harvard-westlake School
3700 Coldwater Canyon Avenue
North Hollywood, CA 91604
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harvard-westlake School",'North_Hollywood=' + North_Hollywood.length); Barstow[Barstow.length] = createMarker(new GPoint(-117.02194000,34.89343700),"
Mount Saint Joseph Catholic School
555 East Mountain View
Barstow, CA 92311
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount Saint Joseph Catholic School",'Barstow=' + Barstow.length); Los_Angeles[Los_Angeles.length] = createMarker(new GPoint(-118.29018900,33.99063700),"
Nativity School
943 W. 57th Street
Los Angeles, CA 90033
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Nativity School",'Los_Angeles=' + Los_Angeles.length); Oxnard[Oxnard.length] = createMarker(new GPoint(-119.16833300,34.20759900),"
Our Lady Of Guadalupe School
530 N Juanita Avenue
Oxnard, CA 93030
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Guadalupe School",'Oxnard=' + Oxnard.length); Saratoga[Saratoga.length] = createMarker(new GPoint(-122.01480900,37.27134300),"
Saint Andrew's Episcopal School
13601 Saratoga Ave.
Saratoga, CA 95070
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Saint Andrew's Episcopal School",'Saratoga=' + Saratoga.length); Laguna_Hills[Laguna_Hills.length] = createMarker(new GPoint(-117.71116800,33.61665100),"
St. George S Academy
23802 Avenida De La Carlota
Laguna Hills, CA 92653
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. George S Academy",'Laguna_Hills=' + Laguna_Hills.length); Temecula[Temecula.length] = createMarker(new GPoint(-117.08940900,33.51687500),"
St. Jeanne De Lestonnac
32650 Avenida Lestonnac
Temecula, CA 92592
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Jeanne De Lestonnac",'Temecula=' + Temecula.length); Rancho_Santa_Margarita[Rancho_Santa_Margarita.length] = createMarker(new GPoint(-117.60041600,33.64457400),"
St. John's Episcopal School
30382 Via Con Dios
Rancho Santa Margarita, CA 92688
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John's Episcopal School",'Rancho_Santa_Margarita=' + Rancho_Santa_Margarita.length); Redondo_Beach[Redondo_Beach.length] = createMarker(new GPoint(-118.37673400,33.81697400),"
St. Lawrence Martyr Elem. School
1950 So Prospect Ave
Redondo Beach, CA 90277
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Lawrence Martyr Elem. School",'Redondo_Beach=' + Redondo_Beach.length); Merced[Merced.length] = createMarker(new GPoint(-120.47362600,37.33196300),"
St. Luke's Day School
350 W Yosemite Avenue
Merced, CA 95348
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Luke's Day School",'Merced=' + Merced.length); San_Juan_Capistrano[San_Juan_Capistrano.length] = createMarker(new GPoint(-117.64808600,33.50254600),"
St. Margaret S Episcopal School
31641 La Novia Avenue
San Juan Capistrano, CA 92675
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Margaret S Episcopal School",'San_Juan_Capistrano=' + San_Juan_Capistrano.length); Palm_Desert[Palm_Desert.length] = createMarker(new GPoint(-116.39116900,33.71869000),"
St. Margaret's Episcopal School
47-535 Highway 74
Palm Desert, CA 92260
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Margaret's Episcopal School",'Palm_Desert=' + Palm_Desert.length); Altadena[Altadena.length] = createMarker(new GPoint(-118.12911000,34.19021200),"
St. Mark's School
1050 E Altadena Drive
Altadena, CA 91001
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mark's School",'Altadena=' + Altadena.length); Winnetka[Winnetka.length] = createMarker(new GPoint(-118.57083300,34.19987700),"
St. Martin Fields Parish School
7136 Winnetka Avenue
Winnetka, CA 91306
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Martin Fields Parish School",'Winnetka=' + Winnetka.length); Aliso_Viejo[Aliso_Viejo.length] = createMarker(new GPoint(-117.72565200,33.55429900),"
St. Mary And All Angels School
7 Pursuit
Aliso Viejo, CA 92656
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary And All Angels School",'Aliso_Viejo=' + Aliso_Viejo.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); Pacific_Palisades[Pacific_Palisades.length] = createMarker(new GPoint(-118.54125000,34.05312000),"
St. Matthews Parish School
1031 Bienveneda Avenue
Pacific Palisades, CA 90272
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Matthews Parish School",'Pacific_Palisades=' + Pacific_Palisades.length); Carmichael[Carmichael.length] = createMarker(new GPoint(-121.35511400,38.60387800),"
St. Michael's Episcopal Day School
2140 Mission Ave.
Carmichael, CA 95608
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Michael's Episcopal Day School",'Carmichael=' + Carmichael.length); San_Francisco[San_Francisco.length] = createMarker(new GPoint(-122.39658500,37.71939400),"
St. Paul Of The Shipwreck Catholic
1060 Key Ave At 3rd Street
San Francisco, CA 94124
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Paul Of The Shipwreck Catholic",'San_Francisco=' + San_Francisco.length); Visalia[Visalia.length] = createMarker(new GPoint(-119.35861500,36.34176300),"
St. Pauls School
6101 W Goshen Avenue
Visalia, CA 93291
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Pauls School",'Visalia=' + Visalia.length); Rancho_Cucamonga[Rancho_Cucamonga.length] = createMarker(new GPoint(-117.59200000,34.13370000),"
St. Peter & St. Paul School
P.o. Box 248
Rancho Cucamonga, CA 91701
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Peter & St. Paul School",'Rancho_Cucamonga=' + Rancho_Cucamonga.length); San_Jose[San_Jose.length] = createMarker(new GPoint(-121.83087200,37.24116300),"
St. Stephens Episcopal School
420 Allegan Circle
San Jose, CA 95123
Co-ed school, PK-7
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Stephens Episcopal School",'San_Jose=' + San_Jose.length); Apple_Valley[Apple_Valley.length] = createMarker(new GPoint(-117.24184700,34.53795800),"
St. Timothy's Preparatory School
15757 Saint Timothy Rd
Apple Valley, CA 92307
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Timothy's Preparatory School",'Apple_Valley=' + Apple_Valley.length); Foster_City[Foster_City.length] = createMarker(new GPoint(-122.27238400,37.54544500),"
St Ambrose Sea Breeze School
900 Edgewater Blvd
Foster City, CA 94404
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Ambrose Sea Breeze School",'Foster_City=' + Foster_City.length); Carmel[Carmel.length] = createMarker(new GPoint(-121.80600800,36.52038500),"
St Dunstan's Episcopal School
28003 Robinson Canyon Road
Carmel, CA 93923
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Dunstan's Episcopal School",'Carmel=' + Carmel.length); South_Pasadena[South_Pasadena.length] = createMarker(new GPoint(-118.15384400,34.11190000),"
St James Parish Day School & Kindergarten
1325 Monterey Road
South Pasadena, CA 91030
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St James Parish Day School & Kindergarten",'South_Pasadena=' + South_Pasadena.length); Roseville[Roseville.length] = createMarker(new GPoint(-121.37092300,38.77795400),"
St John's School
4501 Bob Doyle Drive
Roseville, CA 95747
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John's School",'Roseville=' + Roseville.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); Downey[Downey.length] = createMarker(new GPoint(-118.12682400,33.94966200),"
St Mark's Episcopal School
10354 Downey Avenue
Downey, CA 90241
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mark's Episcopal School",'Downey=' + Downey.length); Thousand_Oaks[Thousand_Oaks.length] = createMarker(new GPoint(-118.84989300,34.20023700),"
St Patrick's Episcopal Day School
One Church Road
Thousand Oaks, CA 91362
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Patrick's Episcopal Day School",'Thousand_Oaks=' + Thousand_Oaks.length); Oakland[Oakland.length] = createMarker(new GPoint(-122.26014700,37.81146200),"
St Pauls Episcopal School
116 Montecito Avenue
Oakland, CA 94610
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Pauls Episcopal School",'Oakland=' + Oakland.length); Compton[Compton.length] = createMarker(new GPoint(-118.22843400,33.89387500),"
St Timothys Episcopal School
312 S Oleander Avenue
Compton, CA 90220
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Timothys Episcopal School",'Compton=' + Compton.length); Menlo_Park[Menlo_Park.length] = createMarker(new GPoint(-122.20871500,37.42080900),"
Trinity School
2650 Sand Hill Road
Menlo Park, CA 94025
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity School",'Menlo_Park=' + Menlo_Park.length); Monterey[Monterey.length] = createMarker(new GPoint(-121.79409200,36.57576500),"
York School
9501 York Road
Monterey, CA 93940
Co-ed school, 8-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("York School",'Monterey=' + Monterey.length); map.removeOverlays(Aliso_Viejo); map.removeOverlays(Altadena); map.removeOverlays(Apple_Valley); map.removeOverlays(Barstow); map.removeOverlays(Carmel); map.removeOverlays(Carmichael); map.removeOverlays(Chula_Vista); map.removeOverlays(Compton); map.removeOverlays(Coronado); map.removeOverlays(Downey); map.removeOverlays(Foster_City); map.removeOverlays(Irvine); map.removeOverlays(La_Jolla); map.removeOverlays(Laguna_Hills); map.removeOverlays(Los_Angeles); map.removeOverlays(Menlo_Park); map.removeOverlays(Merced); map.removeOverlays(Monterey); map.removeOverlays(North_Hollywood); map.removeOverlays(Oakland); map.removeOverlays(Oxnard); map.removeOverlays(Pacific_Palisades); map.removeOverlays(Palm_Desert); map.removeOverlays(Rancho_Cucamonga); map.removeOverlays(Rancho_Santa_Margarita); map.removeOverlays(Redondo_Beach); map.removeOverlays(Roseville); map.removeOverlays(San_Francisco); map.removeOverlays(San_Jose); map.removeOverlays(San_Juan_Capistrano); map.removeOverlays(San_Mateo); map.removeOverlays(Saratoga); map.removeOverlays(Sierra_Madre); map.removeOverlays(South_Pasadena); map.removeOverlays(Temecula); map.removeOverlays(Thousand_Oaks); map.removeOverlays(Visalia); map.removeOverlays(Winnetka); setTimeout(function(){map.addOverlays(Aliso_Viejo)},1000); setTimeout(function(){map.addOverlays(Altadena)},1000); setTimeout(function(){map.addOverlays(Apple_Valley)},1000); setTimeout(function(){map.addOverlays(Barstow)},1000); setTimeout(function(){map.addOverlays(Carmel)},1000); setTimeout(function(){map.addOverlays(Carmichael)},1000); setTimeout(function(){map.addOverlays(Chula_Vista)},1000); setTimeout(function(){map.addOverlays(Compton)},1000); setTimeout(function(){map.addOverlays(Coronado)},1000); setTimeout(function(){map.addOverlays(Downey)},1000); setTimeout(function(){map.addOverlays(Foster_City)},1000); setTimeout(function(){map.addOverlays(Irvine)},1000); setTimeout(function(){map.addOverlays(La_Jolla)},1000); setTimeout(function(){map.addOverlays(Laguna_Hills)},1000); setTimeout(function(){map.addOverlays(Los_Angeles)},1000); setTimeout(function(){map.addOverlays(Menlo_Park)},1000); setTimeout(function(){map.addOverlays(Merced)},1000); setTimeout(function(){map.addOverlays(Monterey)},1000); setTimeout(function(){map.addOverlays(North_Hollywood)},1000); setTimeout(function(){map.addOverlays(Oakland)},1000); setTimeout(function(){map.addOverlays(Oxnard)},1000); setTimeout(function(){map.addOverlays(Pacific_Palisades)},1000); setTimeout(function(){map.addOverlays(Palm_Desert)},1000); setTimeout(function(){map.addOverlays(Rancho_Cucamonga)},1000); setTimeout(function(){map.addOverlays(Rancho_Santa_Margarita)},1000); setTimeout(function(){map.addOverlays(Redondo_Beach)},1000); setTimeout(function(){map.addOverlays(Roseville)},1000); setTimeout(function(){map.addOverlays(San_Francisco)},1000); setTimeout(function(){map.addOverlays(San_Jose)},1000); setTimeout(function(){map.addOverlays(San_Juan_Capistrano)},1000); setTimeout(function(){map.addOverlays(San_Mateo)},1000); setTimeout(function(){map.addOverlays(Saratoga)},1000); setTimeout(function(){map.addOverlays(Sierra_Madre)},1000); setTimeout(function(){map.addOverlays(South_Pasadena)},1000); setTimeout(function(){map.addOverlays(Temecula)},1000); setTimeout(function(){map.addOverlays(Thousand_Oaks)},1000); setTimeout(function(){map.addOverlays(Visalia)},1000); setTimeout(function(){map.addOverlays(Winnetka)},1000); maxLng = -116.39116900; maxLat = 38.77795400; minLng = -122.41377500; minLat = 32.62744000; reCenterMap(); } // 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(Aliso_Viejo); map.removeOverlays(Altadena); map.removeOverlays(Apple_Valley); map.removeOverlays(Barstow); map.removeOverlays(Carmel); map.removeOverlays(Carmichael); map.removeOverlays(Chula_Vista); map.removeOverlays(Compton); map.removeOverlays(Coronado); map.removeOverlays(Downey); map.removeOverlays(Foster_City); map.removeOverlays(Irvine); map.removeOverlays(La_Jolla); map.removeOverlays(Laguna_Hills); map.removeOverlays(Los_Angeles); map.removeOverlays(Menlo_Park); map.removeOverlays(Merced); map.removeOverlays(Monterey); map.removeOverlays(North_Hollywood); map.removeOverlays(Oakland); map.removeOverlays(Oxnard); map.removeOverlays(Pacific_Palisades); map.removeOverlays(Palm_Desert); map.removeOverlays(Rancho_Cucamonga); map.removeOverlays(Rancho_Santa_Margarita); map.removeOverlays(Redondo_Beach); map.removeOverlays(Roseville); map.removeOverlays(San_Francisco); map.removeOverlays(San_Jose); map.removeOverlays(San_Juan_Capistrano); map.removeOverlays(San_Mateo); map.removeOverlays(Saratoga); map.removeOverlays(Sierra_Madre); map.removeOverlays(South_Pasadena); map.removeOverlays(Temecula); map.removeOverlays(Thousand_Oaks); map.removeOverlays(Visalia); map.removeOverlays(Winnetka); 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(Carmel);map.removeOverlays(Aliso_Viejo); map.removeOverlays(Altadena); map.removeOverlays(Apple_Valley); map.removeOverlays(Barstow); map.removeOverlays(Carmel); map.removeOverlays(Carmichael); map.removeOverlays(Chula_Vista); map.removeOverlays(Compton); map.removeOverlays(Coronado); map.removeOverlays(Downey); map.removeOverlays(Foster_City); map.removeOverlays(Irvine); map.removeOverlays(La_Jolla); map.removeOverlays(Laguna_Hills); map.removeOverlays(Los_Angeles); map.removeOverlays(Menlo_Park); map.removeOverlays(Merced); map.removeOverlays(Monterey); map.removeOverlays(North_Hollywood); map.removeOverlays(Oakland); map.removeOverlays(Oxnard); map.removeOverlays(Pacific_Palisades); map.removeOverlays(Palm_Desert); map.removeOverlays(Rancho_Cucamonga); map.removeOverlays(Rancho_Santa_Margarita); map.removeOverlays(Redondo_Beach); map.removeOverlays(Roseville); map.removeOverlays(San_Francisco); map.removeOverlays(San_Jose); map.removeOverlays(San_Juan_Capistrano); map.removeOverlays(San_Mateo); map.removeOverlays(Saratoga); map.removeOverlays(Sierra_Madre); map.removeOverlays(South_Pasadena); map.removeOverlays(Temecula); map.removeOverlays(Thousand_Oaks); map.removeOverlays(Visalia); map.removeOverlays(Winnetka); map.addOverlays(Aliso_Viejo); centerByArray(Aliso_Viejo, false, false); cntMarker += Aliso_Viejo.length; map.addOverlays(Altadena); centerByArray(Altadena, false, false); cntMarker += Altadena.length; map.addOverlays(Apple_Valley); centerByArray(Apple_Valley, false, false); cntMarker += Apple_Valley.length; map.addOverlays(Barstow); centerByArray(Barstow, false, false); cntMarker += Barstow.length; map.addOverlays(Carmel); centerByArray(Carmel, false, false); cntMarker += Carmel.length; map.addOverlays(Carmichael); centerByArray(Carmichael, false, false); cntMarker += Carmichael.length; map.addOverlays(Chula_Vista); centerByArray(Chula_Vista, false, false); cntMarker += Chula_Vista.length; map.addOverlays(Compton); centerByArray(Compton, false, false); cntMarker += Compton.length; map.addOverlays(Coronado); centerByArray(Coronado, false, false); cntMarker += Coronado.length; map.addOverlays(Downey); centerByArray(Downey, false, false); cntMarker += Downey.length; map.addOverlays(Foster_City); centerByArray(Foster_City, false, false); cntMarker += Foster_City.length; map.addOverlays(Irvine); centerByArray(Irvine, false, false); cntMarker += Irvine.length; map.addOverlays(La_Jolla); centerByArray(La_Jolla, false, false); cntMarker += La_Jolla.length; map.addOverlays(Laguna_Hills); centerByArray(Laguna_Hills, false, false); cntMarker += Laguna_Hills.length; map.addOverlays(Los_Angeles); centerByArray(Los_Angeles, false, false); cntMarker += Los_Angeles.length; map.addOverlays(Menlo_Park); centerByArray(Menlo_Park, false, false); cntMarker += Menlo_Park.length; map.addOverlays(Merced); centerByArray(Merced, false, false); cntMarker += Merced.length; map.addOverlays(Monterey); centerByArray(Monterey, false, false); cntMarker += Monterey.length; map.addOverlays(North_Hollywood); centerByArray(North_Hollywood, false, false); cntMarker += North_Hollywood.length; map.addOverlays(Oakland); centerByArray(Oakland, false, false); cntMarker += Oakland.length; map.addOverlays(Oxnard); centerByArray(Oxnard, false, false); cntMarker += Oxnard.length; map.addOverlays(Pacific_Palisades); centerByArray(Pacific_Palisades, false, false); cntMarker += Pacific_Palisades.length; map.addOverlays(Palm_Desert); centerByArray(Palm_Desert, false, false); cntMarker += Palm_Desert.length; map.addOverlays(Rancho_Cucamonga); centerByArray(Rancho_Cucamonga, false, false); cntMarker += Rancho_Cucamonga.length; map.addOverlays(Rancho_Santa_Margarita); centerByArray(Rancho_Santa_Margarita, false, false); cntMarker += Rancho_Santa_Margarita.length; map.addOverlays(Redondo_Beach); centerByArray(Redondo_Beach, false, false); cntMarker += Redondo_Beach.length; map.addOverlays(Roseville); centerByArray(Roseville, false, false); cntMarker += Roseville.length; map.addOverlays(San_Francisco); centerByArray(San_Francisco, false, false); cntMarker += San_Francisco.length; map.addOverlays(San_Jose); centerByArray(San_Jose, false, false); cntMarker += San_Jose.length; map.addOverlays(San_Juan_Capistrano); centerByArray(San_Juan_Capistrano, false, false); cntMarker += San_Juan_Capistrano.length; map.addOverlays(San_Mateo); centerByArray(San_Mateo, false, false); cntMarker += San_Mateo.length; map.addOverlays(Saratoga); centerByArray(Saratoga, false, false); cntMarker += Saratoga.length; map.addOverlays(Sierra_Madre); centerByArray(Sierra_Madre, false, false); cntMarker += Sierra_Madre.length; map.addOverlays(South_Pasadena); centerByArray(South_Pasadena, false, false); cntMarker += South_Pasadena.length; map.addOverlays(Temecula); centerByArray(Temecula, false, false); cntMarker += Temecula.length; map.addOverlays(Thousand_Oaks); centerByArray(Thousand_Oaks, false, false); cntMarker += Thousand_Oaks.length; map.addOverlays(Visalia); centerByArray(Visalia, false, false); cntMarker += Visalia.length; map.addOverlays(Winnetka); centerByArray(Winnetka, false, false); cntMarker += Winnetka.length; centerByArray(Carmel,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///4370,35548,1571,2342,4280,30596,4111,3871,4283,4114,4255,3657,1235,35318,4286,4275,4256,1746,4116,3868,3644,3995,3091,4490,4279,1571,36203,3291,4150,4280,4317,4053,4090,30596,1629,4184,4237,4111,4149,3871,4397,4021,4836,4178,4192,4125,/all'); //window.open('/map.php?type=2&schools=4370,35548,1571,2342,4280,30596,4111,3871,4283,4114,4255,3657,1235,35318,4286,4275,4256,1746,4116,3868,3644,3995,3091,4490,4279,1571,36203,3291,4150,4280,4317,4053,4090,30596,1629,4184,4237,4111,4149,3871,4397,4021,4836,4178,4192,4125,&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; }