function addMarkers() { mySelect = document.getElementById('selection'); Dunlap = [];Bartonville = [];Peoria = [];Brimfield = [];Chillicothe = [];Elmwood = [];Farmington = [];Hanna_City = [];Glasford = [];Mossville = [];Peoria_Heights = [];Princeville = [];mySelect.options[mySelect.options.length] = new Option("Bartonville schools",'all=Bartonville'); mySelect.options[mySelect.options.length] = new Option("Brimfield schools",'all=Brimfield'); mySelect.options[mySelect.options.length] = new Option("Chillicothe schools",'all=Chillicothe'); mySelect.options[mySelect.options.length] = new Option("Dunlap schools",'all=Dunlap'); mySelect.options[mySelect.options.length] = new Option("Elmwood schools",'all=Elmwood'); mySelect.options[mySelect.options.length] = new Option("Farmington schools",'all=Farmington'); mySelect.options[mySelect.options.length] = new Option("Glasford schools",'all=Glasford'); mySelect.options[mySelect.options.length] = new Option("Hanna City schools",'all=Hanna_City'); mySelect.options[mySelect.options.length] = new Option("Mossville schools",'all=Mossville'); mySelect.options[mySelect.options.length] = new Option("Peoria schools",'all=Peoria'); mySelect.options[mySelect.options.length] = new Option("Peoria Heights schools",'all=Peoria_Heights'); mySelect.options[mySelect.options.length] = new Option("Princeville schools",'all=Princeville'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Dunlap[Dunlap.length] = createMarker(new GPoint(-89.63040924,40.84274292),"
",iconRd); mySelect.options[mySelect.options.length] = new Option("Banner Elementary School",'Dunlap=' + Dunlap.length); Bartonville[Bartonville.length] = createMarker(new GPoint(-89.65181732,40.64939880),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Bartonville Elementary School",'Bartonville=' + Bartonville.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.61978149,40.67898941),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Blaine-sumner Middle School",'Peoria=' + Peoria.length); Brimfield[Brimfield.length] = createMarker(new GPoint(-89.85320282,40.82519913),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Brimfield Grade School",'Brimfield=' + Brimfield.length); Brimfield[Brimfield.length] = createMarker(new GPoint(-89.85320282,40.82519913),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Brimfield High School",'Brimfield=' + Brimfield.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.63585663,40.69586182),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Calvin Coolidge Middle School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.60288239,40.76471329),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Charles A Lindbergh Middle School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.67342377,40.75685883),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Charter Oak Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.59371948,40.71361160),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Childrens Home School",'Peoria=' + Peoria.length); Chillicothe[Chillicothe.length] = createMarker(new GPoint(-89.49591064,40.92216110),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Chillicothe Elementary Center",'Chillicothe=' + Chillicothe.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.59995270,40.71916962),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Columbia Middle School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.63840000,40.67309200),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Day Treatment",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.58381653,40.72675705),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Diagnostic Learning Center",'Peoria=' + Peoria.length); Dunlap[Dunlap.length] = createMarker(new GPoint(-89.65270233,40.84059906),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Dunlap Grade School",'Dunlap=' + Dunlap.length); Dunlap[Dunlap.length] = createMarker(new GPoint(-89.65270233,40.84059906),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Dunlap High School",'Dunlap=' + Dunlap.length); Dunlap[Dunlap.length] = createMarker(new GPoint(-89.67159271,40.85447311),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Dunlap Middle School",'Dunlap=' + Dunlap.length); Elmwood[Elmwood.length] = createMarker(new GPoint(-89.97074890,40.78216553),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Elmwood Elementary School",'Elmwood=' + Elmwood.length); Elmwood[Elmwood.length] = createMarker(new GPoint(-89.96899414,40.78073883),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Elmwood High School",'Elmwood=' + Elmwood.length); Elmwood[Elmwood.length] = createMarker(new GPoint(-89.96899414,40.78073883),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Elmwood Junior High School",'Elmwood=' + Elmwood.length); Farmington[Farmington.length] = createMarker(new GPoint(-89.98646500,40.69987300),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Farmington Central Elementary School",'Farmington=' + Farmington.length); Farmington[Farmington.length] = createMarker(new GPoint(-89.98647100,40.69978000),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Farmington Central Jr High School",'Farmington=' + Farmington.length); Farmington[Farmington.length] = createMarker(new GPoint(-89.99686432,40.69686127),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Farmington High School",'Farmington=' + Farmington.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.60540771,40.70338440),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Franklin-edison Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.62698364,40.67200851),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Garfield Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.58381653,40.72675705),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Glen Oak Christian C/o Dlc Elementary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.58399200,40.71261978),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Glen Oak Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.59053040,40.69282913),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Greeley Alternative School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.64071655,40.69944382),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Guardian Angel Home School",'Peoria=' + Peoria.length); Hanna_City[Hanna_City.length] = createMarker(new GPoint(-89.79570007,40.68610001),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Hanna City Grade School",'Hanna_City=' + Hanna_City.length); Hanna_City[Hanna_City.length] = createMarker(new GPoint(-89.82527161,40.69743729),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Hanna City Work Camp",'Hanna_City=' + Hanna_City.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.63665771,40.66676331),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Harrison Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.59349060,40.74332809),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Hines Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.68296051,40.60918045),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Hollis Consolidated Grade School",'Peoria=' + Peoria.length); Chillicothe[Chillicothe.length] = createMarker(new GPoint(-89.50170135,40.91486359),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Il Valley Central High School",'Chillicothe=' + Chillicothe.length); Glasford[Glasford.length] = createMarker(new GPoint(-89.80437469,40.57363510),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Illini Bluffs Elementary School",'Glasford=' + Glasford.length); Glasford[Glasford.length] = createMarker(new GPoint(-89.81210327,40.57649994),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Illini Bluffs High School",'Glasford=' + Glasford.length); Glasford[Glasford.length] = createMarker(new GPoint(-89.80881500,40.57310104),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Illini Bluffs Middle School",'Glasford=' + Glasford.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.58908844,40.70040131),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Irving Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.59812927,40.76465988),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Kellar Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.56069183,40.71736908),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Kingman Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.58381653,40.72675705),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Lakeview Ywca C/o Dlc Elementary School",'Peoria=' + Peoria.length); Bartonville[Bartonville.length] = createMarker(new GPoint(-89.68058014,40.64014053),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Limestone Community High School",'Bartonville=' + Bartonville.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.72391510,40.65653610),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Limestone Walters Elementary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.57566833,40.70729446),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Lincoln Middle School",'Peoria=' + Peoria.length); Hanna_City[Hanna_City.length] = createMarker(new GPoint(-89.83301544,40.68634415),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Logan Elementary School",'Hanna_City=' + Hanna_City.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.61315155,40.71806717),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Loucks-edison Junior Academy",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.63288116,40.68029404),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Manual High School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.63078700,40.78386200),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Mark W Bills Middle School",'Peoria=' + Peoria.length); Bartonville[Bartonville.length] = createMarker(new GPoint(-89.67481232,40.66006851),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Monroe Elementary School",'Bartonville=' + Bartonville.length); Mossville[Mossville.length] = createMarker(new GPoint(-89.56870270,40.81679916),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Mossville Elementary School",'Mossville=' + Mossville.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.62111664,40.76183701),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Northmoor-edison Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.70090485,40.69923782),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Norwood Elementary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.58857727,40.69109726),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Norwood Primary School",'Peoria=' + Peoria.length); Bartonville[Bartonville.length] = createMarker(new GPoint(-89.67015839,40.63776398),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak Grove East Elementary School",'Bartonville=' + Bartonville.length); Bartonville[Bartonville.length] = createMarker(new GPoint(-89.68789673,40.63766098),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Oak Grove West School",'Bartonville=' + Bartonville.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.59247589,40.69680786),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Peoria Alternative School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.67787933,40.68682861),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Peoria Cty Juvenile Detention Center",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.62398529,40.75679016),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Peoria Developmental Center",'Peoria=' + Peoria.length); Peoria_Heights[Peoria_Heights.length] = createMarker(new GPoint(-89.58661652,40.74636459),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Peoria Heights Grade School",'Peoria_Heights=' + Peoria_Heights.length); Peoria_Heights[Peoria_Heights.length] = createMarker(new GPoint(-89.58654785,40.74636459),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Peoria Heights High School",'Peoria_Heights=' + Peoria_Heights.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.59898376,40.70692825),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Peoria High School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.62452698,40.78326416),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Perfect",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.65204620,40.67533875),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Hill Elementary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.66600037,40.70043564),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Valley Elementary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.64331055,40.72891235),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Valley Middle School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.66445160,40.70314407),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Pleasant Valley North Elementary School",'Peoria=' + Peoria.length); Princeville[Princeville.length] = createMarker(new GPoint(-89.75471497,40.93514633),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Princeville Elementary School",'Princeville=' + Princeville.length); Princeville[Princeville.length] = createMarker(new GPoint(-89.75341797,40.93195343),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Princeville High School",'Princeville=' + Princeville.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.61238098,40.76175308),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Richwoods High School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.65483856,40.78450012),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Ridgeview Elementary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.63565826,40.72923660),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Robert A Jamieson School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.62368011,40.75584412),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Rolling Acres Edison Junior Academy",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.62054443,40.68856430),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Roosevelt Magnet School",'Peoria=' + Peoria.length); Chillicothe[Chillicothe.length] = createMarker(new GPoint(-89.49347687,40.91334534),"",iconRd); mySelect.options[mySelect.options.length] = new Option("South Elementary School",'Chillicothe=' + Chillicothe.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.63237762,40.71426010),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Sterling Middle School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.60673523,40.73036194),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Thomas Jefferson Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.63858032,40.67304230),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Trewyn Middle School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.62648773,40.67946243),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Tyng Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.60128021,40.69326401),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Valeska Hinton Early Ch Ed Center",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.58380890,40.72493744),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Von Steuben Middle School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.56961823,40.73155212),"",iconBl); mySelect.options[mySelect.options.length] = new Option("Washington Gifted School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.59127808,40.70606232),"",iconBl); mySelect.options[mySelect.options.length] = new Option("White Middle School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.61848450,40.69556427),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Whittier Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.63558197,40.81068420),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Wilder-waite Elementary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.62252808,40.72543716),"",iconRd); mySelect.options[mySelect.options.length] = new Option("Woodrow Wilson Primary School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.57284546,40.70877075),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Woodruff High School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.69763947,40.68883133),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Youth Farm School",'Peoria=' + Peoria.length); Peoria[Peoria.length] = createMarker(new GPoint(-89.61239624,40.75279617),"",iconGr); mySelect.options[mySelect.options.length] = new Option("Zeller Mental Health Center",'Peoria=' + Peoria.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(Bartonville); map.removeOverlays(Brimfield); map.removeOverlays(Chillicothe); map.removeOverlays(Dunlap); map.removeOverlays(Elmwood); map.removeOverlays(Farmington); map.removeOverlays(Glasford); map.removeOverlays(Hanna_City); map.removeOverlays(Mossville); map.removeOverlays(Peoria); map.removeOverlays(Peoria_Heights); map.removeOverlays(Princeville); 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(Dunlap);map.removeOverlays(Bartonville); map.removeOverlays(Brimfield); map.removeOverlays(Chillicothe); map.removeOverlays(Dunlap); map.removeOverlays(Elmwood); map.removeOverlays(Farmington); map.removeOverlays(Glasford); map.removeOverlays(Hanna_City); map.removeOverlays(Mossville); map.removeOverlays(Peoria); map.removeOverlays(Peoria_Heights); map.removeOverlays(Princeville); map.addOverlays(Bartonville); centerByArray(Bartonville, false, false); cntMarker += Bartonville.length; map.addOverlays(Brimfield); centerByArray(Brimfield, false, false); cntMarker += Brimfield.length; map.addOverlays(Chillicothe); centerByArray(Chillicothe, false, false); cntMarker += Chillicothe.length; map.addOverlays(Dunlap); centerByArray(Dunlap, false, false); cntMarker += Dunlap.length; map.addOverlays(Elmwood); centerByArray(Elmwood, false, false); cntMarker += Elmwood.length; map.addOverlays(Farmington); centerByArray(Farmington, false, false); cntMarker += Farmington.length; map.addOverlays(Glasford); centerByArray(Glasford, false, false); cntMarker += Glasford.length; map.addOverlays(Hanna_City); centerByArray(Hanna_City, false, false); cntMarker += Hanna_City.length; map.addOverlays(Mossville); centerByArray(Mossville, false, false); cntMarker += Mossville.length; map.addOverlays(Peoria); centerByArray(Peoria, false, false); cntMarker += Peoria.length; map.addOverlays(Peoria_Heights); centerByArray(Peoria_Heights, false, false); cntMarker += Peoria_Heights.length; map.addOverlays(Princeville); centerByArray(Princeville, false, false); cntMarker += Princeville.length; centerByArray(Dunlap,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'); } }