function addMarkers(){ mySelect = document.getElementById('selection'); Glendale = [];Phoenix = [];Rimrock = [];Tucson = [];Scottsdale = [];Kingman = [];Chandler = [];Mayer = [];Tempe = [];Paradise_Valley = [];Gilbert = [];Mesa = [];Prescott = [];mySelect.options[mySelect.options.length] = new Option("Chandler schools",'all=Chandler'); mySelect.options[mySelect.options.length] = new Option("Gilbert schools",'all=Gilbert'); mySelect.options[mySelect.options.length] = new Option("Glendale schools",'all=Glendale'); mySelect.options[mySelect.options.length] = new Option("Kingman schools",'all=Kingman'); mySelect.options[mySelect.options.length] = new Option("Mayer schools",'all=Mayer'); mySelect.options[mySelect.options.length] = new Option("Mesa schools",'all=Mesa'); mySelect.options[mySelect.options.length] = new Option("Paradise Valley schools",'all=Paradise_Valley'); mySelect.options[mySelect.options.length] = new Option("Phoenix schools",'all=Phoenix'); mySelect.options[mySelect.options.length] = new Option("Prescott schools",'all=Prescott'); mySelect.options[mySelect.options.length] = new Option("Rimrock schools",'all=Rimrock'); mySelect.options[mySelect.options.length] = new Option("Scottsdale schools",'all=Scottsdale'); mySelect.options[mySelect.options.length] = new Option("Tempe schools",'all=Tempe'); mySelect.options[mySelect.options.length] = new Option("Tucson schools",'all=Tucson'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Glendale[Glendale.length] = createMarker(new GPoint(-112.18963300,33.58168300),"
Abcs/smithey-link Education Center
6015 W Peoria Avenue
Glendale, AZ 85302
Co-ed school, 4-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Abcs/smithey-link Education Center",'Glendale=' + Glendale.length); Phoenix[Phoenix.length] = createMarker(new GPoint(-112.11300000,34.74880000),"
Arcadia Montessori School
5115 E Virginia Avenue
Phoenix, AZ 85008
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Arcadia Montessori School",'Phoenix=' + Phoenix.length); Rimrock[Rimrock.length] = createMarker(new GPoint(-111.78037100,34.64175600),"
Copper Canyon Academy
Po Box 230
Rimrock, AZ 86335
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Copper Canyon Academy",'Rimrock=' + Rimrock.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.85270000,32.25010000),"
Desert Christian High School
Po Box 31240 7525 E Speedway Blvd
Tucson, AZ 85710
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Desert Christian High School",'Tucson=' + Tucson.length); Phoenix[Phoenix.length] = createMarker(new GPoint(-112.00779600,33.58265800),"
Desert Voices Oral Learning Center
3426 E Shea Blvd
Phoenix, AZ 85028
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Desert Voices Oral Learning Center",'Phoenix=' + Phoenix.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.81388400,32.30155100),"
Fenster School
8500 E Ocotillo Drive
Tucson, AZ 85750
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fenster School",'Tucson=' + Tucson.length); Phoenix[Phoenix.length] = createMarker(new GPoint(-111.98074600,33.62054600),"
Jess Schwartz College Prep: The Jewish Community's High School
4645 East Marilyn Road
Phoenix, AZ 85032
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jess Schwartz College Prep: The Jewish Community's High School",'Phoenix=' + Phoenix.length); Scottsdale[Scottsdale.length] = createMarker(new GPoint(-111.92565000,33.60173600),"
The King David School
12753 N Scottsdale Road
Scottsdale, AZ 85254
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The King David School",'Scottsdale=' + Scottsdale.length); Kingman[Kingman.length] = createMarker(new GPoint(-114.05542800,35.18882400),"
Kingman Adventist Christian School
Po Box 3098
Kingman, AZ 86402
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kingman Adventist Christian School",'Kingman=' + Kingman.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.96133400,32.32669400),"
Kino School
6625 North First Ave
Tucson, AZ 85718
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kino School",'Tucson=' + Tucson.length); Chandler[Chandler.length] = createMarker(new GPoint(-111.87056400,33.33525700),"
Montessori Day Schools Lakeshore
1700 W Warner Road
Chandler, AZ 85224
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Day Schools Lakeshore",'Chandler=' + Chandler.length); Mayer[Mayer.length] = createMarker(new GPoint(-112.15059200,34.34842300),"
The Orme School Of Arizona
Hc 63 Box 3040 1000 Orme School Road
Mayer, AZ 86333
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Orme School Of Arizona",'Mayer=' + Mayer.length); Tempe[Tempe.length] = createMarker(new GPoint(-111.92613500,33.40593000),"
Our Lady Of Mount Carmel School
2117 S Rural Road
Tempe, AZ 85282
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Mount Carmel School",'Tempe=' + Tempe.length); Paradise_Valley[Paradise_Valley.length] = createMarker(new GPoint(-111.99745200,33.51710000),"
Phoenix Country Day School
3901 E. Stanford Dr.
Paradise Valley, AZ 85253
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Phoenix Country Day School",'Paradise_Valley=' + Paradise_Valley.length); Gilbert[Gilbert.length] = createMarker(new GPoint(-111.78958400,33.32589500),"
Rancho Solano Private Schools
1305 S Gilbert Road
Gilbert, AZ 85296
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rancho Solano Private Schools",'Gilbert=' + Gilbert.length); Scottsdale[Scottsdale.length] = createMarker(new GPoint(-111.95881500,33.62619900),"
Rancho Solano Private Schools-greenway Campus
5656 E Greenway Road
Scottsdale, AZ 85254
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rancho Solano Private Schools-greenway Campus",'Scottsdale=' + Scottsdale.length); Mesa[Mesa.length] = createMarker(new GPoint(-111.80512400,33.42853100),"
Redeemer Christian School (Classical)
719 North Stapley Drive
Mesa, AZ 85203
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Redeemer Christian School (Classical)",'Mesa=' + Mesa.length); Prescott[Prescott.length] = createMarker(new GPoint(-112.47491400,34.54271200),"
Sacred Heart Catholic School
131 N Summit Street
Prescott, AZ 86301
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Catholic School",'Prescott=' + Prescott.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.89198800,32.24353700),"
St. Cyril Elementary School
4725 E Pima Street
Tucson, AZ 85712
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Cyril Elementary School",'Tucson=' + Tucson.length); Scottsdale[Scottsdale.length] = createMarker(new GPoint(-111.91769800,33.49586100),"
Scottsdale United Methodist Co Operative Preschool and Kindergarten
4140 N. Miller Rd
Scottsdale, AZ 85251
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Scottsdale United Methodist Co Operative Preschool and Kindergarten",'Scottsdale=' + Scottsdale.length); Tucson[Tucson.length] = createMarker(new GPoint(-110.93536100,32.21899300),"
St Ambrose School
300 S Tucson Blvd
Tucson, AZ 85716
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Ambrose School",'Tucson=' + Tucson.length); Tucson[Tucson.length] = createMarker(new GPoint(-111.02955400,32.36177300),"
St Elizabeth Ann Seton School
8560 N Shannon Road
Tucson, AZ 85742
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Elizabeth Ann Seton School",'Tucson=' + Tucson.length); Phoenix[Phoenix.length] = createMarker(new GPoint(-112.13393400,33.58449800),"
St Jerome Elementary School
10815 N 35th Avenue
Phoenix, AZ 85029
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Jerome Elementary School",'Phoenix=' + Phoenix.length); Phoenix[Phoenix.length] = createMarker(new GPoint(-112.10365400,33.45133700),"
St Matthew School
2038 W Van Buren Street
Phoenix, AZ 85009
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Matthew School",'Phoenix=' + Phoenix.length); Phoenix[Phoenix.length] = createMarker(new GPoint(-111.99490900,33.59688800),"
Valley Child Care & Learning Center
4041 E Cactus Road
Phoenix, AZ 85032
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valley Child Care & Learning Center",'Phoenix=' + Phoenix.length); map.removeOverlays(Chandler); map.removeOverlays(Gilbert); map.removeOverlays(Glendale); map.removeOverlays(Kingman); map.removeOverlays(Mayer); map.removeOverlays(Mesa); map.removeOverlays(Paradise_Valley); map.removeOverlays(Phoenix); map.removeOverlays(Prescott); map.removeOverlays(Rimrock); map.removeOverlays(Scottsdale); map.removeOverlays(Tempe); map.removeOverlays(Tucson); setTimeout(function(){map.addOverlays(Chandler)},1000); setTimeout(function(){map.addOverlays(Gilbert)},1000); setTimeout(function(){map.addOverlays(Glendale)},1000); setTimeout(function(){map.addOverlays(Kingman)},1000); setTimeout(function(){map.addOverlays(Mayer)},1000); setTimeout(function(){map.addOverlays(Mesa)},1000); setTimeout(function(){map.addOverlays(Paradise_Valley)},1000); setTimeout(function(){map.addOverlays(Phoenix)},1000); setTimeout(function(){map.addOverlays(Prescott)},1000); setTimeout(function(){map.addOverlays(Rimrock)},1000); setTimeout(function(){map.addOverlays(Scottsdale)},1000); setTimeout(function(){map.addOverlays(Tempe)},1000); setTimeout(function(){map.addOverlays(Tucson)},1000); maxLng = -110.81388400; maxLat = 35.18882400; minLng = -114.05542800; minLat = 32.21899300; 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(Chandler); map.removeOverlays(Gilbert); map.removeOverlays(Glendale); map.removeOverlays(Kingman); map.removeOverlays(Mayer); map.removeOverlays(Mesa); map.removeOverlays(Paradise_Valley); map.removeOverlays(Phoenix); map.removeOverlays(Prescott); map.removeOverlays(Rimrock); map.removeOverlays(Scottsdale); map.removeOverlays(Tempe); map.removeOverlays(Tucson); 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(Glendale);map.removeOverlays(Chandler); map.removeOverlays(Gilbert); map.removeOverlays(Glendale); map.removeOverlays(Kingman); map.removeOverlays(Mayer); map.removeOverlays(Mesa); map.removeOverlays(Paradise_Valley); map.removeOverlays(Phoenix); map.removeOverlays(Prescott); map.removeOverlays(Rimrock); map.removeOverlays(Scottsdale); map.removeOverlays(Tempe); map.removeOverlays(Tucson); map.addOverlays(Chandler); centerByArray(Chandler, false, false); cntMarker += Chandler.length; map.addOverlays(Gilbert); centerByArray(Gilbert, false, false); cntMarker += Gilbert.length; map.addOverlays(Glendale); centerByArray(Glendale, false, false); cntMarker += Glendale.length; map.addOverlays(Kingman); centerByArray(Kingman, false, false); cntMarker += Kingman.length; map.addOverlays(Mayer); centerByArray(Mayer, false, false); cntMarker += Mayer.length; map.addOverlays(Mesa); centerByArray(Mesa, false, false); cntMarker += Mesa.length; map.addOverlays(Paradise_Valley); centerByArray(Paradise_Valley, false, false); cntMarker += Paradise_Valley.length; map.addOverlays(Phoenix); centerByArray(Phoenix, false, false); cntMarker += Phoenix.length; map.addOverlays(Prescott); centerByArray(Prescott, false, false); cntMarker += Prescott.length; map.addOverlays(Rimrock); centerByArray(Rimrock, false, false); cntMarker += Rimrock.length; map.addOverlays(Scottsdale); centerByArray(Scottsdale, false, false); cntMarker += Scottsdale.length; map.addOverlays(Tempe); centerByArray(Tempe, false, false); cntMarker += Tempe.length; map.addOverlays(Tucson); centerByArray(Tucson, false, false); cntMarker += Tucson.length; centerByArray(Glendale,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///35805,737,668,653,35799,541,548,35798,605,35804,35805,35796,35800,737,668,653,507,788,703,711,35806,671,686,35802,818,637,605,698,694,35803,/all'); //window.open('/map.php?type=2&schools=35805,737,668,653,35799,541,548,35798,605,35804,35805,35796,35800,737,668,653,507,788,703,711,35806,671,686,35802,818,637,605,698,694,35803,&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; }