diff --git a/src/infobubble.js b/src/infobubble.js index 0f8f82b..4513a77 100755 --- a/src/infobubble.js +++ b/src/infobubble.js @@ -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); @@ -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. * @@ -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() { @@ -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