function addMarkers(){ mySelect = document.getElementById('selection'); Norfolk = [];mySelect.options[mySelect.options.length] = new Option("Norfolk schools",'all=Norfolk'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.24103200,36.91087100),"
Alpha Beta Cappa Academy
7425 Chesapeake Blvd.
Norfolk, VA 23513
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Alpha Beta Cappa Academy",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.19772800,36.84143700),"
Arrowhead Child Care Limited
5980 Curlew Drive
Norfolk, VA 23502
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Arrowhead Child Care Limited",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.22677000,36.88105000),"
Azalea Garden Christian School
5160 Beamon Road
Norfolk, VA 23513
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Azalea Garden Christian School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.19120400,36.84768800),"
Barry Robinson Center
443 Kempsville Road
Norfolk, VA 23502
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Barry Robinson Center",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.24574500,36.93357000),"
Bayview Christian School
707 E Bayview Blvd
Norfolk, VA 23503
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bayview Christian School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.24892800,36.91630100),"
Building Blocks Pre-school
844 Jerome Ave
Norfolk, VA 23518
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Building Blocks Pre-school",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.21875500,36.91494700),"
Calvary Christian Schools
2329 E Little Creek Road
Norfolk, VA 23518
Co-ed school, NS-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Calvary Christian Schools",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.26230100,36.88139400),"
Christ The King Elementary School
3401 Tidewater Drive
Norfolk, VA 23509
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Christ The King Elementary School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.30070200,36.86354200),"
Discovery Care Ctr-ghent
811 Redgate Ave
Norfolk, VA 23507
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Discovery Care Ctr-ghent",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.27481500,36.87227600),"
Faith Academy School Of Ex
1010 E 26th Street
Norfolk, VA 23504
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Faith Academy School Of Ex",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.29548400,36.86062700),"
First Presbyterian Preschool
820 Colonial Avenue
Norfolk, VA 23507
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("First Presbyterian Preschool",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.29267600,36.86677700),"
Ghent Academy, Llc
1600 Colonial Ave
Norfolk, VA 23517
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ghent Academy, Llc",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.29294700,36.85743900),"
Ghent Montessori School
610 Mowbray Arch
Norfolk, VA 23507
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ghent Montessori School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.23541900,36.88477400),"
Grace Baptist School
3423 Sewells Point Rd.
Norfolk, VA 23513
Co-ed school, PK-6
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Grace Baptist School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.24712700,36.89886300),"
Greenhill Farms Christian Academy
969 Philpotts Road
Norfolk, VA 23513
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Greenhill Farms Christian Academy",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.25598500,36.95141700),"
Holy Trinity School
154 W Government Avenue
Norfolk, VA 23503
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Holy Trinity School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.30574500,36.91191200),"
Loch Meadow Kndrgtn Inc
7400 Hampton Blvd
Norfolk, VA 23505
Co-ed school, NS-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Loch Meadow Kndrgtn Inc",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.27506400,36.90962800),"
Mcdonald Montessori
7255 Granby Street
Norfolk, VA 23505
Co-ed school, PK-3
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mcdonald Montessori",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.25179200,36.91752600),"
Mclea School
745 Bancker Road
Norfolk, VA 23518
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Mclea School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.19201600,36.87649600),"
Norfolk Academy
1585 Wesleyan Drive
Norfolk, VA 23502
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Norfolk Academy",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.27195900,36.90525300),"
Norfolk Christian Schools
255 Thole Street
Norfolk, VA 23505
Co-ed school, PK-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Norfolk Christian Schools",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.27393500,36.91120800),"
Norfolk Collegiate School
7336 Granby Street
Norfolk, VA 23505
Co-ed school, K-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Norfolk Collegiate School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.25300600,36.94947300),"
Ocean View Christian Acad.
9504 Selby Place
Norfolk, VA 23503
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ocean View Christian Acad.",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.26607600,36.91130700),"
Parkdale Private School Inc
321 Virginian Drive
Norfolk, VA 23505
Co-ed school, KG-KG
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Parkdale Private School Inc",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.24892800,36.91630100),"
Ryan Academy Of Norfolk
844 Jerome Avenue
Norfolk, VA 23518
Co-ed school, 1-12
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ryan Academy Of Norfolk",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.22119100,36.91379700),"
St. Pius X School
7800 Halprin Drive
Norfolk, VA 23518
Co-ed school, PK-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St. Pius X School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.25458700,36.93937500),"
St John Lutheran School
8918 Tidewater Drive
Norfolk, VA 23503
Co-ed school, PK-1
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St John Lutheran School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.20992400,36.83784600),"
St Peter's Episcopal Day School
224 S Military Highway
Norfolk, VA 23502
Co-ed school, NS-PK
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("St Peter's Episcopal Day School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.20550200,36.87198700),"
Town & Country Day School
1421 Kempsville Road
Norfolk, VA 23502
Co-ed school, PK-4
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Town & Country Day School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.27958500,36.89542500),"
Trinity Lutheran Church School
6001 Granby Street
Norfolk, VA 23505
Co-ed school, PK-5
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Trinity Lutheran Church School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.30292100,36.86691200),"
West Ghent School
1004 Graydon Avenue
Norfolk, VA 23507
Co-ed school, PK-K
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("West Ghent School",'Norfolk=' + Norfolk.length); Norfolk[Norfolk.length] = createMarker(new GPoint(-76.29734800,36.85749900),"
The Williams School
419 Colonial Avenue
Norfolk, VA 23507
Co-ed school, K-8
[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("The Williams School",'Norfolk=' + Norfolk.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(Norfolk); 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(Norfolk);map.removeOverlays(Norfolk); map.addOverlays(Norfolk); centerByArray(Norfolk, false, false); cntMarker += Norfolk.length; centerByArray(Norfolk,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; }