function addMarkers() { mySelect = document.getElementById('selection'); Moline = [];Moline[Moline.length] = createMarker(new GPoint(-90.46437073,41.50206375),"
Benjamin Franklin Elementary School
5312 11th Ave C
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Benjamin Franklin Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.47098541,41.46976089),"
Butterworth Elementary School
4205 48th St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Butterworth Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.53290558,41.50483704),"
Ericsson Elementary School
335 5th Ave
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Ericsson Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.51538086,41.48726273),"
Garfield Elementary School
1518 25th Ave
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.47971344,41.49760056),"
George Washington Elementary School
1550 41st St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("George Washington Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.52796173,41.48043060),"
Hamilton Elementary School
700 32nd Ave
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Hamilton Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.48631287,41.45333862),"
Horace Mann Elementary School
3601 69th Ave
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Horace Mann Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.48989900,41.49173300),"
Interdist Ece Program
4000 11th St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Interdist Ece Program",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.51971436,41.46886444),"
Interdist Ece Program Elementary School
4000 11th St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Interdist Ece Program Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.46291351,41.47555161),"
Jane Addams Elementary School
3520 53rd St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jane Addams Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.49497986,41.48566437),"
Jefferson Early Childhood Center
3010 26th Ave
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Jefferson Early Childhood Center",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.52164459,41.49162674),"
John Deere Middle School
2035 11th St
Moline, IL 61265

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("John Deere Middle School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.52210999,41.49693680),"
Lincoln-irving Elementary School
1015 16th Ave
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Lincoln-irving Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.50128174,41.49608231),"
Logan Elementary School
1602 25th St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Logan Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.48831940,41.49141312),"
Moline Alternative High School
3428 Ave The Cities
Moline, IL 61265

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Moline Alternative High School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.48405457,41.49075317),"
Moline Senior High School
3600 Ave The Cities
Moline, IL 61265

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Moline Senior High School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.48826599,41.49140549),"
Rock Island Co Reg Safe School
3430 23rd Ave
Moline, IL 61265

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rock Island Co Reg Safe School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.48551178,41.49100876),"
Roosevelt Elementary School
3530 Ave The Cities
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.51323700,41.49653625),"
Willard Elementary School
1616 16th St
Moline, IL 61265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Willard Elementary School",'Moline=' + Moline.length); Moline[Moline.length] = createMarker(new GPoint(-90.47047424,41.49963760),"
Woodrow Wilson Middle School
1301 48th St
Moline, IL 61265

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Woodrow Wilson Middle School",'Moline=' + Moline.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,10); /* 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(Moline); 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(Moline);map.removeOverlays(Moline); map.addOverlays(Moline); centerByArray(Moline, false, false); cntMarker += Moline.length; centerByArray(Moline,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'); } }