function addMarkers(){ mySelect = document.getElementById('selection'); Durham = [];mySelect.options[mySelect.options.length] = new Option("Durham schools",'all=Durham'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Durham[Durham.length] = createMarker(new GPoint(-78.87657400,35.99426300),"
Agape Corner Boarding School
1402 Holloway Street
Durham, NC 27701
Co-ed school, KG-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Agape Corner Boarding School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.83494900,35.96804000),"
Agape Corner School
Po Box 16027 1402 Holloway Street
Durham, NC 27703
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Agape Corner School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.88972500,36.02174000),"
The B E School
2502 N Roxboro Street
Durham, NC 27704
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The B E School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.83839600,35.94371400),"
Bethesda Christian Academy
1914 S Miami Blvd
Durham, NC 27703
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethesda Christian Academy",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.83839600,35.94371400),"
Bethesda Christian Academy
1914 South Miami Blvd
Durham, NC 27703
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bethesda Christian Academy",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.96070600,35.92468300),"
Bryson Christian Montessori School
6701 Garrett Road
Durham, NC 27707
Co-ed school, K-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bryson Christian Montessori School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.91213000,35.99026400),"
Camelot Academy
809 Proctor St
Durham, NC 27707
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Camelot Academy",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.97620500,35.97252200),"
Cresset Christian Academy
3707 Garrett Road
Durham, NC 27707
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cresset Christian Academy",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.92221500,36.00244800),"
Duke School
1516 Hull Avenue
Durham, NC 27705
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Duke School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.96984400,35.97846000),"
Durham Academy
3501 Ridge Road
Durham, NC 27705
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Durham Academy",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.90910000,35.96203800),"
Faith Assembly Christian Academy
3120 Fayetteville Street
Durham, NC 27707
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Assembly Christian Academy",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.86086600,35.99861800),"
Fellowship Baptist Academy
515 Southerland Street
Durham, NC 27703
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Fellowship Baptist Academy",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.98384300,35.94275800),"
Five Oaks Seventh-day Adventist Christian School
4124 Farrington Road
Durham, NC 27707
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Five Oaks Seventh-day Adventist Christian School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.81514500,36.04293700),"
Gorman Christian Academy & Ear
3311 E Geer St
Durham, NC 27704
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Gorman Christian Academy & Ear",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.97030200,35.97566700),"
The Hill Center
3200 Pickett Road
Durham, NC 27705
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Hill Center",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.91348400,35.99801100),"
Immaculata Catholic School
721 Burch Avenue
Durham, NC 27701
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Immaculata Catholic School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.95281600,35.98110500),"
Lerner Jewish Community Day
1935 W. Cornwallis Road
Durham, NC 27705
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Lerner Jewish Community Day",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.92226400,35.97589200),"
Montessori Children's House of Durham
2400 University Dr
Durham, NC 27707
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Children's House of Durham",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.99847100,35.93366900),"
Montessori Community School
4512 Pope Road
Durham, NC 27707
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Montessori Community School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.90837700,35.95691300),"
Mount Zion Christian Academy
3519 Fayetteville Street
Durham, NC 27707
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mount Zion Christian Academy",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.90194800,35.96355000),"
Quality Education Institute
800 Elmira Avenue
Durham, NC 27707
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Quality Education Institute",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.93616400,36.02607100),"
St Luke's Preschool And Kindergarten
1737 Hillandale Road
Durham, NC 27705
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Luke's Preschool And Kindergarten",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.91518600,35.95281000),"
St Sya Academy
3102 Cedarwood Drive
Durham, NC 27707
Co-ed school, PK-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Sya Academy",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.92946800,36.02743700),"
Tabernacle Of Life Christian School
2400 Sovereign Street
Durham, NC 27705
Co-ed school, 5-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tabernacle Of Life Christian School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.97326800,36.02872800),"
Triangle Day School
4911 Neal Road
Durham, NC 27705
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Triangle Day School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.99147700,35.97587200),"
Trinity School of Durham & Chapel Hill
4011 Pickett Road
Durham, NC 27705
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity School of Durham & Chapel Hill",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.84262700,35.98641400),"
Tutorial -1/2 Christian School
3026 Wake Forest Hw.
Durham, NC 27703
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Tutorial -1/2 Christian School",'Durham=' + Durham.length); Durham[Durham.length] = createMarker(new GPoint(-78.87455700,35.99142200),"
Ufc Day School
1606 Liberty Street
Durham, NC 27703
Co-ed school, K-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ufc Day School",'Durham=' + Durham.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(Durham); 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(Durham);map.removeOverlays(Durham); map.addOverlays(Durham); centerByArray(Durham, false, false); cntMarker += Durham.length; centerByArray(Durham,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; }