function addMarkers(){ mySelect = document.getElementById('selection'); Houston = [];Webster = [];Baytown = [];Pasadena = [];mySelect.options[mySelect.options.length] = new Option("Baytown Schools",'all=Baytown'); mySelect.options[mySelect.options.length] = new Option("Houston Schools",'all=Houston'); mySelect.options[mySelect.options.length] = new Option("Pasadena Schools",'all=Pasadena'); mySelect.options[mySelect.options.length] = new Option("Webster Schools",'all=Webster'); mySelect.options[mySelect.options.length] = new Option("---------------------------",''); var tmpLatLng=0; var tmpLen=0; tmpLatLng=new GLatLng(29.74782799999999838,-95.4708190000000058); tmpLen=Houston.length; Houston[tmpLen] = createMarker(tmpLatLng,"
Art Institute Of Houston
1900 Yorktown Street
Houston, TX 77056

[ View School Profile ]
",iconRd); Houston[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Art Institute Of Houston",'Houston=' + Houston.length); tmpLatLng=new GLatLng(29.73862899999999953,-95.4188170000000042); tmpLen=Houston.length; Houston[tmpLen] = createMarker(tmpLatLng,"
Center For Advanced Legal Studies
3910 Kirby Ste 200
Houston, TX 77098

[ View School Profile ]
",iconRd); Houston[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Center For Advanced Legal Studies",'Houston=' + Houston.length); tmpLatLng=new GLatLng(29.71632999999999924,-95.5051200000000051); tmpLen=Houston.length; Houston[tmpLen] = createMarker(tmpLatLng,"
College Of Biblical Studies-houston
7000 Regency Square Blvd.
Houston, TX 77036

[ View School Profile ]
",iconRd); Houston[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("College Of Biblical Studies-houston",'Houston=' + Houston.length); tmpLatLng=new GLatLng(29.99044500000000113,-95.4305119999999931); tmpLen=Houston.length; Houston[tmpLen] = createMarker(tmpLatLng,"
Commonwealth Institute Of Funeral Service
415 Barren Springs Dr
Houston, TX 77090

[ View School Profile ]
",iconRd); Houston[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Commonwealth Institute Of Funeral Service",'Houston=' + Houston.length); tmpLatLng=new GLatLng(29.78662699999999929,-95.3674149999999940); tmpLen=Houston.length; Houston[tmpLen] = createMarker(tmpLatLng,"
Houston Community College System
3100 Main Street
Houston, TX 77266

[ View School Profile ]
",iconGr); Houston[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Houston Community College System",'Houston=' + Houston.length); tmpLatLng=new GLatLng(29.99341400000000135,-95.4286089999999944); tmpLen=Houston.length; Houston[tmpLen] = createMarker(tmpLatLng,"
Itt Technical Institute-houston North
15621 Blue Ash Dr, Ste 160
Houston, TX 77090

[ View School Profile ]
",iconRd); Houston[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Itt Technical Institute-houston North",'Houston=' + Houston.length); tmpLatLng=new GLatLng(29.73307199999999994,-95.5399199999999950); tmpLen=Houston.length; Houston[tmpLen] = createMarker(tmpLatLng,"
Itt Technical Institute-houston West
2950 S Gessner
Houston, TX 77063

[ View School Profile ]
",iconRd); Houston[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Itt Technical Institute-houston West",'Houston=' + Houston.length); tmpLatLng=new GLatLng(29.57042699999999868,-95.1111649999999997); tmpLen=Webster.length; Webster[tmpLen] = createMarker(tmpLatLng,"
Itt Technical Institute-webster
1001 Magnolia Ave
Webster, TX 77598

[ View School Profile ]
",iconRd); Webster[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Itt Technical Institute-webster",'Webster=' + Webster.length); tmpLatLng=new GLatLng(29.73095299999999952,-94.9750520000000051); tmpLen=Baytown.length; Baytown[tmpLen] = createMarker(tmpLatLng,"
Lee College
511 S Whiting
Baytown, TX 77520

[ View School Profile ]
",iconGr); Baytown[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Lee College",'Baytown=' + Baytown.length); tmpLatLng=new GLatLng(29.71591700000000102,-95.5106219999999979); tmpLen=Houston.length; Houston[tmpLen] = createMarker(tmpLatLng,"
Mti College Of Business And Technology
7277 Regency Sq Blvd
Houston, TX 77036

[ View School Profile ]
",iconRd); Houston[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Mti College Of Business And Technology",'Houston=' + Houston.length); tmpLatLng=new GLatLng(29.66371200000000030,-95.1161180000000001); tmpLen=Pasadena.length; Pasadena[tmpLen] = createMarker(tmpLatLng,"
San Jacinto College-central Campus
8060 Spencer Hwy
Pasadena, TX 77501

[ View School Profile ]
",iconGr); Pasadena[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("San Jacinto College-central Campus",'Pasadena=' + Pasadena.length); tmpLatLng=new GLatLng(29.80904200000000159,-95.1820289999999999); tmpLen=Houston.length; Houston[tmpLen] = createMarker(tmpLatLng,"
San Jacinto College-north Campus
5800 Uvalde
Houston, TX 77049

[ View School Profile ]
",iconGr); Houston[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("San Jacinto College-north Campus",'Houston=' + Houston.length); tmpLatLng=new GLatLng(29.57560499999999947,-95.2025620000000003); tmpLen=Houston.length; Houston[tmpLen] = createMarker(tmpLatLng,"
San Jacinto College-south Campus
13735 Beamer Rd
Houston, TX 77089

[ View School Profile ]
",iconGr); Houston[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("San Jacinto College-south Campus",'Houston=' + Houston.length); tmpLatLng=new GLatLng(29.99000799999999955,-95.4126020000000067); tmpLen=Houston.length; Houston[tmpLen] = createMarker(tmpLatLng,"
Universal Technical Institute Of Texas Inc
721 Lockhaven Dr
Houston, TX 77073

[ View School Profile ]
",iconRd); Houston[tmpLen].point = tmpLatLng; mySelect.options[mySelect.options.length] = new Option("Universal Technical Institute Of Texas Inc",'Houston=' + Houston.length); map.removeOverlays(Baytown); map.removeOverlays(Houston); map.removeOverlays(Pasadena); map.removeOverlays(Webster); setTimeout(function(){map.addOverlays(Baytown)},1000); setTimeout(function(){map.addOverlays(Houston)},1000); setTimeout(function(){map.addOverlays(Pasadena)},1000); setTimeout(function(){map.addOverlays(Webster)},1000); maxLng = -94.9750520000000051; maxLat = 29.99341400000000135; minLng = -95.5399199999999950; minLat = 29.57042699999999868; 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(Baytown); map.removeOverlays(Houston); map.removeOverlays(Pasadena); map.removeOverlays(Webster); 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(Houston);map.removeOverlays(Baytown); map.removeOverlays(Houston); map.removeOverlays(Pasadena); map.removeOverlays(Webster); map.addOverlays(Baytown); centerByArray(Baytown, false, false); cntMarker += Baytown.length; map.addOverlays(Houston); centerByArray(Houston, false, false); cntMarker += Houston.length; map.addOverlays(Pasadena); centerByArray(Pasadena, false, false); cntMarker += Pasadena.length; map.addOverlays(Webster); centerByArray(Webster, false, false); cntMarker += Webster.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; }