function addMarkers(){ mySelect = document.getElementById('selection'); Grafton = [];N_Ridgeville = [];Elyria = [];Avon = [];North_Ridgeville = [];Avon_Lake = [];Lorain = [];Oberlin = [];Sheffield_Lake = [];Amherst = [];mySelect.options[mySelect.options.length] = new Option("Amherst schools",'all=Amherst'); mySelect.options[mySelect.options.length] = new Option("Avon schools",'all=Avon'); mySelect.options[mySelect.options.length] = new Option("Avon Lake schools",'all=Avon_Lake'); mySelect.options[mySelect.options.length] = new Option("Elyria schools",'all=Elyria'); mySelect.options[mySelect.options.length] = new Option("Grafton schools",'all=Grafton'); mySelect.options[mySelect.options.length] = new Option("Lorain schools",'all=Lorain'); mySelect.options[mySelect.options.length] = new Option("N Ridgeville schools",'all=N_Ridgeville'); mySelect.options[mySelect.options.length] = new Option("North Ridgeville schools",'all=North_Ridgeville'); mySelect.options[mySelect.options.length] = new Option("Oberlin schools",'all=Oberlin'); mySelect.options[mySelect.options.length] = new Option("Sheffield Lake schools",'all=Sheffield_Lake'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Grafton[Grafton.length] = createMarker(new GPoint(-82.01525100,41.31433800),"
Christian Community School
35716 Royalton Road
Grafton, OH 44044
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Community School",'Grafton=' + Grafton.length); N_Ridgeville[N_Ridgeville.length] = createMarker(new GPoint(-81.99710700,41.36769100),"
Christian Community School
8540 Root Rd.
N Ridgeville, OH 44039
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christian Community School",'N_Ridgeville=' + N_Ridgeville.length); Elyria[Elyria.length] = createMarker(new GPoint(-82.11778200,41.32156200),"
First Baptist Christian School
11400 Lagrange Road
Elyria, OH 44035
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Baptist Christian School",'Elyria=' + Elyria.length); Elyria[Elyria.length] = createMarker(new GPoint(-82.10658200,41.37076600),"
Golden Crescent Montessori
266 Washington Ave
Elyria, OH 44035
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Golden Crescent Montessori",'Elyria=' + Elyria.length); Avon[Avon.length] = createMarker(new GPoint(-81.98934200,41.45162600),"
Holy Trinity School
2610 Nagel Road
Avon, OH 44011
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Trinity School",'Avon=' + Avon.length); North_Ridgeville[North_Ridgeville.length] = createMarker(new GPoint(-82.03933200,41.38463200),"
Lake Ridge Academy
37501 Center Ridge Road
North Ridgeville, OH 44039
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lake Ridge Academy",'North_Ridgeville=' + North_Ridgeville.length); Avon_Lake[Avon_Lake.length] = createMarker(new GPoint(-82.01871600,41.49432800),"
Le Chaperon Rouge-avon Lake
445 Avon Belden Road
Avon Lake, OH 44012
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Le Chaperon Rouge-avon Lake",'Avon_Lake=' + Avon_Lake.length); Lorain[Lorain.length] = createMarker(new GPoint(-82.20225900,41.43261600),"
North Coast Christian Academy
4125 Leavitt Road
Lorain, OH 44053
Co-ed school, K-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("North Coast Christian Academy",'Lorain=' + Lorain.length); Oberlin[Oberlin.length] = createMarker(new GPoint(-82.21241100,41.28903300),"
Oberlin Sda Elem. School
99 South Park Street
Oberlin, OH 44074
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Oberlin Sda Elem. School",'Oberlin=' + Oberlin.length); Elyria[Elyria.length] = createMarker(new GPoint(-82.16143100,41.37257500),"
Open Door Christian Schools
8287 West Ridge Road
Elyria, OH 44035
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Open Door Christian Schools",'Elyria=' + Elyria.length); Elyria[Elyria.length] = createMarker(new GPoint(-82.10905800,41.40268700),"
Regent Academy
2206 W River Rd N
Elyria, OH 44035
Co-ed school, KG-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Regent Academy",'Elyria=' + Elyria.length); Lorain[Lorain.length] = createMarker(new GPoint(-82.16016200,41.47515800),"
St. Anthony Of Padua School
1339 East Erie Avenue
Lorain, OH 44052
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Anthony Of Padua School",'Lorain=' + Lorain.length); Elyria[Elyria.length] = createMarker(new GPoint(-82.08614400,41.38153700),"
St. Jude School
594 Poplar Street
Elyria, OH 44035
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Jude School",'Elyria=' + Elyria.length); Elyria[Elyria.length] = createMarker(new GPoint(-82.10522300,41.36433700),"
St. Mary Elementary School
237 4th Street
Elyria, OH 44035
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary Elementary School",'Elyria=' + Elyria.length); Lorain[Lorain.length] = createMarker(new GPoint(-82.20814800,41.43416300),"
St. Nicholas Pre-school
2707 W 40th Street
Lorain, OH 44053
Co-ed school, PK-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Nicholas Pre-school",'Lorain=' + Lorain.length); North_Ridgeville[North_Ridgeville.length] = createMarker(new GPoint(-82.01573000,41.39077200),"
St. Peter School
35749 Center Ridge Road
North Ridgeville, OH 44039
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Peter School",'North_Ridgeville=' + North_Ridgeville.length); Sheffield_Lake[Sheffield_Lake.length] = createMarker(new GPoint(-82.09433900,41.48697400),"
St. Thomas The Apostle
719 Harris Road
Sheffield Lake, OH 44054
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Thomas The Apostle",'Sheffield_Lake=' + Sheffield_Lake.length); North_Ridgeville[North_Ridgeville.length] = createMarker(new GPoint(-82.00057300,41.39604000),"
Shepherd Of The Ridge Lutheran School
34555 Center Ridge Road
North Ridgeville, OH 44039
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Shepherd Of The Ridge Lutheran School",'North_Ridgeville=' + North_Ridgeville.length); Avon_Lake[Avon_Lake.length] = createMarker(new GPoint(-82.02576100,41.51117100),"
St Joseph Elementary School
32929 Lake Road
Avon Lake, OH 44012
Co-ed school, 1-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Joseph Elementary School",'Avon_Lake=' + Avon_Lake.length); Amherst[Amherst.length] = createMarker(new GPoint(-82.21914000,41.40510300),"
St Joseph Elementary School
175 Saint Joseph Drive
Amherst, OH 44001
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Joseph Elementary School",'Amherst=' + Amherst.length); Avon[Avon.length] = createMarker(new GPoint(-82.03349300,41.44916800),"
St Mary Immaculate Conception School
2680 Stoney Ridge Road
Avon, OH 44011
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mary Immaculate Conception School",'Avon=' + Avon.length); Lorain[Lorain.length] = createMarker(new GPoint(-82.18521600,41.43789000),"
St Peter Elementary School
3601 Oberlin Avenue
Lorain, OH 44053
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Peter Elementary School",'Lorain=' + Lorain.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(Amherst); map.removeOverlays(Avon); map.removeOverlays(Avon_Lake); map.removeOverlays(Elyria); map.removeOverlays(Grafton); map.removeOverlays(Lorain); map.removeOverlays(N_Ridgeville); map.removeOverlays(North_Ridgeville); map.removeOverlays(Oberlin); map.removeOverlays(Sheffield_Lake); 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(Grafton);map.removeOverlays(Amherst); map.removeOverlays(Avon); map.removeOverlays(Avon_Lake); map.removeOverlays(Elyria); map.removeOverlays(Grafton); map.removeOverlays(Lorain); map.removeOverlays(N_Ridgeville); map.removeOverlays(North_Ridgeville); map.removeOverlays(Oberlin); map.removeOverlays(Sheffield_Lake); map.addOverlays(Amherst); centerByArray(Amherst, false, false); cntMarker += Amherst.length; map.addOverlays(Avon); centerByArray(Avon, false, false); cntMarker += Avon.length; map.addOverlays(Avon_Lake); centerByArray(Avon_Lake, false, false); cntMarker += Avon_Lake.length; map.addOverlays(Elyria); centerByArray(Elyria, false, false); cntMarker += Elyria.length; map.addOverlays(Grafton); centerByArray(Grafton, false, false); cntMarker += Grafton.length; map.addOverlays(Lorain); centerByArray(Lorain, false, false); cntMarker += Lorain.length; map.addOverlays(N_Ridgeville); centerByArray(N_Ridgeville, false, false); cntMarker += N_Ridgeville.length; map.addOverlays(North_Ridgeville); centerByArray(North_Ridgeville, false, false); cntMarker += North_Ridgeville.length; map.addOverlays(Oberlin); centerByArray(Oberlin, false, false); cntMarker += Oberlin.length; map.addOverlays(Sheffield_Lake); centerByArray(Sheffield_Lake, false, false); cntMarker += Sheffield_Lake.length; centerByArray(Grafton,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; }