function addMarkers(){ mySelect = document.getElementById('selection'); Middletown = [];Warwick = [];Providence = [];W_Warwick = [];Newport = [];Cranston = [];Pascoag = [];Coventry = [];Woonsocket = [];Cumberland = [];Warren = [];East_Greenwich = [];Bristol = [];Portsmouth = [];East_Providence = [];Pawtucket = [];Barrington = [];Riverside = [];Westerly = [];Johnston = [];Central_Falls = [];West_Warwick = [];Greenville = [];mySelect.options[mySelect.options.length] = new Option("Barrington schools",'all=Barrington'); mySelect.options[mySelect.options.length] = new Option("Bristol schools",'all=Bristol'); mySelect.options[mySelect.options.length] = new Option("Central Falls schools",'all=Central_Falls'); mySelect.options[mySelect.options.length] = new Option("Coventry schools",'all=Coventry'); mySelect.options[mySelect.options.length] = new Option("Cranston schools",'all=Cranston'); mySelect.options[mySelect.options.length] = new Option("Cumberland schools",'all=Cumberland'); mySelect.options[mySelect.options.length] = new Option("East Greenwich schools",'all=East_Greenwich'); mySelect.options[mySelect.options.length] = new Option("East Providence schools",'all=East_Providence'); mySelect.options[mySelect.options.length] = new Option("Greenville schools",'all=Greenville'); mySelect.options[mySelect.options.length] = new Option("Johnston schools",'all=Johnston'); mySelect.options[mySelect.options.length] = new Option("Middletown schools",'all=Middletown'); mySelect.options[mySelect.options.length] = new Option("Newport schools",'all=Newport'); mySelect.options[mySelect.options.length] = new Option("Pascoag schools",'all=Pascoag'); mySelect.options[mySelect.options.length] = new Option("Pawtucket schools",'all=Pawtucket'); mySelect.options[mySelect.options.length] = new Option("Portsmouth schools",'all=Portsmouth'); mySelect.options[mySelect.options.length] = new Option("Providence schools",'all=Providence'); mySelect.options[mySelect.options.length] = new Option("Riverside schools",'all=Riverside'); mySelect.options[mySelect.options.length] = new Option("W Warwick schools",'all=W_Warwick'); mySelect.options[mySelect.options.length] = new Option("Warren schools",'all=Warren'); mySelect.options[mySelect.options.length] = new Option("Warwick schools",'all=Warwick'); mySelect.options[mySelect.options.length] = new Option("West Warwick schools",'all=West_Warwick'); mySelect.options[mySelect.options.length] = new Option("Westerly schools",'all=Westerly'); mySelect.options[mySelect.options.length] = new Option("Woonsocket schools",'all=Woonsocket'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Middletown[Middletown.length] = createMarker(new GPoint(-71.29633100,41.52719300),"
All Saints Academy
915 W Main Road
Middletown, RI 02842
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("All Saints Academy",'Middletown=' + Middletown.length); Warwick[Warwick.length] = createMarker(new GPoint(-71.39634700,41.70683400),"
Bishop Hendricken High School
2615 Warwick Avenue
Warwick, RI 02889
All-boys school, 9-12
[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Bishop Hendricken High School",'Warwick=' + Warwick.length); Providence[Providence.length] = createMarker(new GPoint(-71.41502800,41.80164600),"
Bishop Mcvinney Elementary School
155 Gordon Avenue
Providence, RI 02905
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bishop Mcvinney Elementary School",'Providence=' + Providence.length); Providence[Providence.length] = createMarker(new GPoint(-71.44317200,41.82922200),"
Blessed Sacrament School
240 Regent Avenue
Providence, RI 02908
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Blessed Sacrament School",'Providence=' + Providence.length); W_Warwick[W_Warwick.length] = createMarker(new GPoint(-71.52502100,41.70320900),"
Christ The Redeemer Academy
17 Saint John Street
W Warwick, RI 02893
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ The Redeemer Academy",'W_Warwick=' + W_Warwick.length); Newport[Newport.length] = createMarker(new GPoint(-71.33080500,41.46437900),"
Cluny School
75 Brenton Road
Newport, RI 02840
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cluny School",'Newport=' + Newport.length); Cranston[Cranston.length] = createMarker(new GPoint(-71.45586300,41.76165900),"
Cranston Johnston Catholic Regional School
43 Poplar Drive
Cranston, RI 02920
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cranston Johnston Catholic Regional School",'Cranston=' + Cranston.length); Pascoag[Pascoag.length] = createMarker(new GPoint(-71.70435100,41.96002200),"
Fr Holland Catholic Elementary School
180 Sayles Avenue
Pascoag, RI 02859
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fr Holland Catholic Elementary School",'Pascoag=' + Pascoag.length); Coventry[Coventry.length] = createMarker(new GPoint(-71.57451100,41.68054700),"
Fr John J Doyle School
341 S Main Street
Coventry, RI 02816
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fr John J Doyle School",'Coventry=' + Coventry.length); Woonsocket[Woonsocket.length] = createMarker(new GPoint(-71.47988900,42.00368200),"
Good Shepherd Catholic School
1210 Mendon Road
Woonsocket, RI 02895
Co-ed school, 3-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Good Shepherd Catholic School",'Woonsocket=' + Woonsocket.length); Woonsocket[Woonsocket.length] = createMarker(new GPoint(-71.51186200,42.01209500),"
Greater Woonsocket Catholic Regional School
Po Box 487
Woonsocket, RI 02895
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greater Woonsocket Catholic Regional School",'Woonsocket=' + Woonsocket.length); Providence[Providence.length] = createMarker(new GPoint(-71.43313100,41.82328500),"
Holy Ghost School
35 Swiss Street
Providence, RI 02909
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Ghost School",'Providence=' + Providence.length); Providence[Providence.length] = createMarker(new GPoint(-71.44532600,41.84162400),"
La Salle Academy
612 Academy Avenue
Providence, RI 02908
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("La Salle Academy",'Providence=' + Providence.length); Cumberland[Cumberland.length] = createMarker(new GPoint(-71.41518400,42.00870100),"
Mercymount Country Day School
35 Wrentham Road
Cumberland, RI 02864
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mercymount Country Day School",'Cumberland=' + Cumberland.length); Woonsocket[Woonsocket.length] = createMarker(new GPoint(-71.50097900,41.99465200),"
Mount St Charles Academy
800 Logee Street
Woonsocket, RI 02895
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount St Charles Academy",'Woonsocket=' + Woonsocket.length); Woonsocket[Woonsocket.length] = createMarker(new GPoint(-71.51593400,41.98433700),"
Msgr Gadoury Primary School
1371 Park Avenue
Woonsocket, RI 02895
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Msgr Gadoury Primary School",'Woonsocket=' + Woonsocket.length); Coventry[Coventry.length] = createMarker(new GPoint(-71.54787600,41.69782400),"
Notre Dame Reg School
2 Saint Vincent De Paul St
Coventry, RI 02816
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Notre Dame Reg School",'Coventry=' + Coventry.length); Warren[Warren.length] = createMarker(new GPoint(-71.27308400,41.74592200),"
Our Lady Of Fatima High School
360 Market Street
Warren, RI 02885
Co-ed school, 7-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Fatima High School",'Warren=' + Warren.length); East_Greenwich[East_Greenwich.length] = createMarker(new GPoint(-71.45744700,41.65452100),"
Our Lady Of Mercy Regional School
55 4th Avenue
East Greenwich, RI 02818
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Mercy Regional School",'East_Greenwich=' + East_Greenwich.length); Bristol[Bristol.length] = createMarker(new GPoint(-71.27338600,41.67122100),"
Our Lady Of Mt. Carmel School
127 State Street
Bristol, RI 02809
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Our Lady Of Mt. Carmel School",'Bristol=' + Bristol.length); Portsmouth[Portsmouth.length] = createMarker(new GPoint(-71.27272600,41.60010000),"
Portsmouth Abbey School
285 Corys Lane
Portsmouth, RI 02871
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Portsmouth Abbey School",'Portsmouth=' + Portsmouth.length); East_Providence[East_Providence.length] = createMarker(new GPoint(-71.37785300,41.81856200),"
Sacred Heart School
56 Purchase St
East Providence, RI 02914
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sacred Heart School",'East_Providence=' + East_Providence.length); Providence[Providence.length] = createMarker(new GPoint(-71.45302200,41.80780700),"
St. Bartholomew School
315 Laurel Hill Avenue
Providence, RI 02909
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Bartholomew School",'Providence=' + Providence.length); Pawtucket[Pawtucket.length] = createMarker(new GPoint(-71.35366700,41.88795300),"
St. Cecilia School
755 Central Avenue
Pawtucket, RI 02861
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Cecilia School",'Pawtucket=' + Pawtucket.length); Bristol[Bristol.length] = createMarker(new GPoint(-71.27333000,41.67496500),"
St. Elizabeth School
10 Monroe Avenue
Bristol, RI 02809
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Elizabeth School",'Bristol=' + Bristol.length); Warwick[Warwick.length] = createMarker(new GPoint(-71.44189800,41.73129900),"
St. Francis Of Assisi School
610 Jefferson Blvd
Warwick, RI 02886
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Francis Of Assisi School",'Warwick=' + Warwick.length); Pawtucket[Pawtucket.length] = createMarker(new GPoint(-71.35513000,41.88757100),"
St. Leo The Great Elementary School
723 Central Avenue
Pawtucket, RI 02861
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Leo The Great Elementary School",'Pawtucket=' + Pawtucket.length); Barrington[Barrington.length] = createMarker(new GPoint(-71.33951500,41.75093100),"
St. Luke Elementary School
10 Waldron Avenue
Barrington, RI 02806
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Luke Elementary School",'Barrington=' + Barrington.length); East_Providence[East_Providence.length] = createMarker(new GPoint(-71.35071000,41.84459000),"
St. Margaret School
42 Bishop Ave
East Providence, RI 02916
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Margaret School",'East_Providence=' + East_Providence.length); Riverside[Riverside.length] = createMarker(new GPoint(-71.36515700,41.79098200),"
St. Mary Academy-bay View
3070 Pawtucket Avenue
Riverside, RI 02915
All-girls school, PK-12
[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("St. Mary Academy-bay View",'Riverside=' + Riverside.length); Cranston[Cranston.length] = createMarker(new GPoint(-71.46501100,41.78932600),"
St. Mary Elementary School
85 Chester Avenue
Cranston, RI 02920
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary Elementary School",'Cranston=' + Cranston.length); Providence[Providence.length] = createMarker(new GPoint(-71.43665600,41.81737900),"
St. Mary Elementary School
30 Barton Street
Providence, RI 02909
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary Elementary School",'Providence=' + Providence.length); Cranston[Cranston.length] = createMarker(new GPoint(-71.42209700,41.77546500),"
St. Matthew School
1301 Elmwood Avenue
Cranston, RI 02910
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Matthew School",'Cranston=' + Cranston.length); Warwick[Warwick.length] = createMarker(new GPoint(-71.39196200,41.75469000),"
St. Peter School
120 Mayfair Road
Warwick, RI 02888
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Peter School",'Warwick=' + Warwick.length); Westerly[Westerly.length] = createMarker(new GPoint(-71.82871700,41.37326300),"
St. Pius X Elementary School
32 Elm Street
Westerly, RI 02891
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Pius X Elementary School",'Westerly=' + Westerly.length); Pawtucket[Pawtucket.length] = createMarker(new GPoint(-71.37658400,41.87696100),"
St. Raphael Academy
123 Walcott Street
Pawtucket, RI 02860
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Raphael Academy",'Pawtucket=' + Pawtucket.length); Johnston[Johnston.length] = createMarker(new GPoint(-71.48392800,41.79697000),"
St. Rocco School
931 Atwood Avenue
Johnston, RI 02919
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Rocco School",'Johnston=' + Johnston.length); Warwick[Warwick.length] = createMarker(new GPoint(-71.43188200,41.70805500),"
St. Rose Of Lima School
200 Brentwood Avenue
Warwick, RI 02886
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Rose Of Lima School",'Warwick=' + Warwick.length); Providence[Providence.length] = createMarker(new GPoint(-71.46792800,41.83676300),"
St. Thomas Regional School
15 Edendale Avenue
Providence, RI 02911
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Thomas Regional School",'Providence=' + Providence.length); Providence[Providence.length] = createMarker(new GPoint(-71.45316900,41.84430500),"
St Augustine School
635 Mount Pleasant Avenue
Providence, RI 02908
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Augustine School",'Providence=' + Providence.length); Riverside[Riverside.length] = createMarker(new GPoint(-71.35840100,41.77092000),"
St Brendan School
55 Turner Avenue
Riverside, RI 02915
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Brendan School",'Riverside=' + Riverside.length); Central_Falls[Central_Falls.length] = createMarker(new GPoint(-71.40206700,41.88987400),"
St Elizabeth Ann Seton Academy
909 Lonsdale Avenue
Central Falls, RI 02863
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Elizabeth Ann Seton Academy",'Central_Falls=' + Central_Falls.length); West_Warwick[West_Warwick.length] = createMarker(new GPoint(-71.49320000,41.72530000),"
St Joseph School
Wakefield Street Intervale Road
West Warwick, RI 02893
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Joseph School",'West_Warwick=' + West_Warwick.length); Warwick[Warwick.length] = createMarker(new GPoint(-71.39160100,41.71264500),"
St Kevin School
39 Cathedral Road
Warwick, RI 02889
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Kevin School",'Warwick=' + Warwick.length); Pawtucket[Pawtucket.length] = createMarker(new GPoint(-71.38801800,41.87097600),"
St Mary School
167 George Street
Pawtucket, RI 02860
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mary School",'Pawtucket=' + Pawtucket.length); Providence[Providence.length] = createMarker(new GPoint(-71.41944300,41.83263400),"
St Patrick School
244 Smith Street
Providence, RI 02908
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Patrick School",'Providence=' + Providence.length); Cranston[Cranston.length] = createMarker(new GPoint(-71.40004700,41.77686500),"
St Paul School
1789 Broad Street
Cranston, RI 02905
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Paul School",'Cranston=' + Cranston.length); Greenville[Greenville.length] = createMarker(new GPoint(-71.55525000,41.87262900),"
St Philip School
618 Putnam Pike
Greenville, RI 02828
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Philip School",'Greenville=' + Greenville.length); Portsmouth[Portsmouth.length] = createMarker(new GPoint(-71.27393100,41.60020500),"
St Philomena School
324 Corys Lane
Portsmouth, RI 02871
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Philomena School",'Portsmouth=' + Portsmouth.length); Providence[Providence.length] = createMarker(new GPoint(-71.43682600,41.84094600),"
St Pius V Elementary School
49 Elmhurst Avenue
Providence, RI 02908
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Pius V Elementary School",'Providence=' + Providence.length); Pawtucket[Pawtucket.length] = createMarker(new GPoint(-71.35601500,41.86715100),"
St Teresa School
140 Woodhaven Road
Pawtucket, RI 02861
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Teresa School",'Pawtucket=' + Pawtucket.length); Pawtucket[Pawtucket.length] = createMarker(new GPoint(-71.40197700,41.87628500),"
Woodlawn Catholic Regional
61 Hope Street
Pawtucket, RI 02860
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodlawn Catholic Regional",'Pawtucket=' + Pawtucket.length); maxLng = -71.27272600; maxLat = 42.01209500; minLng = -71.82871700; minLat = 41.37326300; reCenterMap(); } // 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//////' + showArray); map.removeOverlays(Barrington); map.removeOverlays(Bristol); map.removeOverlays(Central_Falls); map.removeOverlays(Coventry); map.removeOverlays(Cranston); map.removeOverlays(Cumberland); map.removeOverlays(East_Greenwich); map.removeOverlays(East_Providence); map.removeOverlays(Greenville); map.removeOverlays(Johnston); map.removeOverlays(Middletown); map.removeOverlays(Newport); map.removeOverlays(Pascoag); map.removeOverlays(Pawtucket); map.removeOverlays(Portsmouth); map.removeOverlays(Providence); map.removeOverlays(Riverside); map.removeOverlays(W_Warwick); map.removeOverlays(Warren); map.removeOverlays(Warwick); map.removeOverlays(West_Warwick); map.removeOverlays(Westerly); map.removeOverlays(Woonsocket); 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(Middletown);map.removeOverlays(Barrington); map.removeOverlays(Bristol); map.removeOverlays(Central_Falls); map.removeOverlays(Coventry); map.removeOverlays(Cranston); map.removeOverlays(Cumberland); map.removeOverlays(East_Greenwich); map.removeOverlays(East_Providence); map.removeOverlays(Greenville); map.removeOverlays(Johnston); map.removeOverlays(Middletown); map.removeOverlays(Newport); map.removeOverlays(Pascoag); map.removeOverlays(Pawtucket); map.removeOverlays(Portsmouth); map.removeOverlays(Providence); map.removeOverlays(Riverside); map.removeOverlays(W_Warwick); map.removeOverlays(Warren); map.removeOverlays(Warwick); map.removeOverlays(West_Warwick); map.removeOverlays(Westerly); map.removeOverlays(Woonsocket); map.addOverlays(Barrington); centerByArray(Barrington, false, false); cntMarker += Barrington.length; map.addOverlays(Bristol); centerByArray(Bristol, false, false); cntMarker += Bristol.length; map.addOverlays(Central_Falls); centerByArray(Central_Falls, false, false); cntMarker += Central_Falls.length; map.addOverlays(Coventry); centerByArray(Coventry, false, false); cntMarker += Coventry.length; map.addOverlays(Cranston); centerByArray(Cranston, false, false); cntMarker += Cranston.length; map.addOverlays(Cumberland); centerByArray(Cumberland, false, false); cntMarker += Cumberland.length; map.addOverlays(East_Greenwich); centerByArray(East_Greenwich, false, false); cntMarker += East_Greenwich.length; map.addOverlays(East_Providence); centerByArray(East_Providence, false, false); cntMarker += East_Providence.length; map.addOverlays(Greenville); centerByArray(Greenville, false, false); cntMarker += Greenville.length; map.addOverlays(Johnston); centerByArray(Johnston, false, false); cntMarker += Johnston.length; map.addOverlays(Middletown); centerByArray(Middletown, false, false); cntMarker += Middletown.length; map.addOverlays(Newport); centerByArray(Newport, false, false); cntMarker += Newport.length; map.addOverlays(Pascoag); centerByArray(Pascoag, false, false); cntMarker += Pascoag.length; map.addOverlays(Pawtucket); centerByArray(Pawtucket, false, false); cntMarker += Pawtucket.length; map.addOverlays(Portsmouth); centerByArray(Portsmouth, false, false); cntMarker += Portsmouth.length; map.addOverlays(Providence); centerByArray(Providence, false, false); cntMarker += Providence.length; map.addOverlays(Riverside); centerByArray(Riverside, false, false); cntMarker += Riverside.length; map.addOverlays(W_Warwick); centerByArray(W_Warwick, false, false); cntMarker += W_Warwick.length; map.addOverlays(Warren); centerByArray(Warren, false, false); cntMarker += Warren.length; map.addOverlays(Warwick); centerByArray(Warwick, false, false); cntMarker += Warwick.length; map.addOverlays(West_Warwick); centerByArray(West_Warwick, false, false); cntMarker += West_Warwick.length; map.addOverlays(Westerly); centerByArray(Westerly, false, false); cntMarker += Westerly.length; map.addOverlays(Woonsocket); centerByArray(Woonsocket, false, false); cntMarker += Woonsocket.length; centerByArray(Middletown,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///25400,25356,25328,25389,25348,25278,25341,25387,25349,25378,25405,25301,25346,25294,25391,25393,25396,25336,35707,25361,25388,25397,25401,25271,25383,25305,25377,25386,25392,25403,25429,25363,25279,25280,25317,25375,25390,25404,25374,25395,25398,25389,25376,25381,25379,25362,25402,25385,25382,25399,25384,25433,25342,/all'); //window.open('/map.php?type=2&schools=25400,25356,25328,25389,25348,25278,25341,25387,25349,25378,25405,25301,25346,25294,25391,25393,25396,25336,35707,25361,25388,25397,25401,25271,25383,25305,25377,25386,25392,25403,25429,25363,25279,25280,25317,25375,25390,25404,25374,25395,25398,25389,25376,25381,25379,25362,25402,25385,25382,25399,25384,25433,25342,&school_level=&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; }