function addMarkers() { mySelect = document.getElementById('selection'); Bronx = [];Bronx[Bronx.length] = createMarker(new GPoint(-73.91209400,40.87721400),"
Bronx School Of Law And Finance
99 Terrace View Ave
Bronx, NY 10463

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bronx School Of Law And Finance",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.90660095,40.88159943),"
Bronx Theatre High School
99 Terrace View Ave
Bronx, NY 10463

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Bronx Theatre High School",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.90099335,40.87572098),"
J.H.S. 143-john Peter Tetard School
120 West 231st Street
Bronx, NY 10463

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("J.H.S. 143-john Peter Tetard School",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.91236877,40.87692642),"
John F. Kennedy High School
99 Terrace View Ave-4th Fl
Bronx, NY 10463

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("John F. Kennedy High School",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.91243744,40.87717438),"
Marble Hill High School - Intrntnl Studies
99 Terrace View Ave
Bronx, NY 10463

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marble Hill High School - Intrntnl Studies",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.90109900,40.87591400),"
Marie Curie High School-nursing
120 W 231st St
Bronx, NY 10463

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Marie Curie High School-nursing",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.91365051,40.88832092),"
Ms/hs 141-da Stein Riv/kings School
660 West 237th Street
Bronx, NY 10463

[ View School Profile ]
",iconGr); mySelect.options[mySelect.options.length] = new Option("Ms/hs 141-da Stein Riv/kings School",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.91603851,40.88505554),"
Ms/hs 368-info & Network Technical School
2975 Tibbetts Ave
Bronx, NY 10463

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Ms/hs 368-info & Network Technical School",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.90109900,40.87591400),"
New School For Leadership And Journalism
120 W 231st St
Bronx, NY 10463

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("New School For Leadership And Journalism",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.90550232,40.88097763),"
P.S. 7 Kingsbridge School
3201 Kingsbridge Avenue
Bronx, NY 10463

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("P.S. 7 Kingsbridge School",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.91356659,40.88719940),"
P.S. 24 Spuyten Duyvil School
660 West 236th Street
Bronx, NY 10463

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("P.S. 24 Spuyten Duyvil School",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.90680695,40.87807846),"
P.S. 207
3030 Godwin Terrace
Bronx, NY 10463

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("P.S. 207",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.90421295,40.87073898),"
P.S. 310-marble Hill School
260 West Kingsbridge Road
Bronx, NY 10463

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("P.S. 310-marble Hill School",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.90222168,40.87464905),"
P.S. 360
2880 Kingsbridge Terrace
Bronx, NY 10463

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("P.S. 360",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.91027832,40.88000870),"
P.S. 37-multiple Intelligence School
360 West 230th Street
Bronx, NY 10463

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("P.S. 37-multiple Intelligence School",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.89114380,40.88260269),"
P.S. 95-sheila Mencher
3961 Hillman Avenue
Bronx, NY 10463

[ View School Profile ]
",iconRd); mySelect.options[mySelect.options.length] = new Option("P.S. 95-sheila Mencher",'Bronx=' + Bronx.length); Bronx[Bronx.length] = createMarker(new GPoint(-73.91503300,40.88560200),"
Urban Assmbly-appl Math
3223 Independence Ave
Bronx, NY 10463

[ View School Profile ]
",iconBl); mySelect.options[mySelect.options.length] = new Option("Urban Assmbly-appl Math",'Bronx=' + Bronx.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(Bronx); 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(Bronx);map.removeOverlays(Bronx); map.addOverlays(Bronx); centerByArray(Bronx, false, false); cntMarker += Bronx.length; centerByArray(Bronx,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'); } }