//>> 0; for (var i = 0; i < arguments.length; i++) { this[n] = arguments[i]; n = n + 1 >>> 0; } this.length = n; return n; }; // This function is a fix for the "pop" method on an array. // The "pop" method does not work in IE6- or Safari without this fix Array.prototype.pop = function() { var n = this.length >>> 0, value; if (n) { value = this[--n]; delete this[n]; } this.length = n; return value; }; function load() { // This function is a body onload function that shows the map if (GBrowserIsCompatible()) { // Show the map inside the "map" div var map = new GMap2(document.getElementById("map")); // Center the map about an imperical point map.setCenter(new GLatLng(40.43, -86.926), 13); // Zoom in a bit map.setZoom(12); // Add zoom/pan and type controls map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); var apt = new Array(11); apt["grpid"] = new Array( "2", "3", "4", "5", "17", "12", "11", "13", "14", "15", "16", "18", "19"); apt["address"] = new Array( "10400 East 250 North, Lafayette, IN 47905", "W. 250 North, West Lafayette, IN 47906", "1019 Holloway Dr. Lafayette, IN 47905", "2715 South St. Lafayette, IN 47904", "1414 S. 4th St. Lafayette, IN 47905", "2024 Monon Ave. Lafayette, IN 47904", "2007 Meharry St Lafayette, IN 47904", "925 Holloway Street Lafayette, IN 47905", "1029 North 18th Street Lafayette, IN 47904", "614 N 30th St Lafayette, IN 47904", "1317 South 22nd Street Lafayette, IN 47905", "1028 Tippecanoe St. Lafayette, IN 47904", "918 N. 6th St. Lafayette, IN 47904"); apt["title"] = new Array( "10400 E. 250 N.", "Lindberg Village", "Hillside Apartments", "2715 South St.", "1414 S. 4th St.", "2024 Monon Ave.", "2007 Meharry St.", "925 Holloway St.", "1029 N. 18th", "614 N. 30th St.", "1317 S. 22nd St.", "1028 Tippecanoe St.", "918/920 N. 6th St."); apt["blurb"] = new Array( "", "", "", "", "", "", "", "", "", "", "", "", ""); apt["thumb"] = new Array( "cabin_side.jpg", "2385_Edison_generic_front.jpg", "holloway_outside.jpg", "2715SS_front.jpg", "1414s4th_3.jpg", "monon_outside.jpg", "meharry_IMG_1.jpg", "925holloway_front.jpg", "1029N18th_IMG_0814.jpg", "614N30th_IMG_1454.jpg", "1317S22nd_IMG_1350.jpg", "tippy_thumb.jpg", ""); apt["bed"] = new Array( "2", "3/4", "1-1.5", "1", "2", "1", "3", "2", "1", "2", "2", "1 or 2", "1 or 2"); apt["bath"] = new Array( "1.5", "4", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1"); apt["rent"] = new Array( "$725", "$1185+", "$425+", "$435+", "$685", "$450+", "$795", "$650", "$550", "$695", "$675", "$700+", "$700+"); apt["lat"] = new Array( "40.4540554", "40.4528551", "40.4071069", "40.4174563", "40.403217", "40.4427705", "40.4338169", "40.4074515", "40.4273538", "40.4226742", "0", "0", "0"); apt["lng"] = new Array( "-86.7061932", "-86.9706119", "-86.8976492", "-86.8661465", "-86.893036", "-86.874555", "-86.8743698", "-86.8976598", "-86.877406", "-86.8629379", "0", "0", "0"); apt["info"] = new Array( "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n"); // User defined function called to place markers on the map var cntr = 0; for(j in apt["address"]) { placeMarker(map, apt["address"][j], apt["lat"][j], apt["lng"][j], apt["info"][j], cntr); cntr = cntr + 1; } } return {myMap:map, myApt:apt}; } function placeMarker(mapObj, place, lat, lng, window_text, countNum) { // "mapObj" is a GMap2 object // "place" is a string representing the address of a location // "window_text" is the html (in string form) that will // be displayed in the conversation window if (lat == 0) var valid_lat = false; else var valid_lat = true; if (!valid_lat) { // Initialize the geocoder (convert address to lat/long geocoder = new GClientGeocoder(); if (geocoder) { // Convert "place" address into "point" lat/long geocoder.getLatLng(place, function(point) { if (!point) alert(place + " not found"); else { // Initialize new marker var marker = new GMarker(point); add_marker(mapObj, marker, window_text, countNum); } } ); } } else { var marker = new GMarker(new GLatLng(lat, lng)); add_marker(mapObj, marker, window_text, countNum); } } function add_marker(gmapObj, mkr, txt, index_nbr) { // Add the marker to an array of markers myMarkers[index_nbr] = mkr; // Display marker gmapObj.addOverlay(mkr); // Listen for clicks on markers and display // the conversation bubble upon click GEvent.addListener(mkr, "click", function() { mkr.openInfoWindowHtml(txt); } ); } function showMarkerText(num) { GEvent.trigger(myMarkers[num],"click"); } //]]>