function addMarkers(){ mySelect = document.getElementById('selection'); Wilmington = [];mySelect.options[mySelect.options.length] = new Option("Wilmington schools",'all=Wilmington'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.89168000,34.21272200),"
A Little Class School
4214 Peachtree Ave
Wilmington, NC 28403
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("A Little Class School",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.92010200,34.24470000),"
Calvary Christian Schools
423 N 23rd Street
Wilmington, NC 28405
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Christian Schools",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.89144400,34.17251800),"
Cape Fear Academy
3900 S College Road
Wilmington, NC 28412
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Cape Fear Academy",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.88047400,34.22597900),"
The Children's Schoolhouse Of Wilmington
612 S College Road
Wilmington, NC 28403
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Children's Schoolhouse Of Wilmington",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.84560200,34.20401700),"
Friends School Of Wilmington
350 Peiffer Avenue
Wilmington, NC 28409
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Friends School Of Wilmington",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.86868500,34.26798200),"
Kings Memorial Christian Academy
1380 N College Road
Wilmington, NC 28405
Co-ed school, PK-2
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Kings Memorial Christian Academy",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.88655700,34.13666900),"
Myrtle Grove Christian School
806 Piner Road
Wilmington, NC 28409
Co-ed school, PK-9
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Myrtle Grove Christian School",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.88905700,34.25566900),"
New Covenant Christian School
1134 N. Kerr Ave
Wilmington, NC 28405
Co-ed school, KG-10
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Covenant Christian School",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.89098600,34.17419700),"
New Horizons Elementary School
3705 S College Road
Wilmington, NC 28412
Co-ed school, K-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("New Horizons Elementary School",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.86275500,34.18154100),"
Noah's Ark Children's Center
1501 Beasley Rd
Wilmington, NC 28409
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Noah's Ark Children's Center",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.88160000,34.22180000),"
Park Avenue School
1306 Floyal Parkway
Wilmington, NC 28403
Co-ed school, PK-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Park Avenue School",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.90212200,34.19659500),"
Pine Valley Umc Wee Care Preschool & Kindergarten
3788 Shipyard Blvd
Wilmington, NC 28403
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Pine Valley Umc Wee Care Preschool & Kindergarten",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.94420200,34.23289100),"
St. Mary Catholic School
217 South 4th St.
Wilmington, NC 28401
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Mary Catholic School",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.86725600,34.29012200),"
Sonshine Academy
5811 Fallen Tree Road
Wilmington, NC 28405
Co-ed school, 4-11
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Sonshine Academy",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.84895700,34.23778800),"
St Mark Catholic School
1013 Eastwood Road
Wilmington, NC 28403
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Mark Catholic School",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.88636000,34.21212900),"
Wesley Memorial Child Education Center
1401 S College Road
Wilmington, NC 28403
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wesley Memorial Child Education Center",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.86914900,34.26844900),"
Wilmington Christian Academy
1401 N College Road
Wilmington, NC 28405
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wilmington Christian Academy",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.79764600,34.26065800),"
Wilmington Country Day School
3114 Middle Sound Loop Rd.
Wilmington, NC 28411
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wilmington Country Day School",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.82842500,34.23588000),"
Wilmington Montessori School
1121 Military Cutoff Road C
Wilmington, NC 28405
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wilmington Montessori School",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.91027500,34.23946600),"
Wilmington Sda School
2833 Market Street
Wilmington, NC 28403
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Wilmington Sda School",'Wilmington=' + Wilmington.length); Wilmington[Wilmington.length] = createMarker(new GPoint(-77.88491600,34.21391500),"
Winter Park Baptist Preschool & Kindergarten
4700 Wrightsville Avenue
Wilmington, NC 28403
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Winter Park Baptist Preschool & Kindergarten",'Wilmington=' + Wilmington.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(Wilmington); 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(Wilmington);map.removeOverlays(Wilmington); map.addOverlays(Wilmington); centerByArray(Wilmington, false, false); cntMarker += Wilmington.length; centerByArray(Wilmington,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; }