function addMarkers(){ mySelect = document.getElementById('selection'); Glendale = [];Glendale[Glendale.length] = createMarker(new GPoint(-118.24873300,34.14886300),"
A + Adventist Children's Center
234 N Isabel Street
Glendale, CA 91206
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("A + Adventist Children's Center",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.23167400,34.14633700),"
Academy For Arts & Education
1479 E Broadway
Glendale, CA 91205
Co-ed school, K-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Academy For Arts & Education",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.26673900,34.14666800),"
Artek Child Education Center
546 W Broadway
Glendale, CA 91204
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Artek Child Education Center",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.26503600,34.15933000),"
Bonnie Academy
534 W Glenoaks Blvd
Glendale, CA 91202
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bonnie Academy",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.24422700,34.15084100),"
Cedar Montessori
345 N Cedar Street
Glendale, CA 91206
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cedar Montessori",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.26596500,34.23895500),"
Chamlian Armenian School
4444 Lowell Avenue
Glendale, CA 91214
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Chamlian Armenian School",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.29487600,34.17461500),"
Clearview
1930 W Glenoaks
Glendale, CA 91201
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clearview",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.29487600,34.17461500),"
Curry Educational Services-cle
1930 W Glenoaks Blvd
Glendale, CA 91201
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Curry Educational Services-cle",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.23757300,34.14256300),"
First Lutheran School
1300 E Colorado Street
Glendale, CA 91205
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Lutheran School",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.22632200,34.15610900),"
Glendale Adventist Academy
700 Kimlin Dr
Glendale, CA 91206
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Glendale Adventist Academy",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.26194100,34.15413700),"
Glendale Montessori
413 W Doran
Glendale, CA 91203
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Glendale Montessori",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.26480000,34.16346500),"
Glendale Montessori Elementary School
1212 N Pacific Avenue
Glendale, CA 91202
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Glendale Montessori Elementary School",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.23442400,34.14343700),"
Glendale Preschool & Kindergarten
225 S Verdugo Road
Glendale, CA 91205
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Glendale Preschool & Kindergarten",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.25250500,34.14151200),"
Holy Family Grade School
400 South Louise Street
Glendale, CA 91205
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Family Grade School",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.25127000,34.14091400),"
Holy Family High School
400 East Lomita Avenue
Glendale, CA 91205
All-girls school, 9-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Holy Family High School",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.23167400,34.14633700),"
Hoskins Center Inc
1479 E Broadway
Glendale, CA 91205
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hoskins Center Inc",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.25559500,34.15994100),"
Incarnation Parish School
123 W Glenoaks Blvd
Glendale, CA 91202
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Incarnation Parish School",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.25526500,34.16397300),"
Salem Lutheran School
1211 N Brand Blvd
Glendale, CA 91202
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Salem Lutheran School",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.26533500,34.14666300),"
Sonshine Christian Nursery School
522 W Broadway
Glendale, CA 91204
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sonshine Christian Nursery School",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.23943300,34.14526300),"
St Mary's Armenian Tufenkian
1200 Carlton Drive
Glendale, CA 91205
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mary's Armenian Tufenkian",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.22983300,34.18323900),"
Study Circle Preschool
2512 Weston Place
Glendale, CA 91208
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Study Circle Preschool",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.24395800,34.14616300),"
Tobinworld
920 E Broadway
Glendale, CA 91205
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tobinworld",'Glendale=' + Glendale.length); Glendale[Glendale.length] = createMarker(new GPoint(-118.24906500,34.15015500),"
Zion Lutheran School
301 N Isabel Street
Glendale, CA 91206
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zion Lutheran School",'Glendale=' + Glendale.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(Glendale); 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(Glendale); map.addOverlays(Glendale); centerByArray(Glendale, false, false); cntMarker += Glendale.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////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; }