function addMarkers(){ mySelect = document.getElementById('selection'); Pensacola = [];Walnut_Hill = [];Molino = [];mySelect.options[mySelect.options.length] = new Option("Molino schools",'all=Molino'); mySelect.options[mySelect.options.length] = new Option("Pensacola schools",'all=Pensacola'); mySelect.options[mySelect.options.length] = new Option("Walnut Hill schools",'all=Walnut_Hill'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.16780300,30.49860900),"
Aletheia Christian Academy
1700 Woodchuck Avenue
Pensacola, FL 32504
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Aletheia Christian Academy",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.37822000,30.53520000),"
Beulah Christian Academy
6200 W 9 Mile Rd
Pensacola, FL 32526
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beulah Christian Academy",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.20917800,30.52843000),"
Blessed Star Christian School
9151 N Davis Highway
Pensacola, FL 32514
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blessed Star Christian School",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.29595900,30.43183700),"
Christian Institute of Arts & Sciences
6100 West Fairfield Dr
Pensacola, FL 32506
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Institute of Arts & Sciences",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.17897200,30.43958100),"
Creative Learning Academy
3151 Hyde Park Road
Pensacola, FL 32503
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Creative Learning Academy",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.20163300,30.42683600),"
East Hill Christian
1301 East Gonzalez Street
Pensacola, FL 32501
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("East Hill Christian",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.21635000,30.41570900),"
Episcopal Day School Of Christ
223 N Palafox Street
Pensacola, FL 32502
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Episcopal Day School Of Christ",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.21723800,30.42084000),"
Escambia Christian School
Po Box 17449
Pensacola, FL 32522
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Escambia Christian School",'Pensacola=' + Pensacola.length); Walnut_Hill[Walnut_Hill.length] = createMarker(new GPoint(-87.44070000,30.89400000),"
Heritage Christian Academy
Box 56
Walnut Hill, FL 32568
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian Academy",'Walnut_Hill=' + Walnut_Hill.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.22900400,30.44088000),"
House Of God Academy
2851 N E Street
Pensacola, FL 32501
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("House Of God Academy",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.25487100,30.47208400),"
Jubilee Christian Academy
5910 N W Street
Pensacola, FL 32505
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jubilee Christian Academy",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.29994700,30.42266400),"
Little Flower School
6495 Lillian Highway
Pensacola, FL 32506
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Little Flower School",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.25614900,30.47504700),"
Marcus Pointe Christian School And Preschool
6205 N W Street
Pensacola, FL 32505
Co-ed school, NS-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marcus Pointe Christian School And Preschool",'Pensacola=' + Pensacola.length); Molino[Molino.length] = createMarker(new GPoint(-87.37700000,30.72650000),"
Molino Christian School
P O Box 356
Molino, FL 32577
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Molino Christian School",'Molino=' + Molino.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.20298400,30.42593600),"
Montessori School Of Pensacola
1010 N 12th Ave
Pensacola, FL 32503
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori School Of Pensacola",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.20264300,30.43118000),"
Pensacola Liberal Arts
1550 N 13th Avenue
Pensacola, FL 32503
Co-ed school, 8-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pensacola Liberal Arts",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.32242300,30.51344700),"
Pensacola Mennonite Christian School
8261 Eight Mile Creek Road
Pensacola, FL 32526
Co-ed school, 1-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pensacola Mennonite Christian School",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.22129300,30.52282600),"
Pensacola Sda Jr. Academy
8751 University Parkway
Pensacola, FL 32514
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pensacola Sda Jr. Academy",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.27400300,30.38653300),"
Redeemer Lutheran School
333 Commerce Street
Pensacola, FL 32507
Co-ed school, 5-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Redeemer Lutheran School",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.20449400,30.43149800),"
Sacred Heart Cathedral School
1603 N 12th Avenue
Pensacola, FL 32503
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart Cathedral School",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.27812200,30.38357500),"
St. John The Evangelist School
325 South Navy Blvd
Pensacola, FL 32507
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. John The Evangelist School",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.17943300,30.43962100),"
St. Paul Catholic School
3121 Hyde Park Road
Pensacola, FL 32503
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Paul Catholic School",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.20908600,30.40903000),"
Seville Montessori School
400 S Alcaniz Street
Pensacola, FL 32502
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Seville Montessori School",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.19023100,30.46162600),"
Sl Jones Christian Academy
2480 Tronjo Circle
Pensacola, FL 32503
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sl Jones Christian Academy",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.20606200,30.43816100),"
Smart Schools Inc
2311 N 12th Avenue
Pensacola, FL 32503
Co-ed school, 2-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Smart Schools Inc",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.19788900,30.51703000),"
Trinitas Christian School
3301 E Johnson Avenue
Pensacola, FL 32514
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinitas Christian School",'Pensacola=' + Pensacola.length); Pensacola[Pensacola.length] = createMarker(new GPoint(-87.40254600,30.35923800),"
Triple D's Christian Academy
3290 Bauer Road
Pensacola, FL 32506
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Triple D's Christian Academy",'Pensacola=' + Pensacola.length); Walnut_Hill[Walnut_Hill.length] = createMarker(new GPoint(-87.43493900,30.84414100),"
Walnut Hill Christian School
6990 Highway 97
Walnut Hill, FL 32568
school, 1-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Walnut Hill Christian School",'Walnut_Hill=' + Walnut_Hill.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/////1/' + showArray); map.removeOverlays(Molino); map.removeOverlays(Pensacola); map.removeOverlays(Walnut_Hill); 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(Pensacola);map.removeOverlays(Molino); map.removeOverlays(Pensacola); map.removeOverlays(Walnut_Hill); map.addOverlays(Molino); centerByArray(Molino, false, false); cntMarker += Molino.length; map.addOverlays(Pensacola); centerByArray(Pensacola, false, false); cntMarker += Pensacola.length; map.addOverlays(Walnut_Hill); centerByArray(Walnut_Hill, false, false); cntMarker += Walnut_Hill.length; centerByArray(Pensacola,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=1&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; }