function addMarkers() { mySelect = document.getElementById('selection'); St_Paul = [];Little_Canada = [];Maplewood = [];St_Paul[St_Paul.length] = createMarker(new GPoint(-93.07096863,44.99186325),"
Arlington House Sp Ed
704 Larpenteur Avenue
St Paul, MN 55117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Arlington House Sp Ed",'St_Paul=' + St_Paul.length); St_Paul[St_Paul.length] = createMarker(new GPoint(-93.10609436,44.98615646),"
Arlington Senior High School
1495 Rice Street
St. Paul, MN 55117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Arlington Senior High School",'St_Paul=' + St_Paul.length); Little_Canada[Little_Canada.length] = createMarker(new GPoint(-93.10399628,45.01336288),"
Capitol View Center
70 W County Road B2
Little Canada, MN 55117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Capitol View Center",'Little_Canada=' + Little_Canada.length); St_Paul[St_Paul.length] = createMarker(new GPoint(-93.13240814,44.97907257),"
Como Park Elementary School
780 W Wheelock Parkway
St. Paul, MN 55117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Como Park Elementary School",'St_Paul=' + St_Paul.length); St_Paul[St_Paul.length] = createMarker(new GPoint(-93.13029480,44.97624969),"
Como Park Senior High School
740 W Rose Avenue
St. Paul, MN 55117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Como Park Senior High School",'St_Paul=' + St_Paul.length); St_Paul[St_Paul.length] = createMarker(new GPoint(-93.13240814,44.97907257),"
Como Special/hartzell Elementary School
780 W Wheelock Parkway
St. Paul, MN 55117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Como Special/hartzell Elementary School",'St_Paul=' + St_Paul.length); Little_Canada[Little_Canada.length] = createMarker(new GPoint(-93.07895400,45.02080000),"
Creative Alternatives Program
70 W County Road B2
Little Canada, MN 55117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Creative Alternatives Program",'Little_Canada=' + Little_Canada.length); St_Paul[St_Paul.length] = createMarker(new GPoint(-93.12300873,44.97033691),"
Crossroads Montessori
543 Front Avenue
St. Paul, MN 55117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Crossroads Montessori",'St_Paul=' + St_Paul.length); St_Paul[St_Paul.length] = createMarker(new GPoint(-93.12300873,44.97033691),"
Crossroads Science Elementary School
543 Front Ave.
St. Paul, MN 55117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Crossroads Science Elementary School",'St_Paul=' + St_Paul.length); St_Paul[St_Paul.length] = createMarker(new GPoint(-93.10845947,44.91943741),"
E Ed Crossroads Elementary School
543 Front Street
St. Paul, MN 55117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("E Ed Crossroads Elementary School",'St_Paul=' + St_Paul.length); Maplewood[Maplewood.length] = createMarker(new GPoint(-93.07649231,44.99927139),"
Edgerton Elementary School
1929 Edgerton Street
Maplewood, MN 55117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Edgerton Elementary School",'Maplewood=' + Maplewood.length); Little_Canada[Little_Canada.length] = createMarker(new GPoint(-93.08470154,45.02516174),"
Little Canada Elementary School
400 Eli Road
Little Canada, MN 55117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Little Canada Elementary School",'Little_Canada=' + Little_Canada.length); Little_Canada[Little_Canada.length] = createMarker(new GPoint(-93.10169983,44.99280167),"
Middle School Alc
15 E. County Rd. B-2
Little Canada, MN 55117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Middle School Alc",'Little_Canada=' + Little_Canada.length); St_Paul[St_Paul.length] = createMarker(new GPoint(-90.36033500,38.59217600),"
Mississippi Magnet Elementary School
1575 L''orient Street
St. Paul, MN 55117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Mississippi Magnet Elementary School",'St_Paul=' + St_Paul.length); Little_Canada[Little_Canada.length] = createMarker(new GPoint(-93.08793640,45.02515793),"
N.e. Metro Alc High School
70 W. Co. Rd. B-2
Little Canada, MN 55117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("N.e. Metro Alc High School",'Little_Canada=' + Little_Canada.length); Little_Canada[Little_Canada.length] = createMarker(new GPoint(-93.07895400,45.02080000),"
N.e.metro Targeted Services
70 W.cty Road B-2
Little Canada, MN 55117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("N.e.metro Targeted Services",'Little_Canada=' + Little_Canada.length); Little_Canada[Little_Canada.length] = createMarker(new GPoint(-93.07895400,45.02080000),"
Ne Metro Int. #916 Project Return
70 W County Road B2
Little Canada, MN 55117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ne Metro Int. #916 Project Return",'Little_Canada=' + Little_Canada.length); St_Paul[St_Paul.length] = createMarker(new GPoint(-93.10008240,44.97573853),"
North End Elementary School
27 E Geranium Avenue
St. Paul, MN 55117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("North End Elementary School",'St_Paul=' + St_Paul.length); Little_Canada[Little_Canada.length] = createMarker(new GPoint(-93.10169983,44.99280167),"
Roseville Area Middle School
15 E County Road B2
Little Canada, MN 55117

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Roseville Area Middle School",'Little_Canada=' + Little_Canada.length); Maplewood[Maplewood.length] = createMarker(new GPoint(-93.09523010,45.00616455),"
Tri District Elementary School
30 E County Road B
Maplewood, MN 55117

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Tri District Elementary School",'Maplewood=' + Maplewood.length); St_Paul[St_Paul.length] = createMarker(new GPoint(-93.10999298,44.97273636),"
Washington Technology Magnet Middle School
1041 Marion Street
St. Paul, MN 55117

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Washington Technology Magnet Middle School",'St_Paul=' + St_Paul.length); Little_Canada[Little_Canada.length] = createMarker(new GPoint(-93.10589700,45.01352200),"
Wels South
70 W County Road B2
Little Canada, MN 55117

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wels South",'Little_Canada=' + Little_Canada.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(St_Paul); map.removeOverlays(Little_Canada); map.removeOverlays(Maplewood); 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(St_Paul);map.removeOverlays(St_Paul); map.removeOverlays(Little_Canada); map.removeOverlays(Maplewood); map.addOverlays(St_Paul); centerByArray(St_Paul, false, false); cntMarker += St_Paul.length; map.addOverlays(Little_Canada); centerByArray(Little_Canada, false, false); cntMarker += Little_Canada.length; map.addOverlays(Maplewood); centerByArray(Maplewood, false, false); cntMarker += Maplewood.length; centerByArray(St_Paul,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'); } }