function addMarkers(){ mySelect = document.getElementById('selection'); New_York = [];var tmpLatLng=0; var tmpLen=0; tmpLatLng=new GLatLng(40.76871700000000231,-73.9932220000000029); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
American Academy Mcallister Institute Of Funeral S
619 West 54th Street - 6th Floor
New York, NY 10019

[ View School Profile ]
",iconRd); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("American Academy Mcallister Institute Of Funeral S",'New_York=' + New_York.length); tmpLatLng=new GLatLng(40.74560600000000221,-73.9849090000000018); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
American Academy Of Dramatic Arts
120 Madison Ave
New York, NY 10016

[ View School Profile ]
",iconRd); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("American Academy Of Dramatic Arts",'New_York=' + New_York.length); tmpLatLng=new GLatLng(40.72329400000000276,-74.0063530000000042); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
Art Institute Of New York City
75 Varick St 16th Fl
New York, NY 10013

[ View School Profile ]
",iconRd); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Art Institute Of New York City",'New_York=' + New_York.length); tmpLatLng=new GLatLng(40.75415799999999677,-73.9800549999999930); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
Berkeley College
3 East 43 Street
New York, NY 10017

[ View School Profile ]
",iconRd); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Berkeley College",'New_York=' + New_York.length); tmpLatLng=new GLatLng(40.71735000000000326,-74.0119859999999931); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
Cuny Borough Of Manhattan Community College
199 Chambers St
New York, NY 10007

[ View School Profile ]
",iconGr); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Cuny Borough Of Manhattan Community College",'New_York=' + New_York.length); tmpLatLng=new GLatLng(40.71512799999999998,-74.0057230000000032); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
Globe Institute Of Technology
291 Broadway
New York, NY 10007

[ View School Profile ]
",iconRd); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Globe Institute Of Technology",'New_York=' + New_York.length); tmpLatLng=new GLatLng(40.80291299999999665,-73.9437319999999971); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
Helene Fuld College Of Nursing
26 East 120th Street
New York, NY 10035

[ View School Profile ]
",iconRd); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Helene Fuld College Of Nursing",'New_York=' + New_York.length); tmpLatLng=new GLatLng(40.76784599999999869,-73.9877520000000004); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
Interboro Institute
450 W 56th Street
New York, NY 10019

[ View School Profile ]
",iconRd); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Interboro Institute",'New_York=' + New_York.length); tmpLatLng=new GLatLng(40.75298699999999740,-73.9839850000000041); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
Katharine Gibbs School-new York City
50 West 40 Street
New York, NY 10018

[ View School Profile ]
",iconRd); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Katharine Gibbs School-new York City",'New_York=' + New_York.length); tmpLatLng=new GLatLng(40.71130699999999791,-74.0078740000000010); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
New York Career Institute
11 Park Place 4th Floor
New York, NY 10007

[ View School Profile ]
",iconRd); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("New York Career Institute",'New_York=' + New_York.length); tmpLatLng=new GLatLng(40.73747999999999791,-73.9813759999999973); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
Phillips Beth Israel School Of Nursing
766 Sixth Avenue 4th Floor
New York, NY 10001

[ View School Profile ]
",iconRd); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Phillips Beth Israel School Of Nursing",'New_York=' + New_York.length); tmpLatLng=new GLatLng(40.73867099999999652,-73.9925479999999993); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
Taylor Business Institute
23 West 17thstreet, 7th Fl.
New York, NY 10011

[ View School Profile ]
",iconRd); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Taylor Business Institute",'New_York=' + New_York.length); tmpLatLng=new GLatLng(40.75069899999999734,-73.9954900000000037); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
Technical Career Institutes
320 W 31st St
New York, NY 10001

[ View School Profile ]
",iconRd); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Technical Career Institutes",'New_York=' + New_York.length); tmpLatLng=new GLatLng(40.73995500000000191,-74.0027429999999952); tmpLen=New_York.length; New_York[tmpLen] = createMarker(tmpLatLng,"
Tri-state College Of Acupuncture
80 Eighth Ave Rm 400
New York, NY 10011

[ View School Profile ]
",iconRd); New_York[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Tri-state College Of Acupuncture",'New_York=' + New_York.length); map.removeOverlays(New_York); setTimeout(function(){map.addOverlays(New_York)},1000); maxLng = -73.9437319999999971; maxLat = 40.80291299999999665; minLng = -74.0119859999999931; minLat = 40.71130699999999791; reCenterMap(); } // End addStateMarkers JavaScript Function //open all when map is defined function openAll() { if (map) { selectChange("all"); } else { setTimeout("openAll()",200); } } // 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].point.x; var markLat = myArray[i].point.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].point.x; maxLat = myArray[0].point.y; minLng = myArray[0].point.x; minLat = myArray[0].point.y; } // Recenter map based on global max/mins function reCenterMap(){ //alert('#' + minLat + '#' + minLng + '#' + maxLat + '#' + maxLng); 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) { if (selection.options) { var _openNewWindow=true; var myVal = selection.options[selection.selectedIndex].value; } else { var _openNewWindow=false; var myVal=selection; } 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('schools-by-distance') == -1) window.open(location.href + '/map/all'); else window.open('/search////all'); map.removeOverlays(New_York); 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(New_York);map.removeOverlays(New_York); map.addOverlays(New_York); centerByArray(New_York, false, false); cntMarker += New_York.length; reCenterMap(); //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'); } } function createMarker(point, label, icon){ var marker = new GMarker(point, icon); var html = label; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }