Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-google-maps/infobox

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-google-maps/infobox - npm Package Compare versions

Comparing version 1.8.1 to 1.8.2

2

dist/infobox.cjs.development.js
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var InfoBox =

@@ -4,0 +6,0 @@ /*#__PURE__*/

2

dist/infobox.cjs.production.min.js

@@ -1,2 +0,2 @@

"use strict";exports.InfoBox=function(){function t(i){void 0===i&&(i={}),this.extend(t,google.maps.OverlayView),this.content=i.content||"",this.disableAutoPan=i.disableAutoPan||!1,this.maxWidth=i.maxWidth||0,this.pixelOffset=i.pixelOffset||new google.maps.Size(0,0),this.position=i.position||new google.maps.LatLng(0,0),this.zIndex=i.zIndex||null,this.boxClass=i.boxClass||"infoBox",this.boxStyle=i.boxStyle||{},this.closeBoxMargin=i.closeBoxMargin||"2px",this.closeBoxURL=i.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===i.closeBoxURL&&(this.closeBoxURL=""),this.infoBoxClearance=i.infoBoxClearance||new google.maps.Size(1,1),void 0===i.visible&&(i.visible=void 0===i.isHidden||!i.isHidden),this.isHidden=!i.visible,this.alignBottom=i.alignBottom||!1,this.pane=i.pane||"floatPane",this.enableEventPropagation=i.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}var i=t.prototype;return i.createInfoBoxDiv=function(){var t=this;function i(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}if(!this.div){if(this.div=document.createElement("div"),this.setBoxStyle(),"string"==typeof this.content?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content)),this.getPanes()[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(0!==this.maxWidth&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+"px",this.fixedWidthSet=!0;else{var e=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-e.left-e.right+"px",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var s=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],o=0;o<s.length;o++)this.eventListeners.push(google.maps.event.addDomListener(this.div,s[o],i));this.eventListeners.push(google.maps.event.addDomListener(this.div,"mouseover",(function(){t.div&&(t.div.style.cursor="default")})))}this.contextListener=google.maps.event.addDomListener(this.div,"contextmenu",(function(e){e.returnValue=!1,e.preventDefault&&e.preventDefault(),t.enableEventPropagation||i(e)})),google.maps.event.trigger(this,"domready")}},i.getCloseBoxImg=function(){var t="";return""!==this.closeBoxURL&&(t="<img",t+=" src='"+this.closeBoxURL+"'",t+=" align=right",t+=" style='",t+=" position: relative;",t+=" cursor: pointer;",t+=" margin: "+this.closeBoxMargin+";",t+="'>"),t},i.addClickHandler=function(){this.closeListener=this.div&&this.div.firstChild&&""!==this.closeBoxURL?google.maps.event.addDomListener(this.div.firstChild,"click",this.getCloseClickHandler()):null},i.getCloseClickHandler=function(){var t=this;return function(i){i.cancelBubble=!0,i.stopPropagation&&i.stopPropagation(),google.maps.event.trigger(t,"closeclick"),t.close()}},i.panBox=function(t){if(this.div&&!t){var i=this.getMap();if(i instanceof google.maps.Map){var e=0,s=0,o=i.getBounds();o&&!o.contains(this.position)&&i.setCenter(this.position);var n=i.getDiv(),h=n.offsetWidth,d=n.offsetHeight,l=this.pixelOffset.width,r=this.pixelOffset.height,a=this.div.offsetWidth,v=this.div.offsetHeight,p=this.infoBoxClearance.width,g=this.infoBoxClearance.height,c=this.getProjection().fromLatLngToContainerPixel(this.position);c.x<-l+p?e=c.x+l-p:c.x+a+l+p>h&&(e=c.x+a+l+p-h),this.alignBottom?c.y<-r+g+v?s=c.y+r-g-v:c.y+r+g>d&&(s=c.y+r+g-d):c.y<-r+g?s=c.y+r-g:c.y+v+r+g>d&&(s=c.y+v+r+g-d),0===e&&0===s||i.panBy(e,s)}}},i.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var t=this.boxStyle;for(var i in t)t.hasOwnProperty(i)&&(this.div.style[i]=t[i]);if(this.div.style.webkitTransform="translateZ(0)",void 0!==this.div.style.opacity&&""!==this.div.style.opacity){var e=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+100*e+')"',this.div.style.filter="alpha(opacity="+100*e+")"}this.div.style.position="absolute",this.div.style.visibility="hidden",null!==this.zIndex&&(this.div.style.zIndex=this.zIndex+""),this.div.style.overflow||(this.div.style.overflow="auto")}},i.getBoxWidths=function(){var t={top:0,bottom:0,left:0,right:0};if(!this.div)return t;if(document.defaultView&&document.defaultView.getComputedStyle){var i=this.div.ownerDocument,e=i&&i.defaultView?i.defaultView.getComputedStyle(this.div,""):null;e&&(t.top=parseInt(e.borderTopWidth||"",10)||0,t.bottom=parseInt(e.borderBottomWidth||"",10)||0,t.left=parseInt(e.borderLeftWidth||"",10)||0,t.right=parseInt(e.borderRightWidth||"",10)||0)}else if(document.documentElement.currentStyle){var s=this.div.currentStyle;s&&(t.top=parseInt(s.borderTopWidth||"",10)||0,t.bottom=parseInt(s.borderBottomWidth||"",10)||0,t.left=parseInt(s.borderLeftWidth||"",10)||0,t.right=parseInt(s.borderRightWidth||"",10)||0)}return t},i.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},i.draw=function(){if(this.createInfoBoxDiv(),this.div){var t=this.getProjection().fromLatLngToDivPixel(this.position);this.div.style.left=t.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(t.y+this.pixelOffset.height)+"px":this.div.style.top=t.y+this.pixelOffset.height+"px",this.div.style.visibility=this.isHidden?"hidden":"visible"}},i.setOptions=function(t){void 0===t&&(t={}),void 0!==t.boxClass&&(this.boxClass=t.boxClass,this.setBoxStyle()),void 0!==t.boxStyle&&(this.boxStyle=t.boxStyle,this.setBoxStyle()),void 0!==t.content&&this.setContent(t.content),void 0!==t.disableAutoPan&&(this.disableAutoPan=t.disableAutoPan),void 0!==t.maxWidth&&(this.maxWidth=t.maxWidth),void 0!==t.pixelOffset&&(this.pixelOffset=t.pixelOffset),void 0!==t.alignBottom&&(this.alignBottom=t.alignBottom),void 0!==t.position&&this.setPosition(t.position),void 0!==t.zIndex&&this.setZIndex(t.zIndex),void 0!==t.closeBoxMargin&&(this.closeBoxMargin=t.closeBoxMargin),void 0!==t.closeBoxURL&&(this.closeBoxURL=t.closeBoxURL),void 0!==t.infoBoxClearance&&(this.infoBoxClearance=t.infoBoxClearance),void 0!==t.isHidden&&(this.isHidden=t.isHidden),void 0!==t.visible&&(this.isHidden=!t.visible),void 0!==t.enableEventPropagation&&(this.enableEventPropagation=t.enableEventPropagation),this.div&&this.draw()},i.setContent=function(t){this.content=t,this.div&&(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.fixedWidthSet||(this.div.style.width=""),"string"==typeof t?this.div.innerHTML=this.getCloseBoxImg()+t:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(t)),this.fixedWidthSet||(this.div.style.width=this.div.offsetWidth+"px","string"==typeof t?this.div.innerHTML=this.getCloseBoxImg()+t:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(t))),this.addClickHandler()),google.maps.event.trigger(this,"content_changed")},i.setPosition=function(t){this.position=t,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},i.setVisible=function(t){this.isHidden=!t,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},i.setZIndex=function(t){this.zIndex=t,this.div&&(this.div.style.zIndex=t+""),google.maps.event.trigger(this,"zindex_changed")},i.getContent=function(){return this.content},i.getPosition=function(){return this.position},i.getZIndex=function(){return this.zIndex},i.getVisible=function(){return null!=this.getMap()&&!this.isHidden},i.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},i.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},i.open=function(t,i){var e=this;i&&(this.position=i.getPosition(),this.moveListener=google.maps.event.addListener(i,"position_changed",(function(){var t=i.getPosition();e.setPosition(t)})),this.mapListener=google.maps.event.addListener(i,"map_changed",(function(){e.setMap(i.map)}))),this.setMap(t),this.div&&this.panBox()},i.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var t=0;t<this.eventListeners.length;t++)google.maps.event.removeListener(this.eventListeners[t]);this.eventListeners=null}this.moveListener&&(google.maps.event.removeListener(this.moveListener),this.moveListener=null),this.mapListener&&(google.maps.event.removeListener(this.mapListener),this.mapListener=null),this.contextListener&&(google.maps.event.removeListener(this.contextListener),this.contextListener=null),this.setMap(null)},i.extend=function(t,i){return function(t){for(var i in t.prototype)this.prototype.hasOwnProperty(i)||(this.prototype[i]=t.prototype[i]);return this}.apply(t,[i])},t}();
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InfoBox=function(){function t(i){void 0===i&&(i={}),this.extend(t,google.maps.OverlayView),this.content=i.content||"",this.disableAutoPan=i.disableAutoPan||!1,this.maxWidth=i.maxWidth||0,this.pixelOffset=i.pixelOffset||new google.maps.Size(0,0),this.position=i.position||new google.maps.LatLng(0,0),this.zIndex=i.zIndex||null,this.boxClass=i.boxClass||"infoBox",this.boxStyle=i.boxStyle||{},this.closeBoxMargin=i.closeBoxMargin||"2px",this.closeBoxURL=i.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===i.closeBoxURL&&(this.closeBoxURL=""),this.infoBoxClearance=i.infoBoxClearance||new google.maps.Size(1,1),void 0===i.visible&&(i.visible=void 0===i.isHidden||!i.isHidden),this.isHidden=!i.visible,this.alignBottom=i.alignBottom||!1,this.pane=i.pane||"floatPane",this.enableEventPropagation=i.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}var i=t.prototype;return i.createInfoBoxDiv=function(){var t=this;function i(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}if(!this.div){if(this.div=document.createElement("div"),this.setBoxStyle(),"string"==typeof this.content?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content)),this.getPanes()[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(0!==this.maxWidth&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+"px",this.fixedWidthSet=!0;else{var e=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-e.left-e.right+"px",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var s=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],o=0;o<s.length;o++)this.eventListeners.push(google.maps.event.addDomListener(this.div,s[o],i));this.eventListeners.push(google.maps.event.addDomListener(this.div,"mouseover",(function(){t.div&&(t.div.style.cursor="default")})))}this.contextListener=google.maps.event.addDomListener(this.div,"contextmenu",(function(e){e.returnValue=!1,e.preventDefault&&e.preventDefault(),t.enableEventPropagation||i(e)})),google.maps.event.trigger(this,"domready")}},i.getCloseBoxImg=function(){var t="";return""!==this.closeBoxURL&&(t="<img",t+=" src='"+this.closeBoxURL+"'",t+=" align=right",t+=" style='",t+=" position: relative;",t+=" cursor: pointer;",t+=" margin: "+this.closeBoxMargin+";",t+="'>"),t},i.addClickHandler=function(){this.closeListener=this.div&&this.div.firstChild&&""!==this.closeBoxURL?google.maps.event.addDomListener(this.div.firstChild,"click",this.getCloseClickHandler()):null},i.getCloseClickHandler=function(){var t=this;return function(i){i.cancelBubble=!0,i.stopPropagation&&i.stopPropagation(),google.maps.event.trigger(t,"closeclick"),t.close()}},i.panBox=function(t){if(this.div&&!t){var i=this.getMap();if(i instanceof google.maps.Map){var e=0,s=0,o=i.getBounds();o&&!o.contains(this.position)&&i.setCenter(this.position);var n=i.getDiv(),h=n.offsetWidth,d=n.offsetHeight,l=this.pixelOffset.width,r=this.pixelOffset.height,a=this.div.offsetWidth,v=this.div.offsetHeight,p=this.infoBoxClearance.width,g=this.infoBoxClearance.height,c=this.getProjection().fromLatLngToContainerPixel(this.position);c.x<-l+p?e=c.x+l-p:c.x+a+l+p>h&&(e=c.x+a+l+p-h),this.alignBottom?c.y<-r+g+v?s=c.y+r-g-v:c.y+r+g>d&&(s=c.y+r+g-d):c.y<-r+g?s=c.y+r-g:c.y+v+r+g>d&&(s=c.y+v+r+g-d),0===e&&0===s||i.panBy(e,s)}}},i.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var t=this.boxStyle;for(var i in t)t.hasOwnProperty(i)&&(this.div.style[i]=t[i]);if(this.div.style.webkitTransform="translateZ(0)",void 0!==this.div.style.opacity&&""!==this.div.style.opacity){var e=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+100*e+')"',this.div.style.filter="alpha(opacity="+100*e+")"}this.div.style.position="absolute",this.div.style.visibility="hidden",null!==this.zIndex&&(this.div.style.zIndex=this.zIndex+""),this.div.style.overflow||(this.div.style.overflow="auto")}},i.getBoxWidths=function(){var t={top:0,bottom:0,left:0,right:0};if(!this.div)return t;if(document.defaultView&&document.defaultView.getComputedStyle){var i=this.div.ownerDocument,e=i&&i.defaultView?i.defaultView.getComputedStyle(this.div,""):null;e&&(t.top=parseInt(e.borderTopWidth||"",10)||0,t.bottom=parseInt(e.borderBottomWidth||"",10)||0,t.left=parseInt(e.borderLeftWidth||"",10)||0,t.right=parseInt(e.borderRightWidth||"",10)||0)}else if(document.documentElement.currentStyle){var s=this.div.currentStyle;s&&(t.top=parseInt(s.borderTopWidth||"",10)||0,t.bottom=parseInt(s.borderBottomWidth||"",10)||0,t.left=parseInt(s.borderLeftWidth||"",10)||0,t.right=parseInt(s.borderRightWidth||"",10)||0)}return t},i.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},i.draw=function(){if(this.createInfoBoxDiv(),this.div){var t=this.getProjection().fromLatLngToDivPixel(this.position);this.div.style.left=t.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(t.y+this.pixelOffset.height)+"px":this.div.style.top=t.y+this.pixelOffset.height+"px",this.div.style.visibility=this.isHidden?"hidden":"visible"}},i.setOptions=function(t){void 0===t&&(t={}),void 0!==t.boxClass&&(this.boxClass=t.boxClass,this.setBoxStyle()),void 0!==t.boxStyle&&(this.boxStyle=t.boxStyle,this.setBoxStyle()),void 0!==t.content&&this.setContent(t.content),void 0!==t.disableAutoPan&&(this.disableAutoPan=t.disableAutoPan),void 0!==t.maxWidth&&(this.maxWidth=t.maxWidth),void 0!==t.pixelOffset&&(this.pixelOffset=t.pixelOffset),void 0!==t.alignBottom&&(this.alignBottom=t.alignBottom),void 0!==t.position&&this.setPosition(t.position),void 0!==t.zIndex&&this.setZIndex(t.zIndex),void 0!==t.closeBoxMargin&&(this.closeBoxMargin=t.closeBoxMargin),void 0!==t.closeBoxURL&&(this.closeBoxURL=t.closeBoxURL),void 0!==t.infoBoxClearance&&(this.infoBoxClearance=t.infoBoxClearance),void 0!==t.isHidden&&(this.isHidden=t.isHidden),void 0!==t.visible&&(this.isHidden=!t.visible),void 0!==t.enableEventPropagation&&(this.enableEventPropagation=t.enableEventPropagation),this.div&&this.draw()},i.setContent=function(t){this.content=t,this.div&&(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.fixedWidthSet||(this.div.style.width=""),"string"==typeof t?this.div.innerHTML=this.getCloseBoxImg()+t:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(t)),this.fixedWidthSet||(this.div.style.width=this.div.offsetWidth+"px","string"==typeof t?this.div.innerHTML=this.getCloseBoxImg()+t:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(t))),this.addClickHandler()),google.maps.event.trigger(this,"content_changed")},i.setPosition=function(t){this.position=t,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},i.setVisible=function(t){this.isHidden=!t,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},i.setZIndex=function(t){this.zIndex=t,this.div&&(this.div.style.zIndex=t+""),google.maps.event.trigger(this,"zindex_changed")},i.getContent=function(){return this.content},i.getPosition=function(){return this.position},i.getZIndex=function(){return this.zIndex},i.getVisible=function(){return null!=this.getMap()&&!this.isHidden},i.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},i.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},i.open=function(t,i){var e=this;i&&(this.position=i.getPosition(),this.moveListener=google.maps.event.addListener(i,"position_changed",(function(){var t=i.getPosition();e.setPosition(t)})),this.mapListener=google.maps.event.addListener(i,"map_changed",(function(){e.setMap(i.map)}))),this.setMap(t),this.div&&this.panBox()},i.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var t=0;t<this.eventListeners.length;t++)google.maps.event.removeListener(this.eventListeners[t]);this.eventListeners=null}this.moveListener&&(google.maps.event.removeListener(this.moveListener),this.moveListener=null),this.mapListener&&(google.maps.event.removeListener(this.mapListener),this.mapListener=null),this.contextListener&&(google.maps.event.removeListener(this.contextListener),this.contextListener=null),this.setMap(null)},i.extend=function(t,i){return function(t){for(var i in t.prototype)this.prototype.hasOwnProperty(i)||(this.prototype[i]=t.prototype[i]);return this}.apply(t,[i])},t}();
//# sourceMappingURL=infobox.cjs.production.min.js.map

@@ -677,3 +677,5 @@ (function (global, factory) {

Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=infobox.umd.development.js.map

@@ -1,2 +0,2 @@

!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).infoBox={})}(this,(function(t){"use strict";t.InfoBox=function(){function t(i){void 0===i&&(i={}),this.extend(t,google.maps.OverlayView),this.content=i.content||"",this.disableAutoPan=i.disableAutoPan||!1,this.maxWidth=i.maxWidth||0,this.pixelOffset=i.pixelOffset||new google.maps.Size(0,0),this.position=i.position||new google.maps.LatLng(0,0),this.zIndex=i.zIndex||null,this.boxClass=i.boxClass||"infoBox",this.boxStyle=i.boxStyle||{},this.closeBoxMargin=i.closeBoxMargin||"2px",this.closeBoxURL=i.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===i.closeBoxURL&&(this.closeBoxURL=""),this.infoBoxClearance=i.infoBoxClearance||new google.maps.Size(1,1),void 0===i.visible&&(i.visible=void 0===i.isHidden||!i.isHidden),this.isHidden=!i.visible,this.alignBottom=i.alignBottom||!1,this.pane=i.pane||"floatPane",this.enableEventPropagation=i.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}var i=t.prototype;return i.createInfoBoxDiv=function(){var t=this;function i(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}if(!this.div){if(this.div=document.createElement("div"),this.setBoxStyle(),"string"==typeof this.content?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content)),this.getPanes()[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(0!==this.maxWidth&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+"px",this.fixedWidthSet=!0;else{var e=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-e.left-e.right+"px",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var s=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],o=0;o<s.length;o++)this.eventListeners.push(google.maps.event.addDomListener(this.div,s[o],i));this.eventListeners.push(google.maps.event.addDomListener(this.div,"mouseover",(function(){t.div&&(t.div.style.cursor="default")})))}this.contextListener=google.maps.event.addDomListener(this.div,"contextmenu",(function(e){e.returnValue=!1,e.preventDefault&&e.preventDefault(),t.enableEventPropagation||i(e)})),google.maps.event.trigger(this,"domready")}},i.getCloseBoxImg=function(){var t="";return""!==this.closeBoxURL&&(t="<img",t+=" src='"+this.closeBoxURL+"'",t+=" align=right",t+=" style='",t+=" position: relative;",t+=" cursor: pointer;",t+=" margin: "+this.closeBoxMargin+";",t+="'>"),t},i.addClickHandler=function(){this.closeListener=this.div&&this.div.firstChild&&""!==this.closeBoxURL?google.maps.event.addDomListener(this.div.firstChild,"click",this.getCloseClickHandler()):null},i.getCloseClickHandler=function(){var t=this;return function(i){i.cancelBubble=!0,i.stopPropagation&&i.stopPropagation(),google.maps.event.trigger(t,"closeclick"),t.close()}},i.panBox=function(t){if(this.div&&!t){var i=this.getMap();if(i instanceof google.maps.Map){var e=0,s=0,o=i.getBounds();o&&!o.contains(this.position)&&i.setCenter(this.position);var n=i.getDiv(),h=n.offsetWidth,d=n.offsetHeight,l=this.pixelOffset.width,r=this.pixelOffset.height,a=this.div.offsetWidth,v=this.div.offsetHeight,p=this.infoBoxClearance.width,g=this.infoBoxClearance.height,f=this.getProjection().fromLatLngToContainerPixel(this.position);f.x<-l+p?e=f.x+l-p:f.x+a+l+p>h&&(e=f.x+a+l+p-h),this.alignBottom?f.y<-r+g+v?s=f.y+r-g-v:f.y+r+g>d&&(s=f.y+r+g-d):f.y<-r+g?s=f.y+r-g:f.y+v+r+g>d&&(s=f.y+v+r+g-d),0===e&&0===s||i.panBy(e,s)}}},i.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var t=this.boxStyle;for(var i in t)t.hasOwnProperty(i)&&(this.div.style[i]=t[i]);if(this.div.style.webkitTransform="translateZ(0)",void 0!==this.div.style.opacity&&""!==this.div.style.opacity){var e=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+100*e+')"',this.div.style.filter="alpha(opacity="+100*e+")"}this.div.style.position="absolute",this.div.style.visibility="hidden",null!==this.zIndex&&(this.div.style.zIndex=this.zIndex+""),this.div.style.overflow||(this.div.style.overflow="auto")}},i.getBoxWidths=function(){var t={top:0,bottom:0,left:0,right:0};if(!this.div)return t;if(document.defaultView&&document.defaultView.getComputedStyle){var i=this.div.ownerDocument,e=i&&i.defaultView?i.defaultView.getComputedStyle(this.div,""):null;e&&(t.top=parseInt(e.borderTopWidth||"",10)||0,t.bottom=parseInt(e.borderBottomWidth||"",10)||0,t.left=parseInt(e.borderLeftWidth||"",10)||0,t.right=parseInt(e.borderRightWidth||"",10)||0)}else if(document.documentElement.currentStyle){var s=this.div.currentStyle;s&&(t.top=parseInt(s.borderTopWidth||"",10)||0,t.bottom=parseInt(s.borderBottomWidth||"",10)||0,t.left=parseInt(s.borderLeftWidth||"",10)||0,t.right=parseInt(s.borderRightWidth||"",10)||0)}return t},i.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},i.draw=function(){if(this.createInfoBoxDiv(),this.div){var t=this.getProjection().fromLatLngToDivPixel(this.position);this.div.style.left=t.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(t.y+this.pixelOffset.height)+"px":this.div.style.top=t.y+this.pixelOffset.height+"px",this.div.style.visibility=this.isHidden?"hidden":"visible"}},i.setOptions=function(t){void 0===t&&(t={}),void 0!==t.boxClass&&(this.boxClass=t.boxClass,this.setBoxStyle()),void 0!==t.boxStyle&&(this.boxStyle=t.boxStyle,this.setBoxStyle()),void 0!==t.content&&this.setContent(t.content),void 0!==t.disableAutoPan&&(this.disableAutoPan=t.disableAutoPan),void 0!==t.maxWidth&&(this.maxWidth=t.maxWidth),void 0!==t.pixelOffset&&(this.pixelOffset=t.pixelOffset),void 0!==t.alignBottom&&(this.alignBottom=t.alignBottom),void 0!==t.position&&this.setPosition(t.position),void 0!==t.zIndex&&this.setZIndex(t.zIndex),void 0!==t.closeBoxMargin&&(this.closeBoxMargin=t.closeBoxMargin),void 0!==t.closeBoxURL&&(this.closeBoxURL=t.closeBoxURL),void 0!==t.infoBoxClearance&&(this.infoBoxClearance=t.infoBoxClearance),void 0!==t.isHidden&&(this.isHidden=t.isHidden),void 0!==t.visible&&(this.isHidden=!t.visible),void 0!==t.enableEventPropagation&&(this.enableEventPropagation=t.enableEventPropagation),this.div&&this.draw()},i.setContent=function(t){this.content=t,this.div&&(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.fixedWidthSet||(this.div.style.width=""),"string"==typeof t?this.div.innerHTML=this.getCloseBoxImg()+t:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(t)),this.fixedWidthSet||(this.div.style.width=this.div.offsetWidth+"px","string"==typeof t?this.div.innerHTML=this.getCloseBoxImg()+t:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(t))),this.addClickHandler()),google.maps.event.trigger(this,"content_changed")},i.setPosition=function(t){this.position=t,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},i.setVisible=function(t){this.isHidden=!t,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},i.setZIndex=function(t){this.zIndex=t,this.div&&(this.div.style.zIndex=t+""),google.maps.event.trigger(this,"zindex_changed")},i.getContent=function(){return this.content},i.getPosition=function(){return this.position},i.getZIndex=function(){return this.zIndex},i.getVisible=function(){return null!=this.getMap()&&!this.isHidden},i.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},i.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},i.open=function(t,i){var e=this;i&&(this.position=i.getPosition(),this.moveListener=google.maps.event.addListener(i,"position_changed",(function(){var t=i.getPosition();e.setPosition(t)})),this.mapListener=google.maps.event.addListener(i,"map_changed",(function(){e.setMap(i.map)}))),this.setMap(t),this.div&&this.panBox()},i.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var t=0;t<this.eventListeners.length;t++)google.maps.event.removeListener(this.eventListeners[t]);this.eventListeners=null}this.moveListener&&(google.maps.event.removeListener(this.moveListener),this.moveListener=null),this.mapListener&&(google.maps.event.removeListener(this.mapListener),this.mapListener=null),this.contextListener&&(google.maps.event.removeListener(this.contextListener),this.contextListener=null),this.setMap(null)},i.extend=function(t,i){return function(t){for(var i in t.prototype)this.prototype.hasOwnProperty(i)||(this.prototype[i]=t.prototype[i]);return this}.apply(t,[i])},t}()}));
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t=t||self).infoBox={})}(this,(function(t){"use strict";t.InfoBox=function(){function t(i){void 0===i&&(i={}),this.extend(t,google.maps.OverlayView),this.content=i.content||"",this.disableAutoPan=i.disableAutoPan||!1,this.maxWidth=i.maxWidth||0,this.pixelOffset=i.pixelOffset||new google.maps.Size(0,0),this.position=i.position||new google.maps.LatLng(0,0),this.zIndex=i.zIndex||null,this.boxClass=i.boxClass||"infoBox",this.boxStyle=i.boxStyle||{},this.closeBoxMargin=i.closeBoxMargin||"2px",this.closeBoxURL=i.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===i.closeBoxURL&&(this.closeBoxURL=""),this.infoBoxClearance=i.infoBoxClearance||new google.maps.Size(1,1),void 0===i.visible&&(i.visible=void 0===i.isHidden||!i.isHidden),this.isHidden=!i.visible,this.alignBottom=i.alignBottom||!1,this.pane=i.pane||"floatPane",this.enableEventPropagation=i.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}var i=t.prototype;return i.createInfoBoxDiv=function(){var t=this;function i(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation()}if(!this.div){if(this.div=document.createElement("div"),this.setBoxStyle(),"string"==typeof this.content?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content)),this.getPanes()[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(0!==this.maxWidth&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+"px",this.fixedWidthSet=!0;else{var e=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-e.left-e.right+"px",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var s=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],o=0;o<s.length;o++)this.eventListeners.push(google.maps.event.addDomListener(this.div,s[o],i));this.eventListeners.push(google.maps.event.addDomListener(this.div,"mouseover",(function(){t.div&&(t.div.style.cursor="default")})))}this.contextListener=google.maps.event.addDomListener(this.div,"contextmenu",(function(e){e.returnValue=!1,e.preventDefault&&e.preventDefault(),t.enableEventPropagation||i(e)})),google.maps.event.trigger(this,"domready")}},i.getCloseBoxImg=function(){var t="";return""!==this.closeBoxURL&&(t="<img",t+=" src='"+this.closeBoxURL+"'",t+=" align=right",t+=" style='",t+=" position: relative;",t+=" cursor: pointer;",t+=" margin: "+this.closeBoxMargin+";",t+="'>"),t},i.addClickHandler=function(){this.closeListener=this.div&&this.div.firstChild&&""!==this.closeBoxURL?google.maps.event.addDomListener(this.div.firstChild,"click",this.getCloseClickHandler()):null},i.getCloseClickHandler=function(){var t=this;return function(i){i.cancelBubble=!0,i.stopPropagation&&i.stopPropagation(),google.maps.event.trigger(t,"closeclick"),t.close()}},i.panBox=function(t){if(this.div&&!t){var i=this.getMap();if(i instanceof google.maps.Map){var e=0,s=0,o=i.getBounds();o&&!o.contains(this.position)&&i.setCenter(this.position);var n=i.getDiv(),h=n.offsetWidth,d=n.offsetHeight,l=this.pixelOffset.width,r=this.pixelOffset.height,a=this.div.offsetWidth,v=this.div.offsetHeight,p=this.infoBoxClearance.width,g=this.infoBoxClearance.height,f=this.getProjection().fromLatLngToContainerPixel(this.position);f.x<-l+p?e=f.x+l-p:f.x+a+l+p>h&&(e=f.x+a+l+p-h),this.alignBottom?f.y<-r+g+v?s=f.y+r-g-v:f.y+r+g>d&&(s=f.y+r+g-d):f.y<-r+g?s=f.y+r-g:f.y+v+r+g>d&&(s=f.y+v+r+g-d),0===e&&0===s||i.panBy(e,s)}}},i.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var t=this.boxStyle;for(var i in t)t.hasOwnProperty(i)&&(this.div.style[i]=t[i]);if(this.div.style.webkitTransform="translateZ(0)",void 0!==this.div.style.opacity&&""!==this.div.style.opacity){var e=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+100*e+')"',this.div.style.filter="alpha(opacity="+100*e+")"}this.div.style.position="absolute",this.div.style.visibility="hidden",null!==this.zIndex&&(this.div.style.zIndex=this.zIndex+""),this.div.style.overflow||(this.div.style.overflow="auto")}},i.getBoxWidths=function(){var t={top:0,bottom:0,left:0,right:0};if(!this.div)return t;if(document.defaultView&&document.defaultView.getComputedStyle){var i=this.div.ownerDocument,e=i&&i.defaultView?i.defaultView.getComputedStyle(this.div,""):null;e&&(t.top=parseInt(e.borderTopWidth||"",10)||0,t.bottom=parseInt(e.borderBottomWidth||"",10)||0,t.left=parseInt(e.borderLeftWidth||"",10)||0,t.right=parseInt(e.borderRightWidth||"",10)||0)}else if(document.documentElement.currentStyle){var s=this.div.currentStyle;s&&(t.top=parseInt(s.borderTopWidth||"",10)||0,t.bottom=parseInt(s.borderBottomWidth||"",10)||0,t.left=parseInt(s.borderLeftWidth||"",10)||0,t.right=parseInt(s.borderRightWidth||"",10)||0)}return t},i.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},i.draw=function(){if(this.createInfoBoxDiv(),this.div){var t=this.getProjection().fromLatLngToDivPixel(this.position);this.div.style.left=t.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(t.y+this.pixelOffset.height)+"px":this.div.style.top=t.y+this.pixelOffset.height+"px",this.div.style.visibility=this.isHidden?"hidden":"visible"}},i.setOptions=function(t){void 0===t&&(t={}),void 0!==t.boxClass&&(this.boxClass=t.boxClass,this.setBoxStyle()),void 0!==t.boxStyle&&(this.boxStyle=t.boxStyle,this.setBoxStyle()),void 0!==t.content&&this.setContent(t.content),void 0!==t.disableAutoPan&&(this.disableAutoPan=t.disableAutoPan),void 0!==t.maxWidth&&(this.maxWidth=t.maxWidth),void 0!==t.pixelOffset&&(this.pixelOffset=t.pixelOffset),void 0!==t.alignBottom&&(this.alignBottom=t.alignBottom),void 0!==t.position&&this.setPosition(t.position),void 0!==t.zIndex&&this.setZIndex(t.zIndex),void 0!==t.closeBoxMargin&&(this.closeBoxMargin=t.closeBoxMargin),void 0!==t.closeBoxURL&&(this.closeBoxURL=t.closeBoxURL),void 0!==t.infoBoxClearance&&(this.infoBoxClearance=t.infoBoxClearance),void 0!==t.isHidden&&(this.isHidden=t.isHidden),void 0!==t.visible&&(this.isHidden=!t.visible),void 0!==t.enableEventPropagation&&(this.enableEventPropagation=t.enableEventPropagation),this.div&&this.draw()},i.setContent=function(t){this.content=t,this.div&&(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.fixedWidthSet||(this.div.style.width=""),"string"==typeof t?this.div.innerHTML=this.getCloseBoxImg()+t:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(t)),this.fixedWidthSet||(this.div.style.width=this.div.offsetWidth+"px","string"==typeof t?this.div.innerHTML=this.getCloseBoxImg()+t:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(t))),this.addClickHandler()),google.maps.event.trigger(this,"content_changed")},i.setPosition=function(t){this.position=t,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},i.setVisible=function(t){this.isHidden=!t,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},i.setZIndex=function(t){this.zIndex=t,this.div&&(this.div.style.zIndex=t+""),google.maps.event.trigger(this,"zindex_changed")},i.getContent=function(){return this.content},i.getPosition=function(){return this.position},i.getZIndex=function(){return this.zIndex},i.getVisible=function(){return null!=this.getMap()&&!this.isHidden},i.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},i.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},i.open=function(t,i){var e=this;i&&(this.position=i.getPosition(),this.moveListener=google.maps.event.addListener(i,"position_changed",(function(){var t=i.getPosition();e.setPosition(t)})),this.mapListener=google.maps.event.addListener(i,"map_changed",(function(){e.setMap(i.map)}))),this.setMap(t),this.div&&this.panBox()},i.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var t=0;t<this.eventListeners.length;t++)google.maps.event.removeListener(this.eventListeners[t]);this.eventListeners=null}this.moveListener&&(google.maps.event.removeListener(this.moveListener),this.moveListener=null),this.mapListener&&(google.maps.event.removeListener(this.mapListener),this.mapListener=null),this.contextListener&&(google.maps.event.removeListener(this.contextListener),this.contextListener=null),this.setMap(null)},i.extend=function(t,i){return function(t){for(var i in t.prototype)this.prototype.hasOwnProperty(i)||(this.prototype[i]=t.prototype[i]);return this}.apply(t,[i])},t}(),Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=infobox.umd.production.min.js.map
{
"name": "@react-google-maps/infobox",
"sideEffects": false,
"version": "1.8.1",
"version": "1.8.2",
"description": "InfoBox for React.js Google Maps API",

@@ -52,3 +52,8 @@ "license": "MIT",

"@types/babel-types": "7.0.7",
"@types/googlemaps": "3.39.2",
"@types/react-dom": "16.9.4",
"@typescript-eslint/eslint-plugin": "2.16.0",
"@typescript-eslint/parser": "2.16.0",
"awesome-typescript-loader": "5.2.1",
"eslint": "6.8.0",
"eslint-config-standard": "14.1.0",

@@ -74,5 +79,14 @@ "eslint-config-standard-react": "9.2.0",

"eslint-plugin-standard": "4.0.1",
"eslint-plugin-you-dont-need-lodash-underscore": "6.8.0"
"eslint-plugin-you-dont-need-lodash-underscore": "6.8.0",
"jest": "24.9.0",
"jest-cli": "24.9.0",
"react": "16.12.0",
"react-dom": "16.12.0",
"rimraf": "3.0.0",
"ts-jest": "24.3.0",
"tsdx": "0.12.3",
"typescript": "3.7.5",
"webpack": "4.41.5"
},
"gitHead": "80167ddcc3d8e356dbf0b0c3a6292c6a3a989f83"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc