function addMarkers(){ mySelect = document.getElementById('selection'); Bloomington = [];mySelect.options[mySelect.options.length] = new Option("Bloomington schools",'all=Bloomington'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.53085100,39.18643700),"
Adventist Christian Academy
301 E Matlock Road
Bloomington, IN 47408
Co-ed school, K-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Adventist Christian Academy",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.51722200,39.14625800),"
Bloomington Dev Learning Center
1807 S Highland
Bloomington, IN 47401
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bloomington Dev Learning Center",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.51724800,39.14618700),"
Bloomington Developmental Learning Center
1807 S Highland Avenue
Bloomington, IN 47401
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bloomington Developmental Learning Center",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.51734800,39.14440200),"
Bloomington Montessori School
1835 S Highland Avenue
Bloomington, IN 47401
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bloomington Montessori School",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.54002200,39.10803400),"
Clear Creek Christian School
5405 S Rogers Street
Bloomington, IN 47403
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clear Creek Christian School",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.58293700,39.19178200),"
Grace Baptist Academy
2320 N Smith Pike
Bloomington, IN 47404
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Baptist Academy",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.61119900,39.21542100),"
H.o.p.e. Christian Academy
4100 N Hartstrait Road
Bloomington, IN 47404
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("H.o.p.e. Christian Academy",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.52230700,39.16124400),"
Harmony School
909 E. 2nd St.
Bloomington, IN 47401
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Harmony School",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.51493900,39.15044900),"
Kid Angles
1500 E Hillside Drive
Bloomington, IN 47401
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kid Angles",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.54545100,39.11446300),"
Lighthouse Christian Academy
1201 W That Rd
Bloomington, IN 47403
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lighthouse Christian Academy",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.55612200,39.16389100),"
Montessori Community School
479 Landmark Ave
Bloomington, IN 47403
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Community School",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.58087600,39.14846600),"
Penny Lane West
1920 Yost Ave
Bloomington, IN 47403
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Penny Lane West",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.46570000,39.09360000),"
Pinnacle School
Po Box 2375
Bloomington, IN 47402
Co-ed school, 1-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pinnacle School",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.53297800,39.19284800),"
The Prep School
525 W. 17th Street
Bloomington, IN 47404
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Prep School",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.50674100,39.16416300),"
St. Charles School
2224 E 3rd Street
Bloomington, IN 47401
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Charles School",'Bloomington=' + Bloomington.length); Bloomington[Bloomington.length] = createMarker(new GPoint(-86.48099000,39.11928300),"
Wings Of Love Christian Academy.
4000 E Moores Creek Road
Bloomington, IN 47401
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wings Of Love Christian Academy.",'Bloomington=' + Bloomington.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(Bloomington); 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(Bloomington);map.removeOverlays(Bloomington); map.addOverlays(Bloomington); centerByArray(Bloomington, false, false); cntMarker += Bloomington.length; centerByArray(Bloomington,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; }