//Get directions: '; if (dir == "to") { dir_div.innerHTML += 'To here - From here
'; dir_div.innerHTML += 'Start address:'; } else if (dir == "from") { dir_div.innerHTML += 'To here - From here
'; dir_div.innerHTML += 'End address:'; } dir_div.innerHTML += '
'; dir_div.innerHTML += ' '; dir_div.innerHTML += ''; } this.map.closeInfoWindow(); marker.openInfoWindowHtml('
'+info_div.innerHTML+'
', {maxWidth: sxsw_map_settings["Popup Width"]}); } SXSWMap.prototype.getDirections = function(infoindex, dir, input) { var start_addr; var end_addr; if (dir == "to") { start_addr = input; end_addr = infoindex; } else if (dir == "from") { start_addr = infoindex; end_addr = input; } window.open("http://maps.google.com/maps?saddr="+start_addr+"&daddr="+end_addr); } function SXSWMapPoint(point, place_obj, info_obj, address_str, map) { this.map_obj = map; this.map = this.map_obj.map; this.point = point; this.id = info_obj.id; this.title = info_obj.name; //this.description = info_obj.description; this.events = info_obj.events; //this.phone = info_obj.phone; this.show_address = info_obj.showAddress; this.show_directions = info_obj.showDirections; this.icon = info_obj.icon; // address properties this.address = address_str; this.street = place_obj.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.Thoroughfare.ThoroughfareName; this.city = place_obj.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName; this.state = place_obj.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName; this.zip = place_obj.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.PostalCode.PostalCodeNumber; this.addMarker(); } SXSWMapPoint.prototype.addMarker = function() { this.marker = new GMarker(this.point, {icon: this.setupIcon(this.icon), title: this.title}); GEvent.bind(this.marker, "click", this, this.setupClick); //GEvent.bind(this.marker, "click", this, this.setupInfoWindowOpen); //GEvent.bind(this.marker, "infowindowclose", this, this.setupInfoWindowClose); this.map_obj.information[this.address].marker = this.marker; this.map.addOverlay(this.marker); //return marker; } SXSWMapPoint.prototype.setupClick = function() { var address_obj = {}; address_obj.address = this.address; address_obj.street = this.street; address_obj.city = this.city; address_obj.state = this.state; address_obj.zip = this.zip; showSXSWEventInfo(this.title, address_obj); //showSXSWEventInfo(this.id, address_obj); } SXSWMapPoint.prototype.setupInfoWindowOpen = function() { //alert(this.events[0].type); showMapPointInfo(this.title); if (this.map.getInfoWindow().current_marker != this.marker) { this.map.closeInfoWindow(); var display = '
'; for (var i=0; i < this.events.length; i++) { display += '
'; display += this.events[i].name; display += '
'; } display += '
'; if (this.title != "" && this.title != null && this.title != undefined) { display += '' + this.title + '
'; } /*if (this.description != "" && this.description != null && this.description != "undefined") { display += this.description + '
'; }*/ if (this.show_address) { display += '
'; display += this.street + '
'; display += this.city + ', '; display += this.state + ' '; display += this.zip; display += '
'; if (this.phone != "" && this.phone != null && this.phone != "undefined") { display += this.phone + '
'; } } display += '
'; if (this.show_directions) { //display += '
'; display += '
'; display += 'Get directions: To here - From here'; display += '
'; } display += '
'; this.marker.openInfoWindowHtml(display, {maxWidth: sxsw_map_settings["Popup Width"]}); this.map.getInfoWindow().current_marker = this.marker; this.map.getInfoWindow().current_address = this.address; } else { this.map.closeInfoWindow(); //delete map.getInfoWindow().current_marker; //delete map.getInfoWindow().current_address; } } SXSWMapPoint.prototype.setupInfoWindowClose = function() { delete this.map.getInfoWindow().current_marker; delete this.map.getInfoWindow().current_address; } SXSWMapPoint.prototype.setupIcon = function(png) { if (png == "default") { return new GIcon(G_DEFAULT_ICON); } else { return new GIcon(G_DEFAULT_ICON, png); } } // write script function includeScript(script_filename) { document.write('<' + 'script'); document.write(' id="google_map_script"'); document.write(' language="javascript"'); document.write(' type="text/javascript"'); document.write(' src="' + script_filename + '">'); document.write(''); //window.onload = loadSXSWMap; } // UNUSED function panTo(address) { geocoder.getLocations(address, panToAddress); } function panToAddress(response) { if (!response || response.Status.code != 200) { alert(address + " not found"); } else { var place = response.Placemark[0]; var point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]); map.panTo(point); GEvent.trigger(sxsw_map_points[response.name].marker, "click"); } } SXSWMap.prototype.createAd = function() { var mapdiv = this.map_div; var ad_div = document.createElement("div");//document.getElementById("ad"); ad_div.style.width = "75px"; ad_div.style.height = "50px"; ad_div.style.border = "1px solid black"; ad_div.style.backgroundColor = "red"; ad_div.style.position = "absolute"; ad_div.style.top = parseInt(mapdiv.style.height) - parseInt(ad_div.style.height) + "px"; ad_div.style.left = parseInt(mapdiv.style.width) - parseInt(ad_div.style.width) + "px"; this.map.getContainer().appendChild(ad_div); } //]]>