function addMarkers(){ mySelect = document.getElementById('selection'); Newhall = [];Davenport = [];Clarinda = [];Clemons = [];Readlyn = [];Storm_Lake = [];Dubuque = [];Waterloo = [];Spencer = [];Williamsburg = [];Des_Moines = [];West_Des_Moines = [];Latimer = [];Fort_Dodge = [];Sioux_City = [];Cedar_Rapids = [];Boone = [];Council_Bluffs = [];Cedar_Falls = [];Wilton = [];Denison = [];Paullina = [];mySelect.options[mySelect.options.length] = new Option("Boone schools",'all=Boone'); mySelect.options[mySelect.options.length] = new Option("Cedar Falls schools",'all=Cedar_Falls'); mySelect.options[mySelect.options.length] = new Option("Cedar Rapids schools",'all=Cedar_Rapids'); mySelect.options[mySelect.options.length] = new Option("Clarinda schools",'all=Clarinda'); mySelect.options[mySelect.options.length] = new Option("Clemons schools",'all=Clemons'); mySelect.options[mySelect.options.length] = new Option("Council Bluffs schools",'all=Council_Bluffs'); mySelect.options[mySelect.options.length] = new Option("Davenport schools",'all=Davenport'); mySelect.options[mySelect.options.length] = new Option("Denison schools",'all=Denison'); mySelect.options[mySelect.options.length] = new Option("Des Moines schools",'all=Des_Moines'); mySelect.options[mySelect.options.length] = new Option("Dubuque schools",'all=Dubuque'); mySelect.options[mySelect.options.length] = new Option("Fort Dodge schools",'all=Fort_Dodge'); mySelect.options[mySelect.options.length] = new Option("Latimer schools",'all=Latimer'); mySelect.options[mySelect.options.length] = new Option("Newhall schools",'all=Newhall'); mySelect.options[mySelect.options.length] = new Option("Paullina schools",'all=Paullina'); mySelect.options[mySelect.options.length] = new Option("Readlyn schools",'all=Readlyn'); mySelect.options[mySelect.options.length] = new Option("Sioux City schools",'all=Sioux_City'); mySelect.options[mySelect.options.length] = new Option("Spencer schools",'all=Spencer'); mySelect.options[mySelect.options.length] = new Option("Storm Lake schools",'all=Storm_Lake'); mySelect.options[mySelect.options.length] = new Option("Waterloo schools",'all=Waterloo'); mySelect.options[mySelect.options.length] = new Option("West Des Moines schools",'all=West_Des_Moines'); mySelect.options[mySelect.options.length] = new Option("Williamsburg schools",'all=Williamsburg'); mySelect.options[mySelect.options.length] = new Option("Wilton schools",'all=Wilton'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Newhall[Newhall.length] = createMarker(new GPoint(-91.96890000,41.99450000),"
Central Lutheran School
Po Box 190
Newhall, IA 52315
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Central Lutheran School",'Newhall=' + Newhall.length); Davenport[Davenport.length] = createMarker(new GPoint(-90.60969600,41.58751300),"
Christ Lutheran High School
Po Box 1535
Davenport, IA 52809
Co-ed school, 9-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ Lutheran High School",'Davenport=' + Davenport.length); Clarinda[Clarinda.length] = createMarker(new GPoint(-95.04609300,40.74606300),"
Clarinda Lutheran School
707 W Skidmore Street
Clarinda, IA 51632
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clarinda Lutheran School",'Clarinda=' + Clarinda.length); Clemons[Clemons.length] = createMarker(new GPoint(-93.15638400,42.11372800),"
Clemons Lutheran School
302 Bevin St Box 120
Clemons, IA 50051
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Clemons Lutheran School",'Clemons=' + Clemons.length); Readlyn[Readlyn.length] = createMarker(new GPoint(-92.23881000,42.65946100),"
Community Lutheran School
2681 Quail Avenue
Readlyn, IA 50668
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Community Lutheran School",'Readlyn=' + Readlyn.length); Storm_Lake[Storm_Lake.length] = createMarker(new GPoint(-95.20108600,42.64112100),"
Concordia Lutheran School
402 Lake Avenue
Storm Lake, IA 50588
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Concordia Lutheran School",'Storm_Lake=' + Storm_Lake.length); Dubuque[Dubuque.length] = createMarker(new GPoint(-90.72063500,42.50925700),"
Dubuque Lutheran School
2145 JFK Road
Dubuque, IA 52002
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Dubuque Lutheran School",'Dubuque=' + Dubuque.length); Waterloo[Waterloo.length] = createMarker(new GPoint(-92.33707900,42.50337200),"
Immanuel Lutheran School
207 Franklin Street
Waterloo, IA 50703
school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Immanuel Lutheran School",'Waterloo=' + Waterloo.length); Spencer[Spencer.length] = createMarker(new GPoint(-95.15033400,43.13224800),"
Iowa Great Lakes Lutheran School
500 4th Avenue Sw
Spencer, IA 51301
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Iowa Great Lakes Lutheran School",'Spencer=' + Spencer.length); Williamsburg[Williamsburg.length] = createMarker(new GPoint(-92.03580000,41.64200000),"
Lutheran Interparish School
Po Box 750 804 Court Street
Williamsburg, IA 52361
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lutheran Interparish School",'Williamsburg=' + Williamsburg.length); Des_Moines[Des_Moines.length] = createMarker(new GPoint(-93.69479300,41.61133700),"
Mount Olive Lutheran School
5625 Franklin Avenue
Des Moines, IA 50310
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount Olive Lutheran School",'Des_Moines=' + Des_Moines.length); West_Des_Moines[West_Des_Moines.length] = createMarker(new GPoint(-93.75678100,41.58456300),"
Shepherd's Flock Early Learning Center
3900 Ashworth Road
West Des Moines, IA 50265
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shepherd's Flock Early Learning Center",'West_Des_Moines=' + West_Des_Moines.length); Clarinda[Clarinda.length] = createMarker(new GPoint(-95.03351800,40.74043700),"
St John Lutheran Preschool & Kindergarten
301 N 13th Street
Clarinda, IA 51632
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John Lutheran Preschool & Kindergarten",'Clarinda=' + Clarinda.length); Latimer[Latimer.length] = createMarker(new GPoint(-93.36780000,42.77200000),"
St Paul Lutheran School
Po Box 609 404 W Main St
Latimer, IA 50452
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Paul Lutheran School",'Latimer=' + Latimer.length); Fort_Dodge[Fort_Dodge.length] = createMarker(new GPoint(-94.18220200,42.50186300),"
St Paul Lutheran School
1217 4th Avenue S
Fort Dodge, IA 50501
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Paul Lutheran School",'Fort_Dodge=' + Fort_Dodge.length); Sioux_City[Sioux_City.length] = createMarker(new GPoint(-96.39921300,42.49667100),"
St Pauls Lutheran School
614 Jennings Street
Sioux City, IA 51101
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Pauls Lutheran School",'Sioux_City=' + Sioux_City.length); Davenport[Davenport.length] = createMarker(new GPoint(-90.58911600,41.54564800),"
Trinity Lutheran School
1122 W Central Park Avenue
Davenport, IA 52804
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Davenport=' + Davenport.length); Cedar_Rapids[Cedar_Rapids.length] = createMarker(new GPoint(-91.69013700,41.96976300),"
Trinity Lutheran School
1361 7th Avenue Sw
Cedar Rapids, IA 52404
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Cedar_Rapids=' + Cedar_Rapids.length); Boone[Boone.length] = createMarker(new GPoint(-93.88305300,42.06803700),"
Trinity Lutheran School
712 12th Street
Boone, IA 50036
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Boone=' + Boone.length); Council_Bluffs[Council_Bluffs.length] = createMarker(new GPoint(-95.86758200,41.27543700),"
Trinity Lutheran School
1500 N 16th St
Council Bluffs, IA 51501
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Council_Bluffs=' + Council_Bluffs.length); Cedar_Falls[Cedar_Falls.length] = createMarker(new GPoint(-92.42095600,42.49736600),"
Valley Lutheran High School
4520 Rownd Street
Cedar Falls, IA 50613
Co-ed school, 6-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Valley Lutheran High School",'Cedar_Falls=' + Cedar_Falls.length); Wilton[Wilton.length] = createMarker(new GPoint(-91.00830000,41.59820000),"
Zion Lutheran School
Po Box 429
Wilton, IA 52778
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zion Lutheran School",'Wilton=' + Wilton.length); Denison[Denison.length] = createMarker(new GPoint(-95.35957300,42.01573700),"
Zion Lutheran School
1004 1st Avenue S
Denison, IA 51442
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zion Lutheran School",'Denison=' + Denison.length); Paullina[Paullina.length] = createMarker(new GPoint(-95.68950000,42.97250000),"
Zion-st John Lutheran School
Po Box 249
Paullina, IA 51046
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zion-st John Lutheran School",'Paullina=' + Paullina.length); map.removeOverlays(Boone); map.removeOverlays(Cedar_Falls); map.removeOverlays(Cedar_Rapids); map.removeOverlays(Clarinda); map.removeOverlays(Clemons); map.removeOverlays(Council_Bluffs); map.removeOverlays(Davenport); map.removeOverlays(Denison); map.removeOverlays(Des_Moines); map.removeOverlays(Dubuque); map.removeOverlays(Fort_Dodge); map.removeOverlays(Latimer); map.removeOverlays(Newhall); map.removeOverlays(Paullina); map.removeOverlays(Readlyn); map.removeOverlays(Sioux_City); map.removeOverlays(Spencer); map.removeOverlays(Storm_Lake); map.removeOverlays(Waterloo); map.removeOverlays(West_Des_Moines); map.removeOverlays(Williamsburg); map.removeOverlays(Wilton); setTimeout(function(){map.addOverlays(Boone)},1000); setTimeout(function(){map.addOverlays(Cedar_Falls)},1000); setTimeout(function(){map.addOverlays(Cedar_Rapids)},1000); setTimeout(function(){map.addOverlays(Clarinda)},1000); setTimeout(function(){map.addOverlays(Clemons)},1000); setTimeout(function(){map.addOverlays(Council_Bluffs)},1000); setTimeout(function(){map.addOverlays(Davenport)},1000); setTimeout(function(){map.addOverlays(Denison)},1000); setTimeout(function(){map.addOverlays(Des_Moines)},1000); setTimeout(function(){map.addOverlays(Dubuque)},1000); setTimeout(function(){map.addOverlays(Fort_Dodge)},1000); setTimeout(function(){map.addOverlays(Latimer)},1000); setTimeout(function(){map.addOverlays(Newhall)},1000); setTimeout(function(){map.addOverlays(Paullina)},1000); setTimeout(function(){map.addOverlays(Readlyn)},1000); setTimeout(function(){map.addOverlays(Sioux_City)},1000); setTimeout(function(){map.addOverlays(Spencer)},1000); setTimeout(function(){map.addOverlays(Storm_Lake)},1000); setTimeout(function(){map.addOverlays(Waterloo)},1000); setTimeout(function(){map.addOverlays(West_Des_Moines)},1000); setTimeout(function(){map.addOverlays(Williamsburg)},1000); setTimeout(function(){map.addOverlays(Wilton)},1000); maxLng = -90.58911600; maxLat = 43.13224800; minLng = -96.39921300; minLat = 40.74043700; 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(Boone); map.removeOverlays(Cedar_Falls); map.removeOverlays(Cedar_Rapids); map.removeOverlays(Clarinda); map.removeOverlays(Clemons); map.removeOverlays(Council_Bluffs); map.removeOverlays(Davenport); map.removeOverlays(Denison); map.removeOverlays(Des_Moines); map.removeOverlays(Dubuque); map.removeOverlays(Fort_Dodge); map.removeOverlays(Latimer); map.removeOverlays(Newhall); map.removeOverlays(Paullina); map.removeOverlays(Readlyn); map.removeOverlays(Sioux_City); map.removeOverlays(Spencer); map.removeOverlays(Storm_Lake); map.removeOverlays(Waterloo); map.removeOverlays(West_Des_Moines); map.removeOverlays(Williamsburg); map.removeOverlays(Wilton); 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(Newhall);map.removeOverlays(Boone); map.removeOverlays(Cedar_Falls); map.removeOverlays(Cedar_Rapids); map.removeOverlays(Clarinda); map.removeOverlays(Clemons); map.removeOverlays(Council_Bluffs); map.removeOverlays(Davenport); map.removeOverlays(Denison); map.removeOverlays(Des_Moines); map.removeOverlays(Dubuque); map.removeOverlays(Fort_Dodge); map.removeOverlays(Latimer); map.removeOverlays(Newhall); map.removeOverlays(Paullina); map.removeOverlays(Readlyn); map.removeOverlays(Sioux_City); map.removeOverlays(Spencer); map.removeOverlays(Storm_Lake); map.removeOverlays(Waterloo); map.removeOverlays(West_Des_Moines); map.removeOverlays(Williamsburg); map.removeOverlays(Wilton); map.addOverlays(Boone); centerByArray(Boone, false, false); cntMarker += Boone.length; map.addOverlays(Cedar_Falls); centerByArray(Cedar_Falls, false, false); cntMarker += Cedar_Falls.length; map.addOverlays(Cedar_Rapids); centerByArray(Cedar_Rapids, false, false); cntMarker += Cedar_Rapids.length; map.addOverlays(Clarinda); centerByArray(Clarinda, false, false); cntMarker += Clarinda.length; map.addOverlays(Clemons); centerByArray(Clemons, false, false); cntMarker += Clemons.length; map.addOverlays(Council_Bluffs); centerByArray(Council_Bluffs, false, false); cntMarker += Council_Bluffs.length; map.addOverlays(Davenport); centerByArray(Davenport, false, false); cntMarker += Davenport.length; map.addOverlays(Denison); centerByArray(Denison, false, false); cntMarker += Denison.length; map.addOverlays(Des_Moines); centerByArray(Des_Moines, false, false); cntMarker += Des_Moines.length; map.addOverlays(Dubuque); centerByArray(Dubuque, false, false); cntMarker += Dubuque.length; map.addOverlays(Fort_Dodge); centerByArray(Fort_Dodge, false, false); cntMarker += Fort_Dodge.length; map.addOverlays(Latimer); centerByArray(Latimer, false, false); cntMarker += Latimer.length; map.addOverlays(Newhall); centerByArray(Newhall, false, false); cntMarker += Newhall.length; map.addOverlays(Paullina); centerByArray(Paullina, false, false); cntMarker += Paullina.length; map.addOverlays(Readlyn); centerByArray(Readlyn, false, false); cntMarker += Readlyn.length; map.addOverlays(Sioux_City); centerByArray(Sioux_City, false, false); cntMarker += Sioux_City.length; map.addOverlays(Spencer); centerByArray(Spencer, false, false); cntMarker += Spencer.length; map.addOverlays(Storm_Lake); centerByArray(Storm_Lake, false, false); cntMarker += Storm_Lake.length; map.addOverlays(Waterloo); centerByArray(Waterloo, false, false); cntMarker += Waterloo.length; map.addOverlays(West_Des_Moines); centerByArray(West_Des_Moines, false, false); cntMarker += West_Des_Moines.length; map.addOverlays(Williamsburg); centerByArray(Williamsburg, false, false); cntMarker += Williamsburg.length; map.addOverlays(Wilton); centerByArray(Wilton, false, false); cntMarker += Wilton.length; centerByArray(Newhall,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///32430,10622,10838,10839,10626,10784,10627,10837,10840,10851,10709,34345,10817,10816,10621,10853,10630,10821,10681,10631,10676,10763,10694,10852,/all'); //window.open('/map.php?type=2&schools=32430,10622,10838,10839,10626,10784,10627,10837,10840,10851,10709,34345,10817,10816,10621,10853,10630,10821,10681,10631,10676,10763,10694,10852,&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; }