diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 986f15f..59485b3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,6 +23,6 @@ Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. When preparing your code, make sure to update the AUTHORS and CONTRIBUTORS file -to reflect your contribtion. +to reflect your contribution. Once we receive your CLA, we'll be able to review and accept your pull requests. diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 1e9d8c5..56854c0 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -13,3 +13,4 @@ Luke Mahé Chris Broadfoot Brendan Kenny Vadim Sikora +Jiří Špác diff --git a/package.json b/package.json new file mode 100644 index 0000000..a85a102 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "scripts": { + "minify": "uglifyjs --compress --mangle -o src/infobubble.min.js -- src/infobubble.js" + } +} \ No newline at end of file diff --git a/src/infobubble-compiled.js b/src/infobubble-compiled.js deleted file mode 100755 index 2b3faa0..0000000 --- a/src/infobubble-compiled.js +++ /dev/null @@ -1,37 +0,0 @@ -(function(){var b; -function h(a){this.extend(h,google.maps.OverlayView);this.b=[];this.d=null;this.g=100;this.m=!1;a=a||{};void 0==a.backgroundColor&&(a.backgroundColor=this.A);void 0==a.borderColor&&(a.borderColor=this.B);void 0==a.borderRadius&&(a.borderRadius=this.C);void 0==a.borderWidth&&(a.borderWidth=this.D);void 0==a.padding&&(a.padding=this.H);void 0==a.arrowPosition&&(a.arrowPosition=this.u);void 0==a.disableAutoPan&&(a.disableAutoPan=!1);void 0==a.disableAnimation&&(a.disableAnimation=!1);void 0==a.minWidth&&(a.minWidth= -this.G);void 0==a.shadowStyle&&(a.shadowStyle=this.I);void 0==a.arrowSize&&(a.arrowSize=this.v);void 0==a.arrowStyle&&(a.arrowStyle=this.w);void 0==a.closeSrc&&(a.closeSrc=this.F);m(this);this.setValues(a)}window.InfoBubble=h;b=h.prototype;b.v=15;b.w=0;b.I=1;b.G=50;b.u=50;b.H=10;b.D=1;b.B="#ccc";b.C=10;b.A="#fff";b.F="https://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif";b.extend=function(a,c){return function(a){for(var c in a.prototype)this.prototype[c]=a.prototype[c];return this}.apply(a,[c])}; -function m(a){var c=a.c=document.createElement("DIV");c.style.position="absolute";c.style.zIndex=a.g;(a.i=document.createElement("DIV")).style.position="relative";var d=a.j=document.createElement("IMG");d.style.position="absolute";d.style.border=0;d.style.zIndex=a.g+1;d.style.cursor="pointer";d.src=a.get("closeSrc");google.maps.event.addDomListener(d,"click",function(){a.close();google.maps.event.trigger(a,"closeclick")});var e=a.e=document.createElement("DIV");e.style.overflowX="auto";e.style.overflowY= -"auto";e.style.cursor="default";e.style.clear="both";e.style.position="relative";var f=a.k=document.createElement("DIV");e.appendChild(f);f=a.N=document.createElement("DIV");f.style.position="relative";var k=a.n=document.createElement("DIV"),g=a.l=document.createElement("DIV"),l=n(a);k.style.position=g.style.position="absolute";k.style.left=g.style.left="50%";k.style.height=g.style.height="0";k.style.width=g.style.width="0";k.style.marginLeft=t(-l);k.style.borderWidth=t(l);k.style.borderBottomWidth= -0;l=a.a=document.createElement("DIV");l.style.position="absolute";c.style.display=l.style.display="none";c.appendChild(a.i);c.appendChild(d);c.appendChild(e);f.appendChild(k);f.appendChild(g);c.appendChild(f);c=document.createElement("style");c.setAttribute("type","text/css");a.h="_ibani_"+Math.round(1E4*Math.random());c.textContent="."+a.h+"{-webkit-animation-name:"+a.h+";-webkit-animation-duration:0.5s;-webkit-animation-iteration-count:1;}@-webkit-keyframes "+a.h+" {from {-webkit-transform: scale(0)}50% {-webkit-transform: scale(1.2)}90% {-webkit-transform: scale(0.95)}to {-webkit-transform: scale(1)}}"; -document.getElementsByTagName("head")[0].appendChild(c)}b.ea=function(a){this.set("backgroundClassName",a)};h.prototype.setBackgroundClassName=h.prototype.ea;h.prototype.O=function(){this.k.className=this.get("backgroundClassName")};h.prototype.backgroundClassName_changed=h.prototype.O;h.prototype.pa=function(a){this.set("tabClassName",a)};h.prototype.setTabClassName=h.prototype.pa;h.prototype.sa=function(){w(this)};h.prototype.tabClassName_changed=h.prototype.sa; -h.prototype.da=function(a){this.set("arrowStyle",a)};h.prototype.setArrowStyle=h.prototype.da;h.prototype.M=function(){this.p()};h.prototype.arrowStyle_changed=h.prototype.M;function n(a){return parseInt(a.get("arrowSize"),10)||0}h.prototype.ca=function(a){this.set("arrowSize",a)};h.prototype.setArrowSize=h.prototype.ca;h.prototype.p=function(){this.r()};h.prototype.arrowSize_changed=h.prototype.p;h.prototype.ba=function(a){this.set("arrowPosition",a)};h.prototype.setArrowPosition=h.prototype.ba; -h.prototype.L=function(){var a=parseInt(this.get("arrowPosition"),10)||0;this.n.style.left=this.l.style.left=a+"%";x(this)};h.prototype.arrowPosition_changed=h.prototype.L;h.prototype.setZIndex=function(a){this.set("zIndex",a)};h.prototype.setZIndex=h.prototype.setZIndex;h.prototype.getZIndex=function(){return parseInt(this.get("zIndex"),10)||this.g};h.prototype.ua=function(){var a=this.getZIndex();this.c.style.zIndex=this.g=a;this.j.style.zIndex=a+1};h.prototype.zIndex_changed=h.prototype.ua; -h.prototype.na=function(a){this.set("shadowStyle",a)};h.prototype.setShadowStyle=h.prototype.na;h.prototype.qa=function(){var a="",c="",d="";switch(parseInt(this.get("shadowStyle"),10)||0){case 0:a="none";break;case 1:c="40px 15px 10px rgba(33,33,33,0.3)";d="transparent";break;case 2:c="0 0 2px rgba(33,33,33,0.3)",d="rgba(33,33,33,0.35)"}this.a.style.boxShadow=this.a.style.webkitBoxShadow=this.a.style.MozBoxShadow=c;this.a.style.backgroundColor=d;this.m&&(this.a.style.display=a,this.draw())}; -h.prototype.shadowStyle_changed=h.prototype.qa;h.prototype.ra=function(){this.set("hideCloseButton",!1)};h.prototype.showCloseButton=h.prototype.ra;h.prototype.R=function(){this.set("hideCloseButton",!0)};h.prototype.hideCloseButton=h.prototype.R;h.prototype.S=function(){this.j.style.display=this.get("hideCloseButton")?"none":""};h.prototype.hideCloseButton_changed=h.prototype.S;h.prototype.setBackgroundColor=function(a){a&&this.set("backgroundColor",a)};h.prototype.setBackgroundColor=h.prototype.setBackgroundColor; -h.prototype.P=function(){var a=this.get("backgroundColor");this.e.style.backgroundColor=a;this.l.style.borderColor=a+" transparent transparent";w(this)};h.prototype.backgroundColor_changed=h.prototype.P;h.prototype.setBorderColor=function(a){a&&this.set("borderColor",a)};h.prototype.setBorderColor=h.prototype.setBorderColor; -h.prototype.Q=function(){var a=this.get("borderColor"),c=this.e,d=this.n;c.style.borderColor=a;d.style.borderColor=a+" transparent transparent";c.style.borderStyle=d.style.borderStyle=this.l.style.borderStyle="solid";w(this)};h.prototype.borderColor_changed=h.prototype.Q;h.prototype.fa=function(a){this.set("borderRadius",a)};h.prototype.setBorderRadius=h.prototype.fa;function z(a){return parseInt(a.get("borderRadius"),10)||0} -h.prototype.q=function(){var a=z(this),c=A(this);this.e.style.borderRadius=this.e.style.MozBorderRadius=this.e.style.webkitBorderRadius=this.a.style.borderRadius=this.a.style.MozBorderRadius=this.a.style.webkitBorderRadius=t(a);this.i.style.paddingLeft=this.i.style.paddingRight=t(a+c);x(this)};h.prototype.borderRadius_changed=h.prototype.q;function A(a){return parseInt(a.get("borderWidth"),10)||0}h.prototype.ga=function(a){this.set("borderWidth",a)};h.prototype.setBorderWidth=h.prototype.ga; -h.prototype.r=function(){var a=A(this);this.e.style.borderWidth=t(a);this.i.style.top=t(a);var a=A(this),c=n(this),d=parseInt(this.get("arrowStyle"),10)||0,e=t(c),f=t(Math.max(0,c-a)),k=this.n,g=this.l;this.N.style.marginTop=t(-a);k.style.borderTopWidth=e;g.style.borderTopWidth=f;0==d||1==d?(k.style.borderLeftWidth=e,g.style.borderLeftWidth=f):k.style.borderLeftWidth=g.style.borderLeftWidth=0;0==d||2==d?(k.style.borderRightWidth=e,g.style.borderRightWidth=f):k.style.borderRightWidth=g.style.borderRightWidth= -0;2>d?(k.style.marginLeft=t(-c),g.style.marginLeft=t(-(c-a))):k.style.marginLeft=g.style.marginLeft=0;k.style.display=0==a?"none":"";w(this);this.q();x(this)};h.prototype.borderWidth_changed=h.prototype.r;h.prototype.ma=function(a){this.set("padding",a)};h.prototype.setPadding=h.prototype.ma;h.prototype.ha=function(a){a&&this.j&&(this.j.src=a)};h.prototype.setCloseSrc=h.prototype.ha;function B(a){return parseInt(a.get("padding"),10)||0} -h.prototype.Z=function(){var a=B(this);this.e.style.padding=t(a);w(this);x(this)};h.prototype.padding_changed=h.prototype.Z;function t(a){return a?a+"px":a}function C(a){var c="mousedown mousemove mouseover mouseout mouseup mousewheel DOMMouseScroll touchstart touchend touchmove dblclick contextmenu click".split(" "),d=a.c;a.s=[];for(var e=0,f;f=c[e];e++)a.s.push(google.maps.event.addDomListener(d,f,function(a){a.cancelBubble=!0;a.stopPropagation&&a.stopPropagation()}))} -h.prototype.onAdd=function(){this.c||m(this);C(this);var a=this.getPanes();a&&(a.floatPane.appendChild(this.c),a.floatShadow.appendChild(this.a))};h.prototype.onAdd=h.prototype.onAdd; -h.prototype.draw=function(){var a=this.getProjection();if(a){var c=this.get("position");if(c){var d=0;this.d&&(d=this.d.offsetHeight);var e=D(this),f=n(this),k=parseInt(this.get("arrowPosition"),10)||0,k=k/100,a=a.fromLatLngToDivPixel(c),c=this.e.offsetWidth,g=this.c.offsetHeight;if(c){g=a.y-(g+f);e&&(g-=e);var l=a.x-c*k;this.c.style.top=t(g);this.c.style.left=t(l);switch(parseInt(this.get("shadowStyle"),10)){case 1:this.a.style.top=t(g+d-1);this.a.style.left=t(l);this.a.style.width=t(c);this.a.style.height= -t(this.e.offsetHeight-f);break;case 2:c*=.8,this.a.style.top=e?t(a.y):t(a.y+f),this.a.style.left=t(a.x-c*k),this.a.style.width=t(c),this.a.style.height=t(2)}}}else this.close()}};h.prototype.draw=h.prototype.draw;h.prototype.onRemove=function(){this.c&&this.c.parentNode&&this.c.parentNode.removeChild(this.c);this.a&&this.a.parentNode&&this.a.parentNode.removeChild(this.a);for(var a=0,c;c=this.s[a];a++)google.maps.event.removeListener(c)};h.prototype.onRemove=h.prototype.onRemove;h.prototype.T=function(){return this.m}; -h.prototype.isOpen=h.prototype.T;h.prototype.close=function(){this.c&&(this.c.style.display="none",this.c.className=this.c.className.replace(this.h,""));this.a&&(this.a.style.display="none",this.a.className=this.a.className.replace(this.h,""));this.m=!1};h.prototype.close=h.prototype.close;h.prototype.open=function(a,c){var d=this;window.setTimeout(function(){E(d,a,c)},0)}; -function E(a,c,d){F(a);c&&a.setMap(c);d&&(a.set("anchor",d),a.bindTo("anchorPoint",d),a.bindTo("position",d));a.c.style.display=a.a.style.display="";a.get("disableAnimation")||(a.c.className+=" "+a.h,a.a.className+=" "+a.h);x(a);a.m=!0;a.get("disableAutoPan")||window.setTimeout(function(){a.o()},200)}h.prototype.open=h.prototype.open;h.prototype.setPosition=function(a){a&&this.set("position",a)};h.prototype.setPosition=h.prototype.setPosition;h.prototype.getPosition=function(){return this.get("position")}; -h.prototype.getPosition=h.prototype.getPosition;h.prototype.$=function(){this.draw()};h.prototype.position_changed=h.prototype.$;h.prototype.o=function(){var a=this.getProjection();if(a&&this.c){var c=D(this),d=this.c.offsetHeight+c,c=this.get("map"),e=c.getDiv().offsetHeight,f=this.getPosition(),k=a.fromLatLngToContainerPixel(c.getCenter()),f=a.fromLatLngToContainerPixel(f),d=k.y-d,e=e-k.y,k=0;0>d&&(k=(-1*d+e)/2);f.y-=k;f=a.fromContainerPixelToLatLng(f);c.getCenter()!=f&&c.panTo(f)}}; -h.prototype.panToView=h.prototype.o;function G(a){a=a.replace(/^\s*([\S\s]*)\b\s*$/,"$1");var c=document.createElement("DIV");c.innerHTML=a;if(1==c.childNodes.length)return c.removeChild(c.firstChild);for(a=document.createDocumentFragment();c.firstChild;)a.appendChild(c.firstChild);return a}function H(a){if(a)for(var c;c=a.firstChild;)a.removeChild(c)}h.prototype.setContent=function(a){this.set("content",a)};h.prototype.setContent=h.prototype.setContent;h.prototype.getContent=function(){return this.get("content")}; -h.prototype.getContent=h.prototype.getContent;function F(a){if(a.k){H(a.k);var c=a.getContent();if(c){"string"==typeof c&&(c=G(c));a.k.appendChild(c);for(var c=a.k.getElementsByTagName("IMG"),d=0,e;e=c[d];d++)google.maps.event.addDomListener(e,"load",function(){var c=!a.get("disableAutoPan");x(a);!c||0!=a.b.length&&0!=a.d.index||a.o()});google.maps.event.trigger(a,"domready")}x(a)}} -function w(a){if(a.b&&a.b.length){for(var c=0,d;d=a.b[c];c++)I(a,d.f);a.d.style.zIndex=a.g;c=A(a);d=B(a)/2;a.d.style.borderBottomWidth=0;a.d.style.paddingBottom=t(d+c)}} -function I(a,c){var d=a.get("backgroundColor"),e=a.get("borderColor"),f=z(a),k=A(a),g=B(a),l=t(-Math.max(g,f)),f=t(f),r=a.g;c.index&&(r-=c.index);var d={cssFloat:"left",position:"relative",cursor:"pointer",backgroundColor:d,border:t(k)+" solid "+e,padding:t(g/2)+" "+t(g),marginRight:l,whiteSpace:"nowrap",borderRadiusTopLeft:f,MozBorderRadiusTopleft:f,webkitBorderTopLeftRadius:f,borderRadiusTopRight:f,MozBorderRadiusTopright:f,webkitBorderTopRightRadius:f,zIndex:r,display:"inline"},p;for(p in d)c.style[p]= -d[p];p=a.get("tabClassName");void 0!=p&&(c.className+=" "+p)}function J(a,c){c.U=google.maps.event.addDomListener(c,"click",function(){K(a,this)})}h.prototype.oa=function(a){(a=this.b[a-1])&&K(this,a.f)};h.prototype.setTabActive=h.prototype.oa; -function K(a,c){if(c){var d=B(a)/2,e=A(a);if(a.d){var f=a.d;f.style.zIndex=a.g-f.index;f.style.paddingBottom=t(d);f.style.borderBottomWidth=t(e)}c.style.zIndex=a.g;c.style.borderBottomWidth=0;c.style.marginBottomWidth="-10px";c.style.paddingBottom=t(d+e);a.setContent(a.b[c.index].content);F(a);a.d=c;x(a)}else a.setContent(""),F(a)}h.prototype.ja=function(a){this.set("maxWidth",a)};h.prototype.setMaxWidth=h.prototype.ja;h.prototype.W=function(){x(this)};h.prototype.maxWidth_changed=h.prototype.W; -h.prototype.ia=function(a){this.set("maxHeight",a)};h.prototype.setMaxHeight=h.prototype.ia;h.prototype.V=function(){x(this)};h.prototype.maxHeight_changed=h.prototype.V;h.prototype.la=function(a){this.set("minWidth",a)};h.prototype.setMinWidth=h.prototype.la;h.prototype.Y=function(){x(this)};h.prototype.minWidth_changed=h.prototype.Y;h.prototype.ka=function(a){this.set("minHeight",a)};h.prototype.setMinHeight=h.prototype.ka;h.prototype.X=function(){x(this)};h.prototype.minHeight_changed=h.prototype.X; -h.prototype.J=function(a,c){var d=document.createElement("DIV");d.innerHTML=a;I(this,d);J(this,d);this.i.appendChild(d);this.b.push({label:a,content:c,f:d});d.index=this.b.length-1;d.style.zIndex=this.g-d.index;this.d||K(this,d);d.className=d.className+" "+this.h;x(this)};h.prototype.addTab=h.prototype.J; -h.prototype.ta=function(a,c,d){!this.b.length||0>a||a>=this.b.length||(a=this.b[a],void 0!=c&&(a.f.innerHTML=a.label=c),void 0!=d&&(a.content=d),this.d==a.f&&(this.setContent(a.content),F(this)),x(this))};h.prototype.updateTab=h.prototype.ta; -h.prototype.aa=function(a){if(!(!this.b.length||0>a||a>=this.b.length)){var c=this.b[a];c.f.parentNode.removeChild(c.f);google.maps.event.removeListener(c.f.U);this.b.splice(a,1);delete c;for(var d=0,e;e=this.b[d];d++)e.f.index=d;c.f==this.d&&(this.d=this.b[a]?this.b[a].f:this.b[a-1]?this.b[a-1].f:void 0,K(this,this.d));x(this)}};h.prototype.removeTab=h.prototype.aa; -function L(a,c,d){var e=document.createElement("DIV");e.style.display="inline";e.style.position="absolute";e.style.visibility="hidden";"string"==typeof a?e.innerHTML=a:e.appendChild(a.cloneNode(!0));document.body.appendChild(e);a=new google.maps.Size(e.offsetWidth,e.offsetHeight);c&&a.width>c&&(e.style.width=t(c),a=new google.maps.Size(e.offsetWidth,e.offsetHeight));d&&a.height>d&&(e.style.height=t(d),a=new google.maps.Size(e.offsetWidth,e.offsetHeight));document.body.removeChild(e);delete e;return a} -function x(a){var c=a.get("map");if(c){var d=B(a);A(a);z(a);var e=n(a),f=c.getDiv(),k=2*e,c=f.offsetWidth-k,f=f.offsetHeight-k-D(a),k=0,g=a.get("minWidth")||0,l=a.get("minHeight")||0,r=a.get("maxWidth")||0,p=a.get("maxHeight")||0,r=Math.min(c,r),p=Math.min(f,p),y=0;if(a.b.length)for(var u=0,q;q=a.b[u];u++){var v=L(q.f,r,p);q=L(q.content,r,p);gk&&(k=v.height);gc&&(g=c);l>f&&(l=f-k);a.i&&(a.t=k,a.i.style.width=t(y));a.e.style.width=t(g);a.e.style.height=t(l)}z(a);d=A(a);c=2;a.b.length&&a.t&&(c+=a.t);e=2+d;(f=a.e)&&f.clientHeighto?(s.style.marginLeft=this.px(-e),r.style.marginLeft=this.px(-(e-t))):s.style.marginLeft=r.style.marginLeft=0,0==t?s.style.display="none":s.style.display=""},InfoBubble.prototype.setPadding=function(t){this.set("padding",t)},InfoBubble.prototype.setPadding=InfoBubble.prototype.setPadding,InfoBubble.prototype.setCloseSrc=function(t){t&&this.close_&&(this.close_.src=t)},InfoBubble.prototype.setCloseSrc=InfoBubble.prototype.setCloseSrc,InfoBubble.prototype.getPadding_=function(){return parseInt(this.get("padding"),10)||0},InfoBubble.prototype.padding_changed=function(){var t=this.getPadding_();this.contentContainer_.style.padding=this.px(t),this.updateTabStyles_(),this.redraw_()},InfoBubble.prototype.padding_changed=InfoBubble.prototype.padding_changed,InfoBubble.prototype.px=function(t){return t?t+"px":t},InfoBubble.prototype.addEvents_=function(){var t=["mousedown","mousemove","mouseover","mouseout","mouseup","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","dblclick","contextmenu","click"],e=this.bubble_;this.listeners_=[];for(var o,i=0;o=t[i];i++)this.listeners_.push(google.maps.event.addDomListener(e,o,function(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}))},InfoBubble.prototype.onAdd=function(){this.bubble_||this.buildDom_(),this.addEvents_();var t=this.getPanes();t&&(t.floatPane.appendChild(this.bubble_),t.floatShadow.appendChild(this.bubbleShadow_))},InfoBubble.prototype.onAdd=InfoBubble.prototype.onAdd,InfoBubble.prototype.draw=function(){var t=this.getProjection();if(t){var e=this.get("position");if(!e)return void this.close();var o=0;this.activeTab_&&(o=this.activeTab_.offsetHeight);var i=this.getAnchorHeight_(),n=this.getArrowSize_(),s=this.getArrowPosition_();s/=100;var r=t.fromLatLngToDivPixel(e),a=this.contentContainer_.offsetWidth,b=this.bubble_.offsetHeight;if(a){var h=r.y-(b+n);i&&(h-=i);var l=r.x-a*s;this.bubble_.style.top=this.px(h),this.bubble_.style.left=this.px(l);var p=parseInt(this.get("shadowStyle"),10);switch(p){case 1:this.bubbleShadow_.style.top=this.px(h+o-1),this.bubbleShadow_.style.left=this.px(l),this.bubbleShadow_.style.width=this.px(a),this.bubbleShadow_.style.height=this.px(this.contentContainer_.offsetHeight-n);break;case 2:a=.8*a,i?this.bubbleShadow_.style.top=this.px(r.y):this.bubbleShadow_.style.top=this.px(r.y+n),this.bubbleShadow_.style.left=this.px(r.x-a*s),this.bubbleShadow_.style.width=this.px(a),this.bubbleShadow_.style.height=this.px(2)}}}},InfoBubble.prototype.draw=InfoBubble.prototype.draw,InfoBubble.prototype.onRemove=function(){this.bubble_&&this.bubble_.parentNode&&this.bubble_.parentNode.removeChild(this.bubble_),this.bubbleShadow_&&this.bubbleShadow_.parentNode&&this.bubbleShadow_.parentNode.removeChild(this.bubbleShadow_);for(var t,e=0;t=this.listeners_[e];e++)google.maps.event.removeListener(t)},InfoBubble.prototype.onRemove=InfoBubble.prototype.onRemove,InfoBubble.prototype.isOpen=function(){return this.isOpen_},InfoBubble.prototype.isOpen=InfoBubble.prototype.isOpen,InfoBubble.prototype.close=function(){this.bubble_&&(this.bubble_.style.display="none",this.bubble_.className=this.bubble_.className.replace(this.animationName_,"")),this.bubbleShadow_&&(this.bubbleShadow_.style.display="none",this.bubbleShadow_.className=this.bubbleShadow_.className.replace(this.animationName_,"")),this.isOpen_=!1},InfoBubble.prototype.close=InfoBubble.prototype.close,InfoBubble.prototype.open=function(t,e){var o=this;window.setTimeout(function(){o.open_(t,e)},0)},InfoBubble.prototype.open_=function(t,e){this.updateContent_(),t&&this.setMap(t),e&&(this.set("anchor",e),this.bindTo("anchorPoint",e),this.bindTo("position",e)),this.bubble_.style.display=this.bubbleShadow_.style.display="";var o=!this.get("disableAnimation");o&&(this.bubble_.className+=" "+this.animationName_,this.bubbleShadow_.className+=" "+this.animationName_),this.redraw_(),this.isOpen_=!0;var i=!this.get("disableAutoPan");if(i){var n=this;window.setTimeout(function(){n.panToView()},200)}},InfoBubble.prototype.open=InfoBubble.prototype.open,InfoBubble.prototype.setPosition=function(t){t&&this.set("position",t)},InfoBubble.prototype.setPosition=InfoBubble.prototype.setPosition,InfoBubble.prototype.getPosition=function(){return this.get("position")},InfoBubble.prototype.getPosition=InfoBubble.prototype.getPosition,InfoBubble.prototype.position_changed=function(){this.draw()},InfoBubble.prototype.position_changed=InfoBubble.prototype.position_changed,InfoBubble.prototype.panToView=function(){var t=this.getProjection();if(t&&this.bubble_){var e=this.getAnchorHeight_(),o=this.bubble_.offsetHeight+e,i=this.get("map"),n=i.getDiv(),s=n.offsetHeight,r=this.getPosition(),a=t.fromLatLngToContainerPixel(i.getCenter()),b=t.fromLatLngToContainerPixel(r),h=a.y-o,l=s-a.y,p=0>h,d=0;p&&(h*=-1,d=(h+l)/2),b.y-=d,r=t.fromContainerPixelToLatLng(b),i.getCenter()!=r&&i.panTo(r)}},InfoBubble.prototype.panToView=InfoBubble.prototype.panToView,InfoBubble.prototype.htmlToDocumentFragment_=function(t){t=t.replace(/^\s*([\S\s]*)\b\s*$/,"$1");var e=document.createElement("DIV");if(e.innerHTML=t,1==e.childNodes.length)return e.removeChild(e.firstChild);for(var o=document.createDocumentFragment();e.firstChild;)o.appendChild(e.firstChild);return o},InfoBubble.prototype.removeChildren_=function(t){if(t)for(var e;e=t.firstChild;)t.removeChild(e)},InfoBubble.prototype.setContent=function(t){this.set("content",t)},InfoBubble.prototype.setContent=InfoBubble.prototype.setContent,InfoBubble.prototype.getContent=function(){return this.get("content")},InfoBubble.prototype.getContent=InfoBubble.prototype.getContent,InfoBubble.prototype.updateContent_=function(){if(this.content_){this.removeChildren_(this.content_);var t=this.getContent();if(t){"string"==typeof t&&(t=this.htmlToDocumentFragment_(t)),this.content_.appendChild(t);for(var e,o=this,i=this.content_.getElementsByTagName("IMG"),n=0;e=i[n];n++)google.maps.event.addDomListener(e,"load",function(){o.imageLoaded_()});google.maps.event.trigger(this,"domready")}this.redraw_()}},InfoBubble.prototype.imageLoaded_=function(){var t=!this.get("disableAutoPan");this.redraw_(),!t||0!=this.tabs_.length&&0!=this.activeTab_.index||this.panToView()},InfoBubble.prototype.updateTabStyles_=function(){if(this.tabs_&&this.tabs_.length){for(var t,e=0;t=this.tabs_[e];e++)this.setTabStyle_(t.tab);this.activeTab_.style.zIndex=this.baseZIndex_;var o=this.getBorderWidth_(),i=this.getPadding_()/2;this.activeTab_.style.borderBottomWidth=0,this.activeTab_.style.paddingBottom=this.px(i+o)}},InfoBubble.prototype.setTabStyle_=function(t){var e=this.get("backgroundColor"),o=this.get("borderColor"),i=this.getBorderRadius_(),n=this.getBorderWidth_(),s=this.getPadding_(),r=this.px(-Math.max(s,i)),a=this.px(i),b=this.baseZIndex_;t.index&&(b-=t.index);var h={cssFloat:"left",position:"relative",cursor:"pointer",backgroundColor:e,border:this.px(n)+" solid "+o,padding:this.px(s/2)+" "+this.px(s),marginRight:r,whiteSpace:"nowrap",borderRadiusTopLeft:a,MozBorderRadiusTopleft:a,webkitBorderTopLeftRadius:a,borderRadiusTopRight:a,MozBorderRadiusTopright:a,webkitBorderTopRightRadius:a,zIndex:b,display:"inline"};for(var l in h)t.style[l]=h[l];var p=this.get("tabClassName");void 0!=p&&(t.className+=" "+p)},InfoBubble.prototype.addTabActions_=function(t){var e=this;t.listener_=google.maps.event.addDomListener(t,"click",function(){e.setTabActive_(this)})},InfoBubble.prototype.setTabActive=function(t){var e=this.tabs_[t-1];e&&this.setTabActive_(e.tab)},InfoBubble.prototype.setTabActive=InfoBubble.prototype.setTabActive,InfoBubble.prototype.setTabActive_=function(t){if(!t)return this.setContent(""),void this.updateContent_();var e=this.getPadding_()/2,o=this.getBorderWidth_();if(this.activeTab_){var i=this.activeTab_;i.style.zIndex=this.baseZIndex_-i.index,i.style.paddingBottom=this.px(e),i.style.borderBottomWidth=this.px(o)}t.style.zIndex=this.baseZIndex_,t.style.borderBottomWidth=0,t.style.marginBottomWidth="-10px",t.style.paddingBottom=this.px(e+o),this.setContent(this.tabs_[t.index].content),this.updateContent_(),this.activeTab_=t,this.redraw_()},InfoBubble.prototype.setMaxWidth=function(t){this.set("maxWidth",t)},InfoBubble.prototype.setMaxWidth=InfoBubble.prototype.setMaxWidth,InfoBubble.prototype.maxWidth_changed=function(){this.redraw_()},InfoBubble.prototype.maxWidth_changed=InfoBubble.prototype.maxWidth_changed,InfoBubble.prototype.setMaxHeight=function(t){this.set("maxHeight",t)},InfoBubble.prototype.setMaxHeight=InfoBubble.prototype.setMaxHeight,InfoBubble.prototype.maxHeight_changed=function(){this.redraw_()},InfoBubble.prototype.maxHeight_changed=InfoBubble.prototype.maxHeight_changed,InfoBubble.prototype.setMinWidth=function(t){this.set("minWidth",t)},InfoBubble.prototype.setMinWidth=InfoBubble.prototype.setMinWidth,InfoBubble.prototype.minWidth_changed=function(){this.redraw_()},InfoBubble.prototype.minWidth_changed=InfoBubble.prototype.minWidth_changed,InfoBubble.prototype.setMinHeight=function(t){this.set("minHeight",t)},InfoBubble.prototype.setMinHeight=InfoBubble.prototype.setMinHeight,InfoBubble.prototype.minHeight_changed=function(){this.redraw_()},InfoBubble.prototype.minHeight_changed=InfoBubble.prototype.minHeight_changed,InfoBubble.prototype.addTab=function(t,e){var o=document.createElement("DIV");o.innerHTML=t,this.setTabStyle_(o),this.addTabActions_(o),this.tabsContainer_.appendChild(o),this.tabs_.push({label:t,content:e,tab:o}),o.index=this.tabs_.length-1,o.style.zIndex=this.baseZIndex_-o.index,this.activeTab_||this.setTabActive_(o),o.className=o.className+" "+this.animationName_,this.redraw_()},InfoBubble.prototype.addTab=InfoBubble.prototype.addTab,InfoBubble.prototype.updateTab=function(t,e,o){if(!(!this.tabs_.length||0>t||t>=this.tabs_.length)){var i=this.tabs_[t];void 0!=e&&(i.tab.innerHTML=i.label=e),void 0!=o&&(i.content=o),this.activeTab_==i.tab&&(this.setContent(i.content),this.updateContent_()),this.redraw_()}},InfoBubble.prototype.updateTab=InfoBubble.prototype.updateTab,InfoBubble.prototype.removeTab=function(t){if(!(!this.tabs_.length||0>t||t>=this.tabs_.length)){var e=this.tabs_[t];e.tab.parentNode.removeChild(e.tab),google.maps.event.removeListener(e.tab.listener_),this.tabs_.splice(t,1),delete e;for(var o,i=0;o=this.tabs_[i];i++)o.tab.index=i;e.tab==this.activeTab_&&(this.tabs_[t]?this.activeTab_=this.tabs_[t].tab:this.tabs_[t-1]?this.activeTab_=this.tabs_[t-1].tab:this.activeTab_=void 0,this.setTabActive_(this.activeTab_)),this.redraw_()}},InfoBubble.prototype.removeTab=InfoBubble.prototype.removeTab,InfoBubble.prototype.getElementSize_=function(t,e,o){var i=document.createElement("DIV");i.style.display="inline",i.style.position="absolute",i.style.visibility="hidden","string"==typeof t?i.innerHTML=t:i.appendChild(t.cloneNode(!0)),document.body.appendChild(i);var n=new google.maps.Size(i.offsetWidth,i.offsetHeight);return e&&n.width>e&&(i.style.width=this.px(e),n=new google.maps.Size(i.offsetWidth,i.offsetHeight)),o&&n.height>o&&(i.style.height=this.px(o),n=new google.maps.Size(i.offsetWidth,i.offsetHeight)),document.body.removeChild(i),delete i,n},InfoBubble.prototype.redraw_=function(){this.figureOutSize_(),this.positionCloseButton_(),this.draw()},InfoBubble.prototype.figureOutSize_=function(){var t=this.get("map");if(t){var e=this.getPadding_(),o=this.getArrowSize_(),i=t.getDiv(),n=2*o,s=i.offsetWidth-n,r=i.offsetHeight-n-this.getAnchorHeight_(),a=0,b=this.get("minWidth")||0,h=this.get("minHeight")||0,l=this.get("maxWidth")||0,p=this.get("maxHeight")||0;l=Math.min(s,l),p=Math.min(r,p);var d=0;if(this.tabs_.length)for(var u,f=0;u=this.tabs_[f];f++){var y=this.getElementSize_(u.tab,l,p),_=this.getElementSize_(u.content,l,p);ba&&(a=y.height),b<_.width&&(b=_.width),h<_.height&&(h=_.height)}else{var c=this.get("content");if("string"==typeof c&&(c=this.htmlToDocumentFragment_(c)),c){var _=this.getElementSize_(c,l,p);b<_.width&&(b=_.width),h<_.height&&(h=_.height)}}l&&(b=Math.min(b,l)),p&&(h=Math.min(h,p)),b=Math.max(b,d),b==d&&(b+=2*e),o=2*o,b=Math.max(b,o),b>s&&(b=s),h>r&&(h=r-a),this.tabsContainer_&&(this.tabHeight_=a,this.tabsContainer_.style.width=this.px(d)),this.contentContainer_.style.width=this.px(b),this.contentContainer_.style.height=this.px(h)}},InfoBubble.prototype.getAnchorHeight_=function(){var t=this.get("anchor");if(t){var e=this.get("anchorPoint");if(e)return-1*e.y}return 0},InfoBubble.prototype.anchorPoint_changed=function(){this.draw()},InfoBubble.prototype.anchorPoint_changed=InfoBubble.prototype.anchorPoint_changed,InfoBubble.prototype.positionCloseButton_=function(){var t=this.getBorderWidth_(),e=2,o=2;this.tabs_.length&&this.tabHeight_&&(o+=this.tabHeight_),o+=t,e+=t;var i=this.contentContainer_;i&&i.clientHeight