{"version":3,"sources":["infobubble.js"],"names":["InfoBubble","opt_options","this","extend","google","maps","OverlayView","tabs_","activeTab_","baseZIndex_","isOpen_","options","undefined","BACKGROUND_COLOR_","BORDER_COLOR_","BORDER_RADIUS_","BORDER_WIDTH_","PADDING_","ARROW_POSITION_","MIN_WIDTH_","SHADOW_STYLE_","ARROW_SIZE_","ARROW_STYLE_","CLOSE_SRC_","buildDom_","setValues","window","prototype","obj1","obj2","object","property","apply","bubble","bubble_","document","createElement","style","tabsContainer_","close","close_","src","get","that","event","addDomListener","trigger","contentContainer","contentContainer_","content","content_","appendChild","arrow","arrow_","arrowOuter","arrowOuter_","arrowInner","arrowInner_","arrowSize","getArrowSize_","px","bubbleShadow","bubbleShadow_","stylesheet","setAttribute","animationName_","Math","round","random","css","textContent","getElementsByTagName","setBackgroundClassName","className","set","backgroundClassName_changed","setTabClassName","tabClassName_changed","updateTabStyles_","getArrowStyle_","parseInt","setArrowStyle","arrowStyle_changed","arrowSize_changed","setArrowSize","size","borderWidth_changed","setArrowPosition","pos","getArrowPosition_","arrowPosition_changed","redraw_","setZIndex","zIndex","getZIndex","zIndex_changed","setShadowStyle","shadowStyle","getShadowStyle_","shadowStyle_changed","display","shadow","backgroundColor","draw","showCloseButton","hideCloseButton","hideCloseButton_changed","setBackgroundColor","color","backgroundColor_changed","setBorderColor","borderColor_changed","borderColor","setBorderRadius","radius","getBorderRadius_","borderRadius_changed","borderRadius","borderWidth","getBorderWidth_","setBorderWidth","width","updateArrowStyle_","arrowStyle","arrowOuterSizePx","arrowInnerSizePx","max","outer","inner","setPadding","padding","setCloseSrc","getPadding_","padding_changed","num","addEvents_","events","listeners_","i","push","e","cancelBubble","stopPropagation","onAdd","panes","getPanes","floatPane","floatShadow","projection","getProjection","latLng","tabHeight","offsetHeight","anchorHeight","getAnchorHeight_","arrowPosition","fromLatLngToDivPixel","offsetWidth","height","top","y","left","x","onRemove","parentNode","removeChild","listener","removeListener","isOpen","replace","open","opt_map","opt_anchor","setTimeout","open_","updateContent_","setMap","bindTo","panToView","setPosition","position","getPosition","position_changed","map","mapHeight","getDiv","centerPos","fromLatLngToContainerPixel","getCenter","spaceTop","spaceBottom","deltaY","fromContainerPixelToLatLng","panTo","htmlToDocumentFragment_","htmlString","tempDiv","innerHTML","childNodes","length","firstChild","fragment","createDocumentFragment","removeChildren_","node","child","setContent","getContent","image","images","imageLoaded_","pan","index","tab","setTabStyle_","marginRight","borderRadiusPx","styles","cssFloat","cursor","border","whiteSpace","borderRadiusTopLeft","MozBorderRadiusTopleft","webkitBorderTopLeftRadius","borderRadiusTopRight","MozBorderRadiusTopright","webkitBorderTopRightRadius","addTabActions_","listener_","setTabActive_","setTabActive","activeTab","setMaxWidth","maxWidth_changed","setMaxHeight","maxHeight_changed","setMinWidth","minWidth_changed","setMinHeight","minHeight_changed","addTab","label","updateTab","opt_label","opt_content","removeTab","splice","t","getElementSize_","element","opt_maxWidth","opt_maxHeight","sizer","cloneNode","body","Size","figureOutSize_","positionCloseButton_","mapDiv","gutter","mapWidth","maxWidth","maxHeight","min","tabWidth","tabSize","contentSize","tabHeight_","anchorPoint","anchorPoint_changed","bw","right","c","clientHeight","scrollHeight"],"mappings":"AAmCA,SAASA,WAAWC,GAClBC,KAAKC,OAAOH,WAAYI,OAAOC,KAAKC,aACpCJ,KAAKK,MAAQ,GACbL,KAAKM,WAAa,KAClBN,KAAKO,YAAc,IACnBP,KAAKQ,SAAU,EAEf,IAAIC,EAAUV,GAAe,GAEKW,MAA9BD,EAAyB,kBAC3BA,EAAyB,gBAAIT,KAAKW,mBAGND,MAA1BD,EAAqB,cACvBA,EAAqB,YAAIT,KAAKY,eAGDF,MAA3BD,EAAsB,eACxBA,EAAsB,aAAIT,KAAKa,gBAGHH,MAA1BD,EAAqB,cACvBA,EAAqB,YAAIT,KAAKc,eAGNJ,MAAtBD,EAAiB,UACnBA,EAAiB,QAAIT,KAAKe,UAGIL,MAA5BD,EAAuB,gBACzBA,EAAuB,cAAIT,KAAKgB,iBAG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AAK0Q,YAGd7G,GAAOgH,EACPC,GAASD,EAET,IAAIE,EAAI/Q,KAAK8C,kBACTiO,GAAKA,EAAEC,aAAeD,EAAEE,eAG1BH,GAAS,IAGX9Q,KAAKsC,OAAOH,MAAa,MAAInC,KAAK0D,GAAGoN,GACrC9Q,KAAKsC,OAAOH,MAAW,IAAInC,KAAK0D,GAAGmG","file":"../infobubble.min.js","sourcesContent":["// ==ClosureCompiler==\r\n// @compilation_level ADVANCED_OPTIMIZATIONS\r\n// @externs_url https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/maps/google_maps_api_v3_16.js\r\n// ==/ClosureCompiler==\r\n\r\n/**\r\n * @name CSS3 InfoBubble with tabs for Google Maps API V3\r\n * @version 0.8\r\n * @author Luke Mahe\r\n * @fileoverview\r\n * This library is a CSS Infobubble with tabs. It uses css3 rounded corners and\r\n * drop shadows and animations. It also allows tabs\r\n */\r\n\r\n/*\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n/**\r\n * A CSS3 InfoBubble v0.8\r\n * @param {Object.=} opt_options Optional properties to set.\r\n * @extends {google.maps.OverlayView}\r\n * @constructor\r\n */\r\nfunction InfoBubble(opt_options) {\r\n this.extend(InfoBubble, google.maps.OverlayView);\r\n this.tabs_ = [];\r\n this.activeTab_ = null;\r\n this.baseZIndex_ = 100;\r\n this.isOpen_ = false;\r\n\r\n var options = opt_options || {};\r\n\r\n if (options['backgroundColor'] == undefined) {\r\n options['backgroundColor'] = this.BACKGROUND_COLOR_;\r\n }\r\n\r\n if (options['borderColor'] == undefined) {\r\n options['borderColor'] = this.BORDER_COLOR_;\r\n }\r\n\r\n if (options['borderRadius'] == undefined) {\r\n options['borderRadius'] = this.BORDER_RADIUS_;\r\n }\r\n\r\n if (options['borderWidth'] == undefined) {\r\n options['borderWidth'] = this.BORDER_WIDTH_;\r\n }\r\n\r\n if (options['padding'] == undefined) {\r\n options['padding'] = this.PADDING_;\r\n }\r\n\r\n if (options['arrowPosition'] == undefined) {\r\n options['arrowPosition'] = this.ARROW_POSITION_;\r\n }\r\n\r\n if (options['disableAutoPan'] == undefined) {\r\n options['disableAutoPan'] = false;\r\n }\r\n\r\n if (options['disableAnimation'] == undefined) {\r\n options['disableAnimation'] = false;\r\n }\r\n\r\n if (options['minWidth'] == undefined) {\r\n options['minWidth'] = this.MIN_WIDTH_;\r\n }\r\n\r\n if (options['shadowStyle'] == undefined) {\r\n options['shadowStyle'] = this.SHADOW_STYLE_;\r\n }\r\n\r\n if (options['arrowSize'] == undefined) {\r\n options['arrowSize'] = this.ARROW_SIZE_;\r\n }\r\n\r\n if (options['arrowStyle'] == undefined) {\r\n options['arrowStyle'] = this.ARROW_STYLE_;\r\n }\r\n\r\n if (options['closeSrc'] == undefined) {\r\n options['closeSrc'] = this.CLOSE_SRC_;\r\n }\r\n\r\n this.buildDom_();\r\n this.setValues(options);\r\n}\r\nwindow['InfoBubble'] = InfoBubble;\r\n\r\n\r\n/**\r\n * Default arrow size\r\n * @const\r\n * @private\r\n */\r\nInfoBubble.prototype.ARROW_SIZE_ = 15;\r\n\r\n\r\n/**\r\n * Default arrow style\r\n * @const\r\n * @private\r\n */\r\nInfoBubble.prototype.ARROW_STYLE_ = 0;\r\n\r\n\r\n/**\r\n * Default shadow style\r\n * @const\r\n * @private\r\n */\r\nInfoBubble.prototype.SHADOW_STYLE_ = 1;\r\n\r\n\r\n/**\r\n * Default min width\r\n * @const\r\n * @private\r\n */\r\nInfoBubble.prototype.MIN_WIDTH_ = 50;\r\n\r\n\r\n/**\r\n * Default arrow position\r\n * @const\r\n * @private\r\n */\r\nInfoBubble.prototype.ARROW_POSITION_ = 50;\r\n\r\n\r\n/**\r\n * Default padding\r\n * @const\r\n * @private\r\n */\r\nInfoBubble.prototype.PADDING_ = 10;\r\n\r\n\r\n/**\r\n * Default border width\r\n * @const\r\n * @private\r\n */\r\nInfoBubble.prototype.BORDER_WIDTH_ = 1;\r\n\r\n\r\n/**\r\n * Default border color\r\n * @const\r\n * @private\r\n */\r\nInfoBubble.prototype.BORDER_COLOR_ = '#ccc';\r\n\r\n\r\n/**\r\n * Default border radius\r\n * @const\r\n * @private\r\n */\r\nInfoBubble.prototype.BORDER_RADIUS_ = 10;\r\n\r\n\r\n/**\r\n * Default background color\r\n * @const\r\n * @private\r\n */\r\nInfoBubble.prototype.BACKGROUND_COLOR_ = '#fff';\r\n\r\n/**\r\n * Default close image source\r\n * @const\r\n * @private\r\n */\r\nInfoBubble.prototype.CLOSE_SRC_ = 'https://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif';\r\n\r\n/**\r\n * Extends a objects prototype by anothers.\r\n *\r\n * @param {Object} obj1 The object to be extended.\r\n * @param {Object} obj2 The object to extend with.\r\n * @return {Object} The new extended object.\r\n * @ignore\r\n */\r\nInfoBubble.prototype.extend = function (obj1, obj2) {\r\n return (function (object) {\r\n for (var property in object.prototype) {\r\n this.prototype[property] = object.prototype[property];\r\n }\r\n return this;\r\n }).apply(obj1, [obj2]);\r\n};\r\n\r\n\r\n/**\r\n * Builds the InfoBubble dom\r\n * @private\r\n */\r\nInfoBubble.prototype.buildDom_ = function () {\r\n var bubble = this.bubble_ = document.createElement('DIV');\r\n bubble.style['position'] = 'absolute';\r\n bubble.style['zIndex'] = this.baseZIndex_;\r\n\r\n var tabsContainer = this.tabsContainer_ = document.createElement('DIV');\r\n tabsContainer.style['position'] = 'relative';\r\n\r\n // Close button\r\n var close = this.close_ = document.createElement('IMG');\r\n close.style['position'] = 'absolute';\r\n close.style['border'] = 0;\r\n close.style['zIndex'] = this.baseZIndex_ + 1;\r\n close.style['cursor'] = 'pointer';\r\n close.src = this.get('closeSrc');\r\n\r\n var that = this;\r\n google.maps.event.addDomListener(close, 'click', function () {\r\n that.close();\r\n google.maps.event.trigger(that, 'closeclick');\r\n });\r\n\r\n // Content area\r\n var contentContainer = this.contentContainer_ = document.createElement('DIV');\r\n contentContainer.style['overflowX'] = 'auto';\r\n contentContainer.style['overflowY'] = 'auto';\r\n contentContainer.style['cursor'] = 'default';\r\n contentContainer.style['clear'] = 'both';\r\n contentContainer.style['position'] = 'relative';\r\n\r\n var content = this.content_ = document.createElement('DIV');\r\n contentContainer.appendChild(content);\r\n\r\n // Arrow\r\n var arrow = this.arrow_ = document.createElement('DIV');\r\n arrow.style['position'] = 'relative';\r\n\r\n var arrowOuter = this.arrowOuter_ = document.createElement('DIV');\r\n var arrowInner = this.arrowInner_ = document.createElement('DIV');\r\n\r\n var arrowSize = this.getArrowSize_();\r\n\r\n arrowOuter.style['position'] = arrowInner.style['position'] = 'absolute';\r\n arrowOuter.style['left'] = arrowInner.style['left'] = '50%';\r\n arrowOuter.style['height'] = arrowInner.style['height'] = '0';\r\n arrowOuter.style['width'] = arrowInner.style['width'] = '0';\r\n arrowOuter.style['marginLeft'] = this.px(-arrowSize);\r\n arrowOuter.style['borderWidth'] = this.px(arrowSize);\r\n arrowOuter.style['borderBottomWidth'] = 0;\r\n\r\n // Shadow\r\n var bubbleShadow = this.bubbleShadow_ = document.createElement('DIV');\r\n bubbleShadow.style['position'] = 'absolute';\r\n\r\n // Hide the InfoBubble by default\r\n bubble.style['display'] = bubbleShadow.style['display'] = 'none';\r\n\r\n bubble.appendChild(this.tabsContainer_);\r\n bubble.appendChild(close);\r\n bubble.appendChild(contentContainer);\r\n arrow.appendChild(arrowOuter);\r\n arrow.appendChild(arrowInner);\r\n bubble.appendChild(arrow);\r\n\r\n var stylesheet = document.createElement('style');\r\n stylesheet.setAttribute('type', 'text/css');\r\n\r\n /**\r\n * The animation for the infobubble\r\n * @type {string}\r\n */\r\n this.animationName_ = '_ibani_' + Math.round(Math.random() * 10000);\r\n\r\n var css = '.' + this.animationName_ + '{-webkit-animation-name:' +\r\n this.animationName_ + ';-webkit-animation-duration:0.5s;' +\r\n '-webkit-animation-iteration-count:1;}' +\r\n '@-webkit-keyframes ' + this.animationName_ + ' {from {' +\r\n '-webkit-transform: scale(0)}50% {-webkit-transform: scale(1.2)}90% ' +\r\n '{-webkit-transform: scale(0.95)}to {-webkit-transform: scale(1)}}';\r\n\r\n stylesheet.textContent = css;\r\n document.getElementsByTagName('head')[0].appendChild(stylesheet);\r\n};\r\n\r\n\r\n/**\r\n * Sets the background class name\r\n *\r\n * @param {string} className The class name to set.\r\n */\r\nInfoBubble.prototype.setBackgroundClassName = function (className) {\r\n this.set('backgroundClassName', className);\r\n};\r\nInfoBubble.prototype['setBackgroundClassName'] = InfoBubble.prototype.setBackgroundClassName;\r\n\r\n\r\n/**\r\n * changed MVC callback\r\n */\r\nInfoBubble.prototype.backgroundClassName_changed = function () {\r\n this.content_.className = this.get('backgroundClassName');\r\n};\r\nInfoBubble.prototype['backgroundClassName_changed'] = InfoBubble.prototype.backgroundClassName_changed;\r\n\r\n\r\n/**\r\n * Sets the class of the tab\r\n *\r\n * @param {string} className the class name to set.\r\n */\r\nInfoBubble.prototype.setTabClassName = function (className) {\r\n this.set('tabClassName', className);\r\n};\r\nInfoBubble.prototype['setTabClassName'] = InfoBubble.prototype.setTabClassName;\r\n\r\n\r\n/**\r\n * tabClassName changed MVC callback\r\n */\r\nInfoBubble.prototype.tabClassName_changed = function () {\r\n this.updateTabStyles_();\r\n};\r\nInfoBubble.prototype['tabClassName_changed'] = InfoBubble.prototype.tabClassName_changed;\r\n\r\n\r\n/**\r\n * Gets the style of the arrow\r\n *\r\n * @private\r\n * @return {number} The style of the arrow.\r\n */\r\nInfoBubble.prototype.getArrowStyle_ = function () {\r\n return parseInt(this.get('arrowStyle'), 10) || 0;\r\n};\r\n\r\n\r\n/**\r\n * Sets the style of the arrow\r\n *\r\n * @param {number} style The style of the arrow.\r\n */\r\nInfoBubble.prototype.setArrowStyle = function (style) {\r\n this.set('arrowStyle', style);\r\n};\r\nInfoBubble.prototype['setArrowStyle'] = InfoBubble.prototype.setArrowStyle;\r\n\r\n\r\n/**\r\n * Arrow style changed MVC callback\r\n */\r\nInfoBubble.prototype.arrowStyle_changed = function () {\r\n this.arrowSize_changed();\r\n};\r\nInfoBubble.prototype['arrowStyle_changed'] = InfoBubble.prototype.arrowStyle_changed;\r\n\r\n\r\n/**\r\n * Gets the size of the arrow\r\n *\r\n * @private\r\n * @return {number} The size of the arrow.\r\n */\r\nInfoBubble.prototype.getArrowSize_ = function () {\r\n return parseInt(this.get('arrowSize'), 10) || 0;\r\n};\r\n\r\n\r\n/**\r\n * Sets the size of the arrow\r\n *\r\n * @param {number} size The size of the arrow.\r\n */\r\nInfoBubble.prototype.setArrowSize = function (size) {\r\n this.set('arrowSize', size);\r\n};\r\nInfoBubble.prototype['setArrowSize'] = InfoBubble.prototype.setArrowSize;\r\n\r\n\r\n/**\r\n * Arrow size changed MVC callback\r\n */\r\nInfoBubble.prototype.arrowSize_changed = function () {\r\n this.borderWidth_changed();\r\n};\r\nInfoBubble.prototype['arrowSize_changed'] = InfoBubble.prototype.arrowSize_changed;\r\n\r\n\r\n/**\r\n * Set the position of the InfoBubble arrow\r\n *\r\n * @param {number} pos The position to set.\r\n */\r\nInfoBubble.prototype.setArrowPosition = function (pos) {\r\n this.set('arrowPosition', pos);\r\n};\r\nInfoBubble.prototype['setArrowPosition'] = InfoBubble.prototype.setArrowPosition;\r\n\r\n\r\n/**\r\n * Get the position of the InfoBubble arrow\r\n *\r\n * @private\r\n * @return {number} The position..\r\n */\r\nInfoBubble.prototype.getArrowPosition_ = function () {\r\n return parseInt(this.get('arrowPosition'), 10) || 0;\r\n};\r\n\r\n\r\n/**\r\n * arrowPosition changed MVC callback\r\n */\r\nInfoBubble.prototype.arrowPosition_changed = function () {\r\n var pos = this.getArrowPosition_();\r\n this.arrowOuter_.style['left'] = this.arrowInner_.style['left'] = pos + '%';\r\n\r\n this.redraw_();\r\n};\r\nInfoBubble.prototype['arrowPosition_changed'] = InfoBubble.prototype.arrowPosition_changed;\r\n\r\n\r\n/**\r\n * Set the zIndex of the InfoBubble\r\n *\r\n * @param {number} zIndex The zIndex to set.\r\n */\r\nInfoBubble.prototype.setZIndex = function (zIndex) {\r\n this.set('zIndex', zIndex);\r\n};\r\nInfoBubble.prototype['setZIndex'] = InfoBubble.prototype.setZIndex;\r\n\r\n\r\n/**\r\n * Get the zIndex of the InfoBubble\r\n *\r\n * @return {number} The zIndex to set.\r\n */\r\nInfoBubble.prototype.getZIndex = function () {\r\n return parseInt(this.get('zIndex'), 10) || this.baseZIndex_;\r\n};\r\n\r\n\r\n/**\r\n * zIndex changed MVC callback\r\n */\r\nInfoBubble.prototype.zIndex_changed = function () {\r\n var zIndex = this.getZIndex();\r\n\r\n this.bubble_.style['zIndex'] = this.baseZIndex_ = zIndex;\r\n this.close_.style['zIndex'] = zIndex + 1;\r\n};\r\nInfoBubble.prototype['zIndex_changed'] = InfoBubble.prototype.zIndex_changed;\r\n\r\n\r\n/**\r\n * Set the style of the shadow\r\n *\r\n * @param {number} shadowStyle The style of the shadow.\r\n */\r\nInfoBubble.prototype.setShadowStyle = function (shadowStyle) {\r\n this.set('shadowStyle', shadowStyle);\r\n};\r\nInfoBubble.prototype['setShadowStyle'] = InfoBubble.prototype.setShadowStyle;\r\n\r\n\r\n/**\r\n * Get the style of the shadow\r\n *\r\n * @private\r\n * @return {number} The style of the shadow.\r\n */\r\nInfoBubble.prototype.getShadowStyle_ = function () {\r\n return parseInt(this.get('shadowStyle'), 10) || 0;\r\n};\r\n\r\n\r\n/**\r\n * shadowStyle changed MVC callback\r\n */\r\nInfoBubble.prototype.shadowStyle_changed = function () {\r\n var shadowStyle = this.getShadowStyle_();\r\n\r\n var display = '';\r\n var shadow = '';\r\n var backgroundColor = '';\r\n switch (shadowStyle) {\r\n case 0:\r\n display = 'none';\r\n break;\r\n case 1:\r\n shadow = '40px 15px 10px rgba(33,33,33,0.3)';\r\n backgroundColor = 'transparent';\r\n break;\r\n case 2:\r\n shadow = '0 0 2px rgba(33,33,33,0.3)';\r\n backgroundColor = 'rgba(33,33,33,0.35)';\r\n break;\r\n }\r\n this.bubbleShadow_.style['boxShadow'] =\r\n this.bubbleShadow_.style['webkitBoxShadow'] =\r\n this.bubbleShadow_.style['MozBoxShadow'] = shadow;\r\n this.bubbleShadow_.style['backgroundColor'] = backgroundColor;\r\n if (this.isOpen_) {\r\n this.bubbleShadow_.style['display'] = display;\r\n this.draw();\r\n }\r\n};\r\nInfoBubble.prototype['shadowStyle_changed'] = InfoBubble.prototype.shadowStyle_changed;\r\n\r\n\r\n/**\r\n * Show the close button\r\n */\r\nInfoBubble.prototype.showCloseButton = function () {\r\n this.set('hideCloseButton', false);\r\n};\r\nInfoBubble.prototype['showCloseButton'] = InfoBubble.prototype.showCloseButton;\r\n\r\n\r\n/**\r\n * Hide the close button\r\n */\r\nInfoBubble.prototype.hideCloseButton = function () {\r\n this.set('hideCloseButton', true);\r\n};\r\nInfoBubble.prototype['hideCloseButton'] = InfoBubble.prototype.hideCloseButton;\r\n\r\n\r\n/**\r\n * hideCloseButton changed MVC callback\r\n */\r\nInfoBubble.prototype.hideCloseButton_changed = function () {\r\n this.close_.style['display'] = this.get('hideCloseButton') ? 'none' : '';\r\n};\r\nInfoBubble.prototype['hideCloseButton_changed'] = InfoBubble.prototype.hideCloseButton_changed;\r\n\r\n\r\n/**\r\n * Set the background color\r\n *\r\n * @param {string} color The color to set.\r\n */\r\nInfoBubble.prototype.setBackgroundColor = function (color) {\r\n if (color) {\r\n this.set('backgroundColor', color);\r\n }\r\n};\r\nInfoBubble.prototype['setBackgroundColor'] = InfoBubble.prototype.setBackgroundColor;\r\n\r\n\r\n/**\r\n * backgroundColor changed MVC callback\r\n */\r\nInfoBubble.prototype.backgroundColor_changed = function () {\r\n var backgroundColor = this.get('backgroundColor');\r\n this.contentContainer_.style['backgroundColor'] = backgroundColor;\r\n\r\n this.arrowInner_.style['borderColor'] = backgroundColor +\r\n ' transparent transparent';\r\n this.updateTabStyles_();\r\n};\r\nInfoBubble.prototype['backgroundColor_changed'] = InfoBubble.prototype.backgroundColor_changed;\r\n\r\n\r\n/**\r\n * Set the border color\r\n *\r\n * @param {string} color The border color.\r\n */\r\nInfoBubble.prototype.setBorderColor = function (color) {\r\n if (color) {\r\n this.set('borderColor', color);\r\n }\r\n};\r\nInfoBubble.prototype['setBorderColor'] = InfoBubble.prototype.setBorderColor;\r\n\r\n\r\n/**\r\n * borderColor changed MVC callback\r\n */\r\nInfoBubble.prototype.borderColor_changed = function () {\r\n var borderColor = this.get('borderColor');\r\n\r\n var contentContainer = this.contentContainer_;\r\n var arrowOuter = this.arrowOuter_;\r\n contentContainer.style['borderColor'] = borderColor;\r\n\r\n arrowOuter.style['borderColor'] = borderColor +\r\n ' transparent transparent';\r\n\r\n contentContainer.style['borderStyle'] =\r\n arrowOuter.style['borderStyle'] =\r\n this.arrowInner_.style['borderStyle'] = 'solid';\r\n\r\n this.updateTabStyles_();\r\n};\r\nInfoBubble.prototype['borderColor_changed'] = InfoBubble.prototype.borderColor_changed;\r\n\r\n\r\n/**\r\n * Set the radius of the border\r\n *\r\n * @param {number} radius The radius of the border.\r\n */\r\nInfoBubble.prototype.setBorderRadius = function (radius) {\r\n this.set('borderRadius', radius);\r\n};\r\nInfoBubble.prototype['setBorderRadius'] = InfoBubble.prototype.setBorderRadius;\r\n\r\n\r\n/**\r\n * Get the radius of the border\r\n *\r\n * @private\r\n * @return {number} The radius of the border.\r\n */\r\nInfoBubble.prototype.getBorderRadius_ = function () {\r\n return parseInt(this.get('borderRadius'), 10) || 0;\r\n};\r\n\r\n\r\n/**\r\n * borderRadius changed MVC callback\r\n */\r\nInfoBubble.prototype.borderRadius_changed = function () {\r\n var borderRadius = this.getBorderRadius_();\r\n var borderWidth = this.getBorderWidth_();\r\n\r\n this.contentContainer_.style['borderRadius'] =\r\n this.contentContainer_.style['MozBorderRadius'] =\r\n this.contentContainer_.style['webkitBorderRadius'] =\r\n this.bubbleShadow_.style['borderRadius'] =\r\n this.bubbleShadow_.style['MozBorderRadius'] =\r\n this.bubbleShadow_.style['webkitBorderRadius'] = this.px(borderRadius);\r\n\r\n this.tabsContainer_.style['paddingLeft'] =\r\n this.tabsContainer_.style['paddingRight'] =\r\n this.px(borderRadius + borderWidth);\r\n\r\n this.redraw_();\r\n};\r\nInfoBubble.prototype['borderRadius_changed'] = InfoBubble.prototype.borderRadius_changed;\r\n\r\n\r\n/**\r\n * Get the width of the border\r\n *\r\n * @private\r\n * @return {number} width The width of the border.\r\n */\r\nInfoBubble.prototype.getBorderWidth_ = function () {\r\n return parseInt(this.get('borderWidth'), 10) || 0;\r\n};\r\n\r\n\r\n/**\r\n * Set the width of the border\r\n *\r\n * @param {number} width The width of the border.\r\n */\r\nInfoBubble.prototype.setBorderWidth = function (width) {\r\n this.set('borderWidth', width);\r\n};\r\nInfoBubble.prototype['setBorderWidth'] = InfoBubble.prototype.setBorderWidth;\r\n\r\n\r\n/**\r\n * borderWidth change MVC callback\r\n */\r\nInfoBubble.prototype.borderWidth_changed = function () {\r\n var borderWidth = this.getBorderWidth_();\r\n\r\n this.contentContainer_.style['borderWidth'] = this.px(borderWidth);\r\n this.tabsContainer_.style['top'] = this.px(borderWidth);\r\n\r\n this.updateArrowStyle_();\r\n this.updateTabStyles_();\r\n this.borderRadius_changed();\r\n this.redraw_();\r\n};\r\nInfoBubble.prototype['borderWidth_changed'] = InfoBubble.prototype.borderWidth_changed;\r\n\r\n\r\n/**\r\n * Update the arrow style\r\n * @private\r\n */\r\nInfoBubble.prototype.updateArrowStyle_ = function () {\r\n var borderWidth = this.getBorderWidth_();\r\n var arrowSize = this.getArrowSize_();\r\n var arrowStyle = this.getArrowStyle_();\r\n var arrowOuterSizePx = this.px(arrowSize);\r\n var arrowInnerSizePx = this.px(Math.max(0, arrowSize - borderWidth));\r\n\r\n var outer = this.arrowOuter_;\r\n var inner = this.arrowInner_;\r\n\r\n this.arrow_.style['marginTop'] = this.px(-borderWidth);\r\n outer.style['borderTopWidth'] = arrowOuterSizePx;\r\n inner.style['borderTopWidth'] = arrowInnerSizePx;\r\n\r\n // Full arrow or arrow pointing to the left\r\n if (arrowStyle == 0 || arrowStyle == 1) {\r\n outer.style['borderLeftWidth'] = arrowOuterSizePx;\r\n inner.style['borderLeftWidth'] = arrowInnerSizePx;\r\n } else {\r\n outer.style['borderLeftWidth'] = inner.style['borderLeftWidth'] = 0;\r\n }\r\n\r\n // Full arrow or arrow pointing to the right\r\n if (arrowStyle == 0 || arrowStyle == 2) {\r\n outer.style['borderRightWidth'] = arrowOuterSizePx;\r\n inner.style['borderRightWidth'] = arrowInnerSizePx;\r\n } else {\r\n outer.style['borderRightWidth'] = inner.style['borderRightWidth'] = 0;\r\n }\r\n\r\n if (arrowStyle < 2) {\r\n outer.style['marginLeft'] = this.px(-(arrowSize));\r\n inner.style['marginLeft'] = this.px(-(arrowSize - borderWidth));\r\n } else {\r\n outer.style['marginLeft'] = inner.style['marginLeft'] = 0;\r\n }\r\n\r\n // If there is no border then don't show thw outer arrow\r\n if (borderWidth == 0) {\r\n outer.style['display'] = 'none';\r\n } else {\r\n outer.style['display'] = '';\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Set the padding of the InfoBubble\r\n *\r\n * @param {number} padding The padding to apply.\r\n */\r\nInfoBubble.prototype.setPadding = function (padding) {\r\n this.set('padding', padding);\r\n};\r\nInfoBubble.prototype['setPadding'] = InfoBubble.prototype.setPadding;\r\n\r\n\r\n/**\r\n * Set the close image url\r\n *\r\n * @param {string} src The url of the image used as a close icon\r\n */\r\nInfoBubble.prototype.setCloseSrc = function (src) {\r\n if (src && this.close_) {\r\n this.close_.src = src;\r\n }\r\n};\r\nInfoBubble.prototype['setCloseSrc'] = InfoBubble.prototype.setCloseSrc;\r\n\r\n\r\n/**\r\n * Set the padding of the InfoBubble\r\n *\r\n * @private\r\n * @return {number} padding The padding to apply.\r\n */\r\nInfoBubble.prototype.getPadding_ = function () {\r\n return parseInt(this.get('padding'), 10) || 0;\r\n};\r\n\r\n\r\n/**\r\n * padding changed MVC callback\r\n */\r\nInfoBubble.prototype.padding_changed = function () {\r\n var padding = this.getPadding_();\r\n this.contentContainer_.style['padding'] = this.px(padding);\r\n this.updateTabStyles_();\r\n\r\n this.redraw_();\r\n};\r\nInfoBubble.prototype['padding_changed'] = InfoBubble.prototype.padding_changed;\r\n\r\n\r\n/**\r\n * Add px extention to the number\r\n *\r\n * @param {number} num The number to wrap.\r\n * @return {string|number} A wrapped number.\r\n */\r\nInfoBubble.prototype.px = function (num) {\r\n if (num) {\r\n // 0 doesn't need to be wrapped\r\n return num + 'px';\r\n }\r\n return num;\r\n};\r\n\r\n\r\n/**\r\n * Add events to stop propagation\r\n * @private\r\n */\r\nInfoBubble.prototype.addEvents_ = function () {\r\n // We want to cancel all the events so they do not go to the map\r\n var events = ['mousedown', 'mousemove', 'mouseover', 'mouseout', 'mouseup',\r\n 'mousewheel', 'DOMMouseScroll', 'touchstart', 'touchend', 'touchmove',\r\n 'dblclick', 'contextmenu', 'click'];\r\n\r\n var bubble = this.bubble_;\r\n this.listeners_ = [];\r\n for (var i = 0, event; event = events[i]; i++) {\r\n this.listeners_.push(\r\n google.maps.event.addDomListener(bubble, event, function (e) {\r\n e.cancelBubble = true;\r\n if (e.stopPropagation) {\r\n e.stopPropagation();\r\n }\r\n })\r\n );\r\n }\r\n};\r\n\r\n\r\n/**\r\n * On Adding the InfoBubble to a map\r\n * Implementing the OverlayView interface\r\n */\r\nInfoBubble.prototype.onAdd = function () {\r\n if (!this.bubble_) {\r\n this.buildDom_();\r\n }\r\n\r\n this.addEvents_();\r\n\r\n var panes = this.getPanes();\r\n if (panes) {\r\n panes.floatPane.appendChild(this.bubble_);\r\n panes.floatShadow.appendChild(this.bubbleShadow_);\r\n }\r\n\r\n /* once the infoBubble has been added to the DOM, fire 'domready' event */\r\n google.maps.event.trigger(this, 'domready');\r\n};\r\nInfoBubble.prototype['onAdd'] = InfoBubble.prototype.onAdd;\r\n\r\n\r\n/**\r\n * Draw the InfoBubble\r\n * Implementing the OverlayView interface\r\n */\r\nInfoBubble.prototype.draw = function () {\r\n var projection = this.getProjection();\r\n\r\n if (!projection) {\r\n // The map projection is not ready yet so do nothing\r\n return;\r\n }\r\n\r\n var latLng = /** @type {google.maps.LatLng} */ (this.get('position'));\r\n\r\n if (!latLng) {\r\n this.close();\r\n return;\r\n }\r\n\r\n var tabHeight = 0;\r\n\r\n if (this.activeTab_) {\r\n tabHeight = this.activeTab_.offsetHeight;\r\n }\r\n\r\n var anchorHeight = this.getAnchorHeight_();\r\n var arrowSize = this.getArrowSize_();\r\n var arrowPosition = this.getArrowPosition_();\r\n\r\n arrowPosition = arrowPosition / 100;\r\n\r\n var pos = projection.fromLatLngToDivPixel(latLng);\r\n var width = this.contentContainer_.offsetWidth;\r\n var height = this.bubble_.offsetHeight;\r\n\r\n if (!width) {\r\n return;\r\n }\r\n\r\n // Adjust for the height of the info bubble\r\n var top = pos.y - (height + arrowSize);\r\n\r\n if (anchorHeight) {\r\n // If there is an anchor then include the height\r\n top -= anchorHeight;\r\n }\r\n\r\n var left = pos.x - (width * arrowPosition);\r\n\r\n this.bubble_.style['top'] = this.px(top);\r\n this.bubble_.style['left'] = this.px(left);\r\n\r\n var shadowStyle = parseInt(this.get('shadowStyle'), 10);\r\n\r\n switch (shadowStyle) {\r\n case 1:\r\n // Shadow is behind\r\n this.bubbleShadow_.style['top'] = this.px(top + tabHeight - 1);\r\n this.bubbleShadow_.style['left'] = this.px(left);\r\n this.bubbleShadow_.style['width'] = this.px(width);\r\n this.bubbleShadow_.style['height'] =\r\n this.px(this.contentContainer_.offsetHeight - arrowSize);\r\n break;\r\n case 2:\r\n // Shadow is below\r\n width = width * 0.8;\r\n if (anchorHeight) {\r\n this.bubbleShadow_.style['top'] = this.px(pos.y);\r\n } else {\r\n this.bubbleShadow_.style['top'] = this.px(pos.y + arrowSize);\r\n }\r\n this.bubbleShadow_.style['left'] = this.px(pos.x - width * arrowPosition);\r\n\r\n this.bubbleShadow_.style['width'] = this.px(width);\r\n this.bubbleShadow_.style['height'] = this.px(2);\r\n break;\r\n }\r\n};\r\nInfoBubble.prototype['draw'] = InfoBubble.prototype.draw;\r\n\r\n\r\n/**\r\n * Removing the InfoBubble from a map\r\n */\r\nInfoBubble.prototype.onRemove = function () {\r\n if (this.bubble_ && this.bubble_.parentNode) {\r\n this.bubble_.parentNode.removeChild(this.bubble_);\r\n }\r\n if (this.bubbleShadow_ && this.bubbleShadow_.parentNode) {\r\n this.bubbleShadow_.parentNode.removeChild(this.bubbleShadow_);\r\n }\r\n\r\n for (var i = 0, listener; listener = this.listeners_[i]; i++) {\r\n google.maps.event.removeListener(listener);\r\n }\r\n};\r\nInfoBubble.prototype['onRemove'] = InfoBubble.prototype.onRemove;\r\n\r\n\r\n/**\r\n * Is the InfoBubble open\r\n *\r\n * @return {boolean} If the InfoBubble is open.\r\n */\r\nInfoBubble.prototype.isOpen = function () {\r\n return this.isOpen_;\r\n};\r\nInfoBubble.prototype['isOpen'] = InfoBubble.prototype.isOpen;\r\n\r\n\r\n/**\r\n * Close the InfoBubble\r\n */\r\nInfoBubble.prototype.close = function () {\r\n if (this.bubble_) {\r\n this.bubble_.style['display'] = 'none';\r\n // Remove the animation so we next time it opens it will animate again\r\n this.bubble_.className =\r\n this.bubble_.className.replace(this.animationName_, '');\r\n }\r\n\r\n if (this.bubbleShadow_) {\r\n this.bubbleShadow_.style['display'] = 'none';\r\n this.bubbleShadow_.className =\r\n this.bubbleShadow_.className.replace(this.animationName_, '');\r\n }\r\n this.isOpen_ = false;\r\n};\r\nInfoBubble.prototype['close'] = InfoBubble.prototype.close;\r\n\r\n\r\n/**\r\n * Open the InfoBubble (asynchronous).\r\n *\r\n * @param {google.maps.Map=} opt_map Optional map to open on.\r\n * @param {google.maps.MVCObject=} opt_anchor Optional anchor to position at.\r\n */\r\nInfoBubble.prototype.open = function (opt_map, opt_anchor) {\r\n var that = this;\r\n window.setTimeout(function () {\r\n that.open_(opt_map, opt_anchor);\r\n }, 0);\r\n};\r\n\r\n\r\n/**\r\n * Open the InfoBubble\r\n * @private\r\n * @param {google.maps.Map=} opt_map Optional map to open on.\r\n * @param {google.maps.MVCObject=} opt_anchor Optional anchor to position at.\r\n */\r\nInfoBubble.prototype.open_ = function (opt_map, opt_anchor) {\r\n this.updateContent_();\r\n\r\n if (opt_map) {\r\n this.setMap(opt_map);\r\n }\r\n\r\n if (opt_anchor) {\r\n this.set('anchor', opt_anchor);\r\n this.bindTo('anchorPoint', opt_anchor);\r\n this.bindTo('position', opt_anchor);\r\n }\r\n\r\n // Show the bubble and the show\r\n this.bubble_.style['display'] = this.bubbleShadow_.style['display'] = '';\r\n var animation = !this.get('disableAnimation');\r\n\r\n if (animation) {\r\n // Add the animation\r\n this.bubble_.className += ' ' + this.animationName_;\r\n this.bubbleShadow_.className += ' ' + this.animationName_;\r\n }\r\n\r\n this.redraw_();\r\n this.isOpen_ = true;\r\n\r\n var pan = !this.get('disableAutoPan');\r\n if (pan) {\r\n var that = this;\r\n window.setTimeout(function () {\r\n // Pan into view, done in a time out to make it feel nicer :)\r\n that.panToView();\r\n }, 200);\r\n }\r\n};\r\nInfoBubble.prototype['open'] = InfoBubble.prototype.open;\r\n\r\n\r\n/**\r\n * Set the position of the InfoBubble\r\n *\r\n * @param {google.maps.LatLng} position The position to set.\r\n */\r\nInfoBubble.prototype.setPosition = function (position) {\r\n if (position) {\r\n this.set('position', position);\r\n }\r\n};\r\nInfoBubble.prototype['setPosition'] = InfoBubble.prototype.setPosition;\r\n\r\n\r\n/**\r\n * Returns the position of the InfoBubble\r\n *\r\n * @return {google.maps.LatLng} the position.\r\n */\r\nInfoBubble.prototype.getPosition = function () {\r\n return /** @type {google.maps.LatLng} */ (this.get('position'));\r\n};\r\nInfoBubble.prototype['getPosition'] = InfoBubble.prototype.getPosition;\r\n\r\n\r\n/**\r\n * position changed MVC callback\r\n */\r\nInfoBubble.prototype.position_changed = function () {\r\n this.draw();\r\n};\r\nInfoBubble.prototype['position_changed'] = InfoBubble.prototype.position_changed;\r\n\r\n\r\n/**\r\n * Pan the InfoBubble into view\r\n */\r\nInfoBubble.prototype.panToView = function () {\r\n var projection = this.getProjection();\r\n\r\n if (!projection) {\r\n // The map projection is not ready yet so do nothing\r\n return;\r\n }\r\n\r\n if (!this.bubble_) {\r\n // No Bubble yet so do nothing\r\n return;\r\n }\r\n\r\n var anchorHeight = this.getAnchorHeight_();\r\n var height = this.bubble_.offsetHeight + anchorHeight;\r\n var map = this.get('map');\r\n var mapDiv = map.getDiv();\r\n var mapHeight = mapDiv.offsetHeight;\r\n\r\n var latLng = this.getPosition();\r\n var centerPos = projection.fromLatLngToContainerPixel(map.getCenter());\r\n var pos = projection.fromLatLngToContainerPixel(latLng);\r\n\r\n // Find out how much space at the top is free\r\n var spaceTop = centerPos.y - height;\r\n\r\n // Fine out how much space at the bottom is free\r\n var spaceBottom = mapHeight - centerPos.y;\r\n\r\n var needsTop = spaceTop < 0;\r\n var deltaY = 0;\r\n\r\n if (needsTop) {\r\n spaceTop *= -1;\r\n deltaY = (spaceTop + spaceBottom) / 2;\r\n }\r\n\r\n pos.y -= deltaY;\r\n latLng = projection.fromContainerPixelToLatLng(pos);\r\n\r\n if (map.getCenter() != latLng) {\r\n map.panTo(latLng);\r\n }\r\n};\r\nInfoBubble.prototype['panToView'] = InfoBubble.prototype.panToView;\r\n\r\n\r\n/**\r\n * Converts a HTML string to a document fragment.\r\n *\r\n * @param {string} htmlString The HTML string to convert.\r\n * @return {Node} A HTML document fragment.\r\n * @private\r\n */\r\nInfoBubble.prototype.htmlToDocumentFragment_ = function (htmlString) {\r\n htmlString = htmlString.replace(/^\\s*([\\S\\s]*)\\b\\s*$/, '$1');\r\n var tempDiv = document.createElement('DIV');\r\n tempDiv.innerHTML = htmlString;\r\n if (tempDiv.childNodes.length == 1) {\r\n return /** @type {!Node} */ (tempDiv.removeChild(tempDiv.firstChild));\r\n } else {\r\n var fragment = document.createDocumentFragment();\r\n while (tempDiv.firstChild) {\r\n fragment.appendChild(tempDiv.firstChild);\r\n }\r\n return fragment;\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Removes all children from the node.\r\n *\r\n * @param {Node} node The node to remove all children from.\r\n * @private\r\n */\r\nInfoBubble.prototype.removeChildren_ = function (node) {\r\n if (!node) {\r\n return;\r\n }\r\n\r\n var child;\r\n while (child = node.firstChild) {\r\n node.removeChild(child);\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Sets the content of the infobubble.\r\n *\r\n * @param {string|Node} content The content to set.\r\n */\r\nInfoBubble.prototype.setContent = function (content) {\r\n this.set('content', content);\r\n};\r\nInfoBubble.prototype['setContent'] = InfoBubble.prototype.setContent;\r\n\r\n\r\n/**\r\n * Get the content of the infobubble.\r\n *\r\n * @return {string|Node} The marker content.\r\n */\r\nInfoBubble.prototype.getContent = function () {\r\n return /** @type {Node|string} */ (this.get('content'));\r\n};\r\nInfoBubble.prototype['getContent'] = InfoBubble.prototype.getContent;\r\n\r\n\r\n/**\r\n * Sets the marker content and adds loading events to images\r\n */\r\nInfoBubble.prototype.updateContent_ = function () {\r\n if (!this.content_) {\r\n // The Content area doesnt exist.\r\n return;\r\n }\r\n\r\n this.removeChildren_(this.content_);\r\n var content = this.getContent();\r\n if (content) {\r\n if (typeof content == 'string') {\r\n content = this.htmlToDocumentFragment_(content);\r\n }\r\n this.content_.appendChild(content);\r\n\r\n var that = this;\r\n var images = this.content_.getElementsByTagName('IMG');\r\n for (var i = 0, image; image = images[i]; i++) {\r\n // Because we don't know the size of an image till it loads, add a\r\n // listener to the image load so the marker can resize and reposition\r\n // itself to be the correct height.\r\n google.maps.event.addDomListener(image, 'load', function () {\r\n that.imageLoaded_();\r\n });\r\n }\r\n }\r\n this.redraw_();\r\n};\r\n\r\n\r\n/**\r\n * Image loaded\r\n * @private\r\n */\r\nInfoBubble.prototype.imageLoaded_ = function () {\r\n var pan = !this.get('disableAutoPan');\r\n this.redraw_();\r\n if (pan && (this.tabs_.length == 0 || this.activeTab_.index == 0)) {\r\n this.panToView();\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Updates the styles of the tabs\r\n * @private\r\n */\r\nInfoBubble.prototype.updateTabStyles_ = function () {\r\n if (this.tabs_ && this.tabs_.length) {\r\n for (var i = 0, tab; tab = this.tabs_[i]; i++) {\r\n this.setTabStyle_(tab.tab);\r\n }\r\n this.activeTab_.style['zIndex'] = this.baseZIndex_;\r\n var borderWidth = this.getBorderWidth_();\r\n var padding = this.getPadding_() / 2;\r\n this.activeTab_.style['borderBottomWidth'] = 0;\r\n this.activeTab_.style['paddingBottom'] = this.px(padding + borderWidth);\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Sets the style of a tab\r\n * @private\r\n * @param {Element} tab The tab to style.\r\n */\r\nInfoBubble.prototype.setTabStyle_ = function (tab) {\r\n var backgroundColor = this.get('backgroundColor');\r\n var borderColor = this.get('borderColor');\r\n var borderRadius = this.getBorderRadius_();\r\n var borderWidth = this.getBorderWidth_();\r\n var padding = this.getPadding_();\r\n\r\n var marginRight = this.px(-(Math.max(padding, borderRadius)));\r\n var borderRadiusPx = this.px(borderRadius);\r\n\r\n var index = this.baseZIndex_;\r\n if (tab.index) {\r\n index -= tab.index;\r\n }\r\n\r\n // The styles for the tab\r\n var styles = {\r\n 'cssFloat': 'left',\r\n 'position': 'relative',\r\n 'cursor': 'pointer',\r\n 'backgroundColor': backgroundColor,\r\n 'border': this.px(borderWidth) + ' solid ' + borderColor,\r\n 'padding': this.px(padding / 2) + ' ' + this.px(padding),\r\n 'marginRight': marginRight,\r\n 'whiteSpace': 'nowrap',\r\n 'borderRadiusTopLeft': borderRadiusPx,\r\n 'MozBorderRadiusTopleft': borderRadiusPx,\r\n 'webkitBorderTopLeftRadius': borderRadiusPx,\r\n 'borderRadiusTopRight': borderRadiusPx,\r\n 'MozBorderRadiusTopright': borderRadiusPx,\r\n 'webkitBorderTopRightRadius': borderRadiusPx,\r\n 'zIndex': index,\r\n 'display': 'inline'\r\n };\r\n\r\n for (var style in styles) {\r\n tab.style[style] = styles[style];\r\n }\r\n\r\n var className = this.get('tabClassName');\r\n if (className != undefined) {\r\n tab.className += ' ' + className;\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Add user actions to a tab\r\n * @private\r\n * @param {Object} tab The tab to add the actions to.\r\n */\r\nInfoBubble.prototype.addTabActions_ = function (tab) {\r\n var that = this;\r\n tab.listener_ = google.maps.event.addDomListener(tab, 'click', function () {\r\n that.setTabActive_(this);\r\n });\r\n};\r\n\r\n\r\n/**\r\n * Set a tab at a index to be active\r\n *\r\n * @param {number} index The index of the tab.\r\n */\r\nInfoBubble.prototype.setTabActive = function (index) {\r\n var tab = this.tabs_[index - 1];\r\n\r\n if (tab) {\r\n this.setTabActive_(tab.tab);\r\n }\r\n};\r\nInfoBubble.prototype['setTabActive'] = InfoBubble.prototype.setTabActive;\r\n\r\n\r\n/**\r\n * Set a tab to be active\r\n * @private\r\n * @param {Object} tab The tab to set active.\r\n */\r\nInfoBubble.prototype.setTabActive_ = function (tab) {\r\n if (!tab) {\r\n this.setContent('');\r\n this.updateContent_();\r\n return;\r\n }\r\n\r\n var padding = this.getPadding_() / 2;\r\n var borderWidth = this.getBorderWidth_();\r\n\r\n if (this.activeTab_) {\r\n var activeTab = this.activeTab_;\r\n activeTab.style['zIndex'] = this.baseZIndex_ - activeTab.index;\r\n activeTab.style['paddingBottom'] = this.px(padding);\r\n activeTab.style['borderBottomWidth'] = this.px(borderWidth);\r\n }\r\n\r\n tab.style['zIndex'] = this.baseZIndex_;\r\n tab.style['borderBottomWidth'] = 0;\r\n tab.style['marginBottomWidth'] = '-10px';\r\n tab.style['paddingBottom'] = this.px(padding + borderWidth);\r\n\r\n this.setContent(this.tabs_[tab.index].content);\r\n this.updateContent_();\r\n\r\n this.activeTab_ = tab;\r\n\r\n this.redraw_();\r\n};\r\n\r\n\r\n/**\r\n * Set the max width of the InfoBubble\r\n *\r\n * @param {number} width The max width.\r\n */\r\nInfoBubble.prototype.setMaxWidth = function (width) {\r\n this.set('maxWidth', width);\r\n};\r\nInfoBubble.prototype['setMaxWidth'] = InfoBubble.prototype.setMaxWidth;\r\n\r\n\r\n/**\r\n * maxWidth changed MVC callback\r\n */\r\nInfoBubble.prototype.maxWidth_changed = function () {\r\n this.redraw_();\r\n};\r\nInfoBubble.prototype['maxWidth_changed'] = InfoBubble.prototype.maxWidth_changed;\r\n\r\n\r\n/**\r\n * Set the max height of the InfoBubble\r\n *\r\n * @param {number} height The max height.\r\n */\r\nInfoBubble.prototype.setMaxHeight = function (height) {\r\n this.set('maxHeight', height);\r\n};\r\nInfoBubble.prototype['setMaxHeight'] = InfoBubble.prototype.setMaxHeight;\r\n\r\n\r\n/**\r\n * maxHeight changed MVC callback\r\n */\r\nInfoBubble.prototype.maxHeight_changed = function () {\r\n this.redraw_();\r\n};\r\nInfoBubble.prototype['maxHeight_changed'] = InfoBubble.prototype.maxHeight_changed;\r\n\r\n\r\n/**\r\n * Set the min width of the InfoBubble\r\n *\r\n * @param {number} width The min width.\r\n */\r\nInfoBubble.prototype.setMinWidth = function (width) {\r\n this.set('minWidth', width);\r\n};\r\nInfoBubble.prototype['setMinWidth'] = InfoBubble.prototype.setMinWidth;\r\n\r\n\r\n/**\r\n * minWidth changed MVC callback\r\n */\r\nInfoBubble.prototype.minWidth_changed = function () {\r\n this.redraw_();\r\n};\r\nInfoBubble.prototype['minWidth_changed'] = InfoBubble.prototype.minWidth_changed;\r\n\r\n\r\n/**\r\n * Set the min height of the InfoBubble\r\n *\r\n * @param {number} height The min height.\r\n */\r\nInfoBubble.prototype.setMinHeight = function (height) {\r\n this.set('minHeight', height);\r\n};\r\nInfoBubble.prototype['setMinHeight'] = InfoBubble.prototype.setMinHeight;\r\n\r\n\r\n/**\r\n * minHeight changed MVC callback\r\n */\r\nInfoBubble.prototype.minHeight_changed = function () {\r\n this.redraw_();\r\n};\r\nInfoBubble.prototype['minHeight_changed'] = InfoBubble.prototype.minHeight_changed;\r\n\r\n\r\n/**\r\n * Add a tab\r\n *\r\n * @param {string} label The label of the tab.\r\n * @param {string|Element} content The content of the tab.\r\n */\r\nInfoBubble.prototype.addTab = function (label, content) {\r\n var tab = document.createElement('DIV');\r\n tab.innerHTML = label;\r\n\r\n this.setTabStyle_(tab);\r\n this.addTabActions_(tab);\r\n\r\n this.tabsContainer_.appendChild(tab);\r\n\r\n this.tabs_.push({\r\n label: label,\r\n content: content,\r\n tab: tab\r\n });\r\n\r\n tab.index = this.tabs_.length - 1;\r\n tab.style['zIndex'] = this.baseZIndex_ - tab.index;\r\n\r\n if (!this.activeTab_) {\r\n this.setTabActive_(tab);\r\n }\r\n\r\n tab.className = tab.className + ' ' + this.animationName_;\r\n\r\n this.redraw_();\r\n};\r\nInfoBubble.prototype['addTab'] = InfoBubble.prototype.addTab;\r\n\r\n\r\n/**\r\n * Update a tab at a speicifc index\r\n *\r\n * @param {number} index The index of the tab.\r\n * @param {?string} opt_label The label to change to.\r\n * @param {?string} opt_content The content to update to.\r\n */\r\nInfoBubble.prototype.updateTab = function (index, opt_label, opt_content) {\r\n if (!this.tabs_.length || index < 0 || index >= this.tabs_.length) {\r\n return;\r\n }\r\n\r\n var tab = this.tabs_[index];\r\n if (opt_label != undefined) {\r\n tab.tab.innerHTML = tab.label = opt_label;\r\n }\r\n\r\n if (opt_content != undefined) {\r\n tab.content = opt_content;\r\n }\r\n\r\n if (this.activeTab_ == tab.tab) {\r\n this.setContent(tab.content);\r\n this.updateContent_();\r\n }\r\n this.redraw_();\r\n};\r\nInfoBubble.prototype['updateTab'] = InfoBubble.prototype.updateTab;\r\n\r\n\r\n/**\r\n * Remove a tab at a specific index\r\n *\r\n * @param {number} index The index of the tab to remove.\r\n */\r\nInfoBubble.prototype.removeTab = function (index) {\r\n if (!this.tabs_.length || index < 0 || index >= this.tabs_.length) {\r\n return;\r\n }\r\n\r\n var tab = this.tabs_[index];\r\n tab.tab.parentNode.removeChild(tab.tab);\r\n\r\n google.maps.event.removeListener(tab.tab.listener_);\r\n\r\n this.tabs_.splice(index, 1);\r\n\r\n tab = null;\r\n\r\n for (var i = 0, t; t = this.tabs_[i]; i++) {\r\n t.tab.index = i;\r\n }\r\n\r\n if (tab.tab == this.activeTab_) {\r\n // Removing the current active tab\r\n if (this.tabs_[index]) {\r\n // Show the tab to the right\r\n this.activeTab_ = this.tabs_[index].tab;\r\n } else if (this.tabs_[index - 1]) {\r\n // Show a tab to the left\r\n this.activeTab_ = this.tabs_[index - 1].tab;\r\n } else {\r\n // No tabs left to sho\r\n this.activeTab_ = undefined;\r\n }\r\n\r\n this.setTabActive_(this.activeTab_);\r\n }\r\n\r\n this.redraw_();\r\n};\r\nInfoBubble.prototype['removeTab'] = InfoBubble.prototype.removeTab;\r\n\r\n\r\n/**\r\n * Get the size of an element\r\n * @private\r\n * @param {Node|string} element The element to size.\r\n * @param {number=} opt_maxWidth Optional max width of the element.\r\n * @param {number=} opt_maxHeight Optional max height of the element.\r\n * @return {google.maps.Size} The size of the element.\r\n */\r\nInfoBubble.prototype.getElementSize_ = function (element, opt_maxWidth,\r\n opt_maxHeight) {\r\n var sizer = document.createElement('DIV');\r\n sizer.style['display'] = 'inline';\r\n sizer.style['position'] = 'absolute';\r\n sizer.style['visibility'] = 'hidden';\r\n\r\n if (typeof element == 'string') {\r\n sizer.innerHTML = element;\r\n } else {\r\n sizer.appendChild(element.cloneNode(true));\r\n }\r\n\r\n document.body.appendChild(sizer);\r\n var size = new google.maps.Size(sizer.offsetWidth, sizer.offsetHeight);\r\n\r\n // If the width is bigger than the max width then set the width and size again\r\n if (opt_maxWidth && size.width > opt_maxWidth) {\r\n sizer.style['width'] = this.px(opt_maxWidth);\r\n size = new google.maps.Size(sizer.offsetWidth, sizer.offsetHeight);\r\n }\r\n\r\n // If the height is bigger than the max height then set the height and size\r\n // again\r\n if (opt_maxHeight && size.height > opt_maxHeight) {\r\n sizer.style['height'] = this.px(opt_maxHeight);\r\n size = new google.maps.Size(sizer.offsetWidth, sizer.offsetHeight);\r\n }\r\n\r\n document.body.removeChild(sizer);\r\n sizer = null;\r\n return size;\r\n};\r\n\r\n\r\n/**\r\n * Redraw the InfoBubble\r\n * @private\r\n */\r\nInfoBubble.prototype.redraw_ = function () {\r\n this.figureOutSize_();\r\n this.positionCloseButton_();\r\n this.draw();\r\n};\r\n\r\n\r\n/**\r\n * Figure out the optimum size of the InfoBubble\r\n * @private\r\n */\r\nInfoBubble.prototype.figureOutSize_ = function () {\r\n var map = this.get('map');\r\n\r\n if (!map) {\r\n return;\r\n }\r\n\r\n var padding = this.getPadding_();\r\n var borderWidth = this.getBorderWidth_();\r\n var borderRadius = this.getBorderRadius_();\r\n var arrowSize = this.getArrowSize_();\r\n\r\n var mapDiv = map.getDiv();\r\n var gutter = arrowSize * 2;\r\n var mapWidth = mapDiv.offsetWidth - gutter;\r\n var mapHeight = mapDiv.offsetHeight - gutter - this.getAnchorHeight_();\r\n var tabHeight = 0;\r\n var width = /** @type {number} */ (this.get('minWidth') || 0);\r\n var height = /** @type {number} */ (this.get('minHeight') || 0);\r\n var maxWidth = /** @type {number} */ (this.get('maxWidth') || 0);\r\n var maxHeight = /** @type {number} */ (this.get('maxHeight') || 0);\r\n\r\n maxWidth = Math.min(mapWidth, maxWidth);\r\n maxHeight = Math.min(mapHeight, maxHeight);\r\n\r\n var tabWidth = 0;\r\n if (this.tabs_.length) {\r\n // If there are tabs then you need to check the size of each tab's content\r\n for (var i = 0, tab; tab = this.tabs_[i]; i++) {\r\n var tabSize = this.getElementSize_(tab.tab, maxWidth, maxHeight);\r\n var contentSize = this.getElementSize_(tab.content, maxWidth, maxHeight);\r\n\r\n if (width < tabSize.width) {\r\n width = tabSize.width;\r\n }\r\n\r\n // Add up all the tab widths because they might end up being wider than\r\n // the content\r\n tabWidth += tabSize.width;\r\n\r\n if (height < tabSize.height) {\r\n height = tabSize.height;\r\n }\r\n\r\n if (tabSize.height > tabHeight) {\r\n tabHeight = tabSize.height;\r\n }\r\n\r\n if (width < contentSize.width) {\r\n width = contentSize.width;\r\n }\r\n\r\n if (height < contentSize.height) {\r\n height = contentSize.height;\r\n }\r\n }\r\n } else {\r\n var content = /** @type {string|Node} */ (this.get('content'));\r\n if (typeof content == 'string') {\r\n content = this.htmlToDocumentFragment_(content);\r\n }\r\n if (content) {\r\n var contentSize = this.getElementSize_(content, maxWidth, maxHeight);\r\n\r\n if (width < contentSize.width) {\r\n width = contentSize.width;\r\n }\r\n\r\n if (height < contentSize.height) {\r\n height = contentSize.height;\r\n }\r\n }\r\n }\r\n\r\n if (maxWidth) {\r\n width = Math.min(width, maxWidth);\r\n }\r\n\r\n if (maxHeight) {\r\n height = Math.min(height, maxHeight);\r\n }\r\n\r\n width = Math.max(width, tabWidth);\r\n\r\n if (width == tabWidth) {\r\n width = width + 2 * padding;\r\n }\r\n\r\n arrowSize = arrowSize * 2;\r\n width = Math.max(width, arrowSize);\r\n\r\n // Maybe add this as a option so they can go bigger than the map if the user\r\n // wants\r\n if (width > mapWidth) {\r\n width = mapWidth;\r\n }\r\n\r\n if (height > mapHeight) {\r\n height = mapHeight - tabHeight;\r\n }\r\n\r\n if (this.tabsContainer_) {\r\n this.tabHeight_ = tabHeight;\r\n this.tabsContainer_.style['width'] = this.px(tabWidth);\r\n }\r\n\r\n this.contentContainer_.style['width'] = this.px(width);\r\n this.contentContainer_.style['height'] = this.px(height);\r\n};\r\n\r\n\r\n/**\r\n * Get the height of the anchor\r\n *\r\n * This function is a hack for now and doesn't really work that good, need to\r\n * wait for pixelBounds to be correctly exposed.\r\n * @private\r\n * @return {number} The height of the anchor.\r\n */\r\nInfoBubble.prototype.getAnchorHeight_ = function () {\r\n var anchor = this.get('anchor');\r\n if (anchor) {\r\n var anchorPoint = /** @type google.maps.Point */(this.get('anchorPoint'));\r\n\r\n if (anchorPoint) {\r\n return -1 * anchorPoint.y;\r\n }\r\n }\r\n return 0;\r\n};\r\n\r\nInfoBubble.prototype.anchorPoint_changed = function () {\r\n this.draw();\r\n};\r\nInfoBubble.prototype['anchorPoint_changed'] = InfoBubble.prototype.anchorPoint_changed;\r\n\r\n\r\n/**\r\n * Position the close button in the right spot.\r\n * @private\r\n */\r\nInfoBubble.prototype.positionCloseButton_ = function () {\r\n var br = this.getBorderRadius_();\r\n var bw = this.getBorderWidth_();\r\n\r\n var right = 2;\r\n var top = 2;\r\n\r\n if (this.tabs_.length && this.tabHeight_) {\r\n top += this.tabHeight_;\r\n }\r\n\r\n top += bw;\r\n right += bw;\r\n\r\n var c = this.contentContainer_;\r\n if (c && c.clientHeight < c.scrollHeight) {\r\n // If there are scrollbars then move the cross in so it is not over\r\n // scrollbar\r\n right += 15;\r\n }\r\n\r\n this.close_.style['right'] = this.px(right);\r\n this.close_.style['top'] = this.px(top);\r\n};\r\n"]}