function addMarkers() { mySelect = document.getElementById('selection'); High_Point = [];High_Point[High_Point.length] = createMarker(new GPoint(-79.95558929,35.93131638),"
Allen Jay Elementary School
1311 E Springfield Rd
High Point, NC 27263

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Allen Jay Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-79.95964813,35.92425919),"
Allen Jay Middle School
1201 E Fairfield Rd
High Point, NC 27263

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Allen Jay Middle School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-80.00685120,35.94813538),"
Fairview Elementary School
608 Fairview St
High Point, NC 27260

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Fairview Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-80.01580811,35.95806122),"
Ferndale Middle School
701 Ferndale Blvd
High Point, NC 27262

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ferndale Middle School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-79.95718384,36.02441025),"
Florence Elementary School
7605 Florence School Rd
High Point, NC 27265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Florence Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-80.02238464,35.95806122),"
High Point Central High School
801 Ferndale Blvd
High Point, NC 27262

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("High Point Central High School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-80.00265100,35.94634100),"
High Point Gtcc Middle College
901 South Main Street
High Point, NC 27260

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("High Point Gtcc Middle College",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-75.52412415,42.53193665),"
Johnson Street Elementary School
1601 Johnson St
High Point, NC 27262

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Johnson Street Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-80.00266266,35.97443771),"
Kirkman Park Elementary School
715 E Farriss Ave
High Point, NC 27262

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Kirkman Park Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-79.99118042,35.98162842),"
Laurin Welborn Middle School
1710 Mcguinn Dr
High Point, NC 27265

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Laurin Welborn Middle School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-79.98519135,35.97621536),"
Montlieu Avenue Elementary School
1105 Montlieu Ave
High Point, NC 27262

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Montlieu Avenue Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-80.03611755,35.97463608),"
Northwood Elementary School
818 W Lexington Ave
High Point, NC 27262

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Northwood Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-80.02545166,35.93635178),"
Oak Hill Elementary School
320 Wrightenberry St
High Point, NC 27260

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak Hill Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-80.01786041,36.00012970),"
Oak View Elementary School
614 Oakview Rd
High Point, NC 27265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Oak View Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-79.98491669,35.96921539),"
Parkview Village Elementary School
506 Henry Pl
High Point, NC 27260

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Parkview Village Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-79.99433899,35.96226120),"
Penn-griffin Middle School
E Washington Dr
High Point, NC 27260

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Penn-griffin Middle School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-80.00879669,36.01459885),"
Phoenix Academy Inc
4020 Meeting Way
High Point, NC 27265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Phoenix Academy Inc",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-80.02693176,36.00099564),"
Shadybrook Elementary School
503 Shadybrook Dr
High Point, NC 27265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Shadybrook Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-79.98796844,36.04867554),"
Southwest Elementary School
4372 Southwest School Rd.
High Point, NC 27265

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Southwest Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-79.98965454,36.04721069),"
Southwest Guilford High School
4364 Barrow Rd
High Point, NC 27265

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Southwest Guilford High School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-79.98858643,36.04817581),"
Southwest Guilford Middle School
4368 Borrow Rd
High Point, NC 27265

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Southwest Guilford Middle School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-79.98926000,35.98409700),"
T Wingate Andrews High School
1920 Mcguinn Dr
High Point, NC 27265

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("T Wingate Andrews High School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-80.02245331,35.95634842),"
Triangle Lake Montessori Elementary School
2401 Triangle Lake
High Point, NC 27262

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Triangle Lake Montessori Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-79.96321869,35.89973450),"
Trindale Elementary School
400 Balfour Dr
High Point, NC 27263

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Trindale Elementary School",'High_Point=' + High_Point.length); High_Point[High_Point.length] = createMarker(new GPoint(-79.95006561,35.95988846),"
Union Hill Elementary School
3523 Union Hill Ct
High Point, NC 27260

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("Union Hill Elementary School",'High_Point=' + High_Point.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,10); /* 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////' + showArray); map.removeOverlays(High_Point); 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(High_Point);map.removeOverlays(High_Point); map.addOverlays(High_Point); centerByArray(High_Point, false, false); cntMarker += High_Point.length; centerByArray(High_Point,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'); } }