function addMarkers(){ mySelect = document.getElementById('selection'); Allendale = [];Hudsonville = [];Zeeland = [];Holland = [];Grand_Haven = [];Jenison = [];Coopersville = [];Spring_Lake = [];Conklin = [];mySelect.options[mySelect.options.length] = new Option("Allendale schools",'all=Allendale'); mySelect.options[mySelect.options.length] = new Option("Conklin schools",'all=Conklin'); mySelect.options[mySelect.options.length] = new Option("Coopersville schools",'all=Coopersville'); mySelect.options[mySelect.options.length] = new Option("Grand Haven schools",'all=Grand_Haven'); mySelect.options[mySelect.options.length] = new Option("Holland schools",'all=Holland'); mySelect.options[mySelect.options.length] = new Option("Hudsonville schools",'all=Hudsonville'); mySelect.options[mySelect.options.length] = new Option("Jenison schools",'all=Jenison'); mySelect.options[mySelect.options.length] = new Option("Spring Lake schools",'all=Spring_Lake'); mySelect.options[mySelect.options.length] = new Option("Zeeland schools",'all=Zeeland'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Allendale[Allendale.length] = createMarker(new GPoint(-85.94331400,42.97211800),"
Allendale Christian School
6370 Lake Michigan Drive
Allendale, MI 49401
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Allendale Christian School",'Allendale=' + Allendale.length); Hudsonville[Hudsonville.length] = createMarker(new GPoint(-85.94030300,42.86072600),"
Beaverdam Christian School
5181 64th Avenue
Hudsonville, MI 49426
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Beaverdam Christian School",'Hudsonville=' + Hudsonville.length); Zeeland[Zeeland.length] = createMarker(new GPoint(-86.02112600,42.89315000),"
Borculo Christian School
6830 96th Avenue -
Zeeland, MI 49464
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Borculo Christian School",'Zeeland=' + Zeeland.length); Holland[Holland.length] = createMarker(new GPoint(-86.13410600,42.77778100),"
Calvary Schools of Holland
518 Plasman Ave
Holland, MI 49423
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Schools of Holland",'Holland=' + Holland.length); Holland[Holland.length] = createMarker(new GPoint(-86.08153400,42.84119400),"
Corpus Christi Catholic School
12100 Quincy Street
Holland, MI 49424
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Corpus Christi Catholic School",'Holland=' + Holland.length); Holland[Holland.length] = createMarker(new GPoint(-86.05274800,42.80134000),"
Daystar Christian Academy
11025 Paw Paw Drive
Holland, MI 49424
Co-ed school, 8-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Daystar Christian Academy",'Holland=' + Holland.length); Grand_Haven[Grand_Haven.length] = createMarker(new GPoint(-86.20525200,43.04558700),"
Discovery Montessori
1720 S Beechtree Street
Grand Haven, MI 49417
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Discovery Montessori",'Grand_Haven=' + Grand_Haven.length); Hudsonville[Hudsonville.length] = createMarker(new GPoint(-85.85046100,42.88344600),"
Freedom Baptist Schools
6340 Autumn Drive
Hudsonville, MI 49426
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Freedom Baptist Schools",'Hudsonville=' + Hudsonville.length); Grand_Haven[Grand_Haven.length] = createMarker(new GPoint(-86.21546000,43.05717200),"
Grand Haven Christian School
1102 Grant Avenue
Grand Haven, MI 49417
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grand Haven Christian School",'Grand_Haven=' + Grand_Haven.length); Hudsonville[Hudsonville.length] = createMarker(new GPoint(-85.88064400,42.85778600),"
Heritage Christian School
4900 40th Avenue
Hudsonville, MI 49426
Co-ed school, K-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Heritage Christian School",'Hudsonville=' + Hudsonville.length); Holland[Holland.length] = createMarker(new GPoint(-86.06296600,42.76893700),"
Holland SDA School
11385 Ottagon
Holland, MI 49423
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holland SDA School",'Holland=' + Holland.length); Hudsonville[Hudsonville.length] = createMarker(new GPoint(-85.86725000,42.87215400),"
Hudsonville Christian School
3435 Oak Street
Hudsonville, MI 49426
Co-ed school, NS-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Hudsonville Christian School",'Hudsonville=' + Hudsonville.length); Jenison[Jenison.length] = createMarker(new GPoint(-85.83504900,42.90831300),"
Jenison Christian School
7726 Graceland Drive
Jenison, MI 49428
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Jenison Christian School",'Jenison=' + Jenison.length); Holland[Holland.length] = createMarker(new GPoint(-86.19839000,42.83654700),"
Kinder Cubs Lakeshore
3765 N 168th St
Holland, MI 49424
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kinder Cubs Lakeshore",'Holland=' + Holland.length); Grand_Haven[Grand_Haven.length] = createMarker(new GPoint(-86.21977800,43.01701500),"
Lakeshore Baptist Academy
13664 Lakeshore Drive
Grand Haven, MI 49417
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lakeshore Baptist Academy",'Grand_Haven=' + Grand_Haven.length); Holland[Holland.length] = createMarker(new GPoint(-86.08743900,42.79053700),"
Lakeside Montessori
455 E 8th Street Suite 300
Holland, MI 49423
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lakeside Montessori",'Holland=' + Holland.length); Coopersville[Coopersville.length] = createMarker(new GPoint(-85.91247100,43.00978100),"
Lamont Christian School
5260 Leonard Street
Coopersville, MI 49404
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lamont Christian School",'Coopersville=' + Coopersville.length); Zeeland[Zeeland.length] = createMarker(new GPoint(-86.01870300,42.79246400),"
Learning Tree Montessori
1305 96th Avenue
Zeeland, MI 49464
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Learning Tree Montessori",'Zeeland=' + Zeeland.length); Holland[Holland.length] = createMarker(new GPoint(-86.12382000,42.81432400),"
North Shore Christian Middle School
556 Butternut Drive
Holland, MI 49424
Co-ed school, 6-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Shore Christian Middle School",'Holland=' + Holland.length); Holland[Holland.length] = createMarker(new GPoint(-86.12382000,42.81432400),"
Rose Park Christian School
556 Butternut Drive
Holland, MI 49424
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Rose Park Christian School",'Holland=' + Holland.length); Spring_Lake[Spring_Lake.length] = createMarker(new GPoint(-86.18999400,43.07573700),"
St. Mary S School
421 E Exchange Street
Spring Lake, MI 49456
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary S School",'Spring_Lake=' + Spring_Lake.length); Holland[Holland.length] = createMarker(new GPoint(-86.07997700,42.88204700),"
South Olive Christian School
6230 120th Avenue
Holland, MI 49424
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("South Olive Christian School",'Holland=' + Holland.length); Grand_Haven[Grand_Haven.length] = createMarker(new GPoint(-86.22732600,43.05183700),"
St Johns Lutheran School
525 Taylor Avenue
Grand Haven, MI 49417
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Johns Lutheran School",'Grand_Haven=' + Grand_Haven.length); Conklin[Conklin.length] = createMarker(new GPoint(-85.80839200,43.11022000),"
St Joseph Elementary School
18768 8th Avenue
Conklin, MI 49403
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Joseph Elementary School",'Conklin=' + Conklin.length); Coopersville[Coopersville.length] = createMarker(new GPoint(-86.00684900,43.07870300),"
St Michael Elementary School
17150 88th Avenue
Coopersville, MI 49404
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Michael Elementary School",'Coopersville=' + Coopersville.length); Conklin[Conklin.length] = createMarker(new GPoint(-85.82414800,43.13293700),"
Trinity Lutheran School
1401 Harding Street
Conklin, MI 49403
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran School",'Conklin=' + Conklin.length); Zeeland[Zeeland.length] = createMarker(new GPoint(-86.02670500,42.81036300),"
Zeeland Christian School
334 W Central Avenue
Zeeland, MI 49464
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Zeeland Christian School",'Zeeland=' + Zeeland.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,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/////1/' + showArray); map.removeOverlays(Allendale); map.removeOverlays(Conklin); map.removeOverlays(Coopersville); map.removeOverlays(Grand_Haven); map.removeOverlays(Holland); map.removeOverlays(Hudsonville); map.removeOverlays(Jenison); map.removeOverlays(Spring_Lake); map.removeOverlays(Zeeland); 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(Allendale);map.removeOverlays(Allendale); map.removeOverlays(Conklin); map.removeOverlays(Coopersville); map.removeOverlays(Grand_Haven); map.removeOverlays(Holland); map.removeOverlays(Hudsonville); map.removeOverlays(Jenison); map.removeOverlays(Spring_Lake); map.removeOverlays(Zeeland); map.addOverlays(Allendale); centerByArray(Allendale, false, false); cntMarker += Allendale.length; map.addOverlays(Conklin); centerByArray(Conklin, false, false); cntMarker += Conklin.length; map.addOverlays(Coopersville); centerByArray(Coopersville, false, false); cntMarker += Coopersville.length; map.addOverlays(Grand_Haven); centerByArray(Grand_Haven, false, false); cntMarker += Grand_Haven.length; map.addOverlays(Holland); centerByArray(Holland, false, false); cntMarker += Holland.length; map.addOverlays(Hudsonville); centerByArray(Hudsonville, false, false); cntMarker += Hudsonville.length; map.addOverlays(Jenison); centerByArray(Jenison, false, false); cntMarker += Jenison.length; map.addOverlays(Spring_Lake); centerByArray(Spring_Lake, false, false); cntMarker += Spring_Lake.length; map.addOverlays(Zeeland); centerByArray(Zeeland, false, false); cntMarker += Zeeland.length; centerByArray(Allendale,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'); //window.open('/map.php?type=1&schools=&school_level=1&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; }