function addMarkers(){ mySelect = document.getElementById('selection'); Evansville = [];mySelect.options[mySelect.options.length] = new Option("Evansville schools",'all=Evansville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Evansville[Evansville.length] = createMarker(new GPoint(-87.51226100,37.96598500),"
Christ The King School
3101 Bayard Park Drive
Evansville, IN 47714
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ The King School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.64248200,37.98346700),"
Corpus Christi School
5530 Hogue Road
Evansville, IN 47712
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Corpus Christi School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.56388800,38.03480800),"
Evansville Adventist Christian School
41 W Camp Ground Road
Evansville, IN 47710
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Evansville Adventist Christian School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.49762500,37.96973700),"
Evansville Christian School
4400 Lincoln Avenue
Evansville, IN 47714
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Evansville Christian School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.49247300,38.00915600),"
Evansville Day School
3400 N Green River Road
Evansville, IN 47715
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Evansville Day School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.56205300,37.98113700),"
Evansville Lutheran School
120 E Michigan Street
Evansville, IN 47711
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Evansville Lutheran School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-117.98748600,33.89448500),"
Faith Heritage Christian School
1613 Pollack Avenue
Evansville, IN 47714
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Heritage Christian School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.50150900,37.99753700),"
Good Shepherd School
2301 N Stockwell Road
Evansville, IN 47715
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Good Shepherd School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.57558100,38.02140600),"
Holy Redeemer School
918 W Mill Road
Evansville, IN 47710
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Redeemer School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.49297300,37.95825600),"
Holy Rosary School
1303 S Green River Road
Evansville, IN 47715
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Rosary School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.53872200,37.95262600),"
Holy Spirit School
1760 Lodge Avenue
Evansville, IN 47714
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Spirit School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.56460600,37.97226600),"
Joshua Academy
867 Walnut St
Evansville, IN 47713
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Joshua Academy",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.62695300,37.95991000),"
Landmark Christian School
1624 Helfrich Ave
Evansville, IN 47712
Co-ed school, 3-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Landmark Christian School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.49629700,37.96086300),"
Montessori Academy
4611 Adams Avenue
Evansville, IN 47714
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Academy",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.63856300,38.01691300),"
Resurrection Elementary School
5301 New Harmony Road
Evansville, IN 47720
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Resurrection Elementary School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.55352200,37.99673700),"
St. Theresa Elementary School
700 Herndon Drive
Evansville, IN 47711
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Theresa Elementary School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.54102500,37.97125600),"
St Benedict Elementary School
530 S Harlan Avenue
Evansville, IN 47714
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Benedict Elementary School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.64743600,38.06596200),"
St Joseph Elementary School
6130 W Saint Joseph Road
Evansville, IN 47720
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Joseph Elementary School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.52799900,38.08906200),"
Trinity Lutheran School
1403 W Boonvle New Hrmy
Evansville, IN 47725
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.61619400,37.95922700),"
Westside Catholic School
1620 Glendale Avenue
Evansville, IN 47712
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westside Catholic School",'Evansville=' + Evansville.length); Evansville[Evansville.length] = createMarker(new GPoint(-87.59447500,37.98159800),"
Westside Catholic School/st Boniface Campus
2031 W Michigan Street
Evansville, IN 47712
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Westside Catholic School/st Boniface Campus",'Evansville=' + Evansville.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(Evansville); 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(Evansville);map.removeOverlays(Evansville); map.addOverlays(Evansville); centerByArray(Evansville, false, false); cntMarker += Evansville.length; centerByArray(Evansville,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; }