Skip to content
This repository was archived by the owner on Dec 15, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/infobubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ function InfoBubble(opt_options) {
if (options['closeSrc'] == undefined) {
options['closeSrc'] = this.CLOSE_SRC_;
}

if (options['closeClass'] == undefined) {
options['closeClass'] = this.CLOSE_CLASS_;
}

this.buildDom_();
this.setValues(options);
Expand Down Expand Up @@ -186,6 +190,13 @@ InfoBubble.prototype.BACKGROUND_COLOR_ = '#fff';
*/
InfoBubble.prototype.CLOSE_SRC_ = 'https://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif';

/**
* Default close image css class
* @const
* @private
*/
InfoBubble.prototype.CLOSE_CLASS_ = 'close-image';

/**
* Extends a objects prototype by anothers.
*
Expand Down Expand Up @@ -223,6 +234,7 @@ InfoBubble.prototype.buildDom_ = function() {
close.style['zIndex'] = this.baseZIndex_ + 1;
close.style['cursor'] = 'pointer';
close.src = this.get('closeSrc');
close.className = this.get('closeClass');

var that = this;
google.maps.event.addDomListener(close, 'click', function() {
Expand Down Expand Up @@ -781,6 +793,18 @@ InfoBubble.prototype.setCloseSrc = function(src) {
};
InfoBubble.prototype['setCloseSrc'] = InfoBubble.prototype.setCloseSrc;

/**
* Set the close image css class
*
* @param {string} className css class of the image used as a close icon
*/
InfoBubble.prototype.setCloseClass = function(className) {
if (className && this.close_) {
this.close_.className = className;
}
};
InfoBubble.prototype['setCloseClass'] = InfoBubble.prototype.setCloseClass;


/**
* Set the padding of the InfoBubble
Expand Down