@react-google-maps/api
Advanced tools
Comparing version 1.9.4 to 1.9.5
# Changelog | ||
## 1.9.4 Compare between LatLng and LatLngLiteral with proper way in OverlayView | ||
## 1.9.5 Compare between LatLng and LatLngLiteral with proper way in OverlayView | ||
@@ -5,0 +5,0 @@ ## 1.9.3 fix Marker re-rendering in Cluster, fix MarkerClusterer performance |
@@ -1,2 +0,2 @@ | ||
"use strict";var t,e=require("react"),n=(t=require("invariant"))&&"object"==typeof t&&"default"in t?t.default:t,o=require("@react-google-maps/marker-clusterer"),r=require("react-dom"),s=require("@react-google-maps/infobox");function i(){return(i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function p(t,e){if(null==t)return{};var n,o,r={},s=Object.keys(t);for(o=0;o<s.length;o++)e.indexOf(n=s[o])>=0||(r[n]=t[n]);return r}var c=e.createContext(null);function l(t){google.maps.event.removeListener(t)}function u(t){void 0===t&&(t=[]),t.forEach(l)}function d(t){var e=t.updaterMap,n=t.prevProps,o=t.nextProps,r=t.instance,s=function(t,e,n){return o=n,Object.keys(o).reduce((function(n,r){return s=n,"function"==typeof t[i=r]&&s.push(google.maps.event.addListener(e,o[r],t[i])),s;var s,i}),[]);var o}(o,r,t.eventMap);return function(t,e,n,o){var r,s={};r=t,Object.keys(r).forEach((function(t){return function(t,r){var i=n[r];i!==e[r]&&(s[r]=i,t(o,i))}(r[t],t)}))}(e,n,o,r),s}var h={onDblClick:"dblclick",onDragEnd:"dragend",onDragStart:"dragstart",onMapTypeIdChanged:"maptypeid_changed",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseDown:"mousedown",onMouseUp:"mouseup",onRightClick:"rightclick",onTilesLoaded:"tilesloaded",onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onDrag:"drag",onHeadingChanged:"heading_changed",onIdle:"idle",onProjectionChanged:"projection_changed",onResize:"resize",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed"},g={extraMapTypes:function(t,e){e.forEach((function(e,n){t.mapTypes.set(String(n),e)}))},center:function(t,e){t.setCenter(e)},clickableIcons:function(t,e){t.setClickableIcons(e)},heading:function(t,e){t.setHeading(e)},mapTypeId:function(t,e){t.setMapTypeId(e)},options:function(t,e){t.setOptions(e)},streetView:function(t,e){t.setStreetView(e)},tilt:function(t,e){t.setTilt(e)},zoom:function(t,e){t.setZoom(e)}},f=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={map:null},e.registeredEvents=[],e.mapRef=null,e.getInstance=function(){return null===e.mapRef?null:new google.maps.Map(e.mapRef,e.props.options)},e.panTo=function(t){var n=e.getInstance();n&&n.panTo(t)},e.setMapCallback=function(){null!==e.state.map&&e.props.onLoad&&e.props.onLoad(e.state.map)},e.getRef=function(t){e.mapRef=t},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=this.getInstance();this.registeredEvents=d({updaterMap:g,eventMap:h,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{map:t}}),this.setMapCallback)},o.componentDidUpdate=function(t){null!==this.state.map&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:g,eventMap:h,prevProps:t,nextProps:this.props,instance:this.state.map}))},o.componentWillUnmount=function(){null!==this.state.map&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),u(this.registeredEvents))},o.render=function(){return e.createElement("div",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName},e.createElement(c.Provider,{value:this.state.map},null!==this.state.map?this.props.children:e.createElement(e.Fragment,null)))},n}(e.PureComponent),m="undefined"!=typeof document,v=function(t){var e=t.url,n=t.id;return m?new Promise((function(t,o){var r=document.getElementById(n),s=window;if(r){var i=r.getAttribute("data-state");if(r.src===e&&"error"!==i){if("ready"===i)return t(n);var a=s.initMap,p=r.onerror;return s.initMap=function(){a&&a(),t(n)},void(r.onerror=function(t){p&&p(t),o(t)})}r.remove()}var c=document.createElement("script");c.type="text/javascript",c.src=e,c.id=n,c.async=!0,c.onerror=function(t){c.setAttribute("data-state","error"),o(t)},s.initMap=function(){c.setAttribute("data-state","ready"),t(n)},document.head.appendChild(c)})).catch((function(t){throw console.error("injectScript error: ",t),t})):Promise.reject(new Error("document is undefined"))},y=function(t){return!((!t.href||0!==t.href.indexOf("https://fonts.googleapis.com/css?family=Roboto"))&&("style"===t.tagName.toLowerCase()&&t.styleSheet&&t.styleSheet.cssText&&0===t.styleSheet.cssText.replace("\r\n","").indexOf(".gm-style")?(t.styleSheet.cssText="",0):"style"===t.tagName.toLowerCase()&&t.innerHTML&&0===t.innerHTML.replace("\r\n","").indexOf(".gm-style")?(t.innerHTML="",0):"style"!==t.tagName.toLowerCase()||t.styleSheet||t.innerHTML))},M=function(){var t=document.getElementsByTagName("head")[0],e=t.insertBefore.bind(t);t.insertBefore=function(n,o){y(n)||Reflect.apply(e,t,[n,o])};var n=t.appendChild.bind(t);t.appendChild=function(e){y(e)||Reflect.apply(n,t,[e])}};function C(t){var e=t.googleMapsApiKey,o=t.googleMapsClientId,r=t.version,s=void 0===r?"weekly":r,i=t.language,a=t.region,p=t.libraries,c=t.channel,l=[];return e&&o||!e||!o||n(!1),e?l.push("key="+e):o&&l.push("client="+o),s&&l.push("v="+s),i&&l.push("language="+i),a&&l.push("region="+a),p&&p.length&&l.push("libraries="+p.sort().join(",")),c&&l.push("channel="+c),l.push("callback=initMap"),"https://maps.googleapis.com/maps/api/js?"+l.join("&")}var E=!1;function x(){return e.createElement("div",null,"Loading...")}var P,k={id:"script-loader",version:"weekly"},L=function(t){function o(){var o;return(o=t.apply(this,arguments)||this).check=e.createRef(),o.state={loaded:!1},o.cleanupCallback=function(){delete window.google,o.injectScript()},o.isCleaningUp=function(){try{return Promise.resolve(new Promise((function(t){if(E){if(m)var e=window.setInterval((function(){E||(window.clearInterval(e),t())}),1)}else t()})))}catch(t){return Promise.reject(t)}},o.cleanup=function(){E=!0;var t=document.getElementById(o.props.id);t&&t.parentNode&&t.parentNode.removeChild(t),Array.prototype.slice.call(document.getElementsByTagName("script")).filter((function(t){return"string"==typeof t.src&&t.src.includes("maps.googleapis")})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)})),Array.prototype.slice.call(document.getElementsByTagName("link")).filter((function(t){return"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"===t.href})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)})),Array.prototype.slice.call(document.getElementsByTagName("style")).filter((function(t){return void 0!==t.innerText&&t.innerText.length>0&&t.innerText.includes(".gm-")})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)}))},o.injectScript=function(){o.props.preventGoogleFontsLoading&&M(),o.props.id||n(!1);var t={id:o.props.id,url:C(o.props)};v(t).then((function(){o.props.onLoad&&o.props.onLoad(),o.setState((function(){return{loaded:!0}}))})).catch((function(t){o.props.onError&&o.props.onError(t),console.error("\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key ("+(o.props.googleMapsApiKey||"-")+") or Client ID ("+(o.props.googleMapsClientId||"-")+") to <LoadScript />\n Otherwise it is a Network issue.\n ")}))},o}a(o,t);var r=o.prototype;return r.componentDidMount=function(){if(m){if(window.google&&!E)return void console.error("google api is already presented");this.isCleaningUp().then(this.injectScript).catch((function(t){console.error("Error at injecting script after cleaning up: ",t)}))}},r.componentDidUpdate=function(t){this.props.libraries!==t.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),m&&t.language!==this.props.language&&(this.cleanup(),this.setState((function(){return{loaded:!1}}),this.cleanupCallback))},r.componentWillUnmount=function(){var t=this;m&&(this.cleanup(),window.setTimeout((function(){t.check.current||(delete window.google,E=!1)}),1),this.props.onUnmount&&this.props.onUnmount())},r.render=function(){return e.createElement(e.Fragment,null,e.createElement("div",{ref:this.check}),this.state.loaded?this.props.children:this.props.loadingElement||e.createElement(x,null))},o}(e.PureComponent);function w(t){var o=t.id,r=void 0===o?k.id:o,s=t.version,i=void 0===s?k.version:s,a=t.googleMapsApiKey,p=t.googleMapsClientId,c=t.language,l=t.region,u=t.libraries,d=t.preventGoogleFontsLoading,h=t.channel,g=e.useRef(!1),f=e.useState(!1),y=f[0],E=f[1],x=e.useState(void 0),L=x[0],w=x[1];e.useEffect((function(){return g.current=!0,function(){g.current=!1}}),[]),e.useEffect((function(){m&&d&&M()}),[d]),e.useEffect((function(){y&&(window.google||n(!1))}),[y]);var b=C({version:i,googleMapsApiKey:a,googleMapsClientId:p,language:c,region:l,libraries:u,channel:h});e.useEffect((function(){function t(){g.current&&(E(!0),P=b)}m&&(window.google&&P===b?t():v({id:r,url:b}).then(t).catch((function(t){g.current&&w(t),console.warn("\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key ("+(a||"-")+") or Client ID ("+(p||"-")+")\n Otherwise it is a Network issue.\n "),console.error(t)})))}),[r,b]);var S=e.useRef();return e.useEffect((function(){S.current&&u!==S.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),S.current=u}),[u]),{isLoaded:y,loadError:L,url:b}}L.defaultProps=k;var b=e.createElement(x,null);function S(t){var n=t.loadingElement,o=t.onLoad,r=t.onError,s=t.onUnmount,i=t.children,a=w(p(t,["loadingElement","onLoad","onError","onUnmount","children"])),c=a.isLoaded,l=a.loadError;return e.useEffect((function(){c&&"function"==typeof o&&o()}),[c,o]),e.useEffect((function(){l&&"function"==typeof r&&r(l)}),[l,r]),e.useEffect((function(){return function(){s&&s()}}),[s]),c?i:n||b}var D=e.memo(S),U={},O={options:function(t,e){t.setOptions(e)}},R=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={trafficLayer:null},e.setTrafficLayerCallback=function(){null!==e.state.trafficLayer&&e.props.onLoad&&e.props.onLoad(e.state.trafficLayer)},e.registeredEvents=[],e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.TrafficLayer(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:O,eventMap:U,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{trafficLayer:t}}),this.setTrafficLayerCallback)},n.componentDidUpdate=function(t){null!==this.state.trafficLayer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:O,eventMap:U,prevProps:t,nextProps:this.props,instance:this.state.trafficLayer}))},n.componentWillUnmount=function(){null!==this.state.trafficLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),u(this.registeredEvents),this.state.trafficLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);R.contextType=c;var T=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={bicyclingLayer:null},e.setBicyclingLayerCallback=function(){null!==e.state.bicyclingLayer&&(e.state.bicyclingLayer.setMap(e.context),e.props.onLoad&&e.props.onLoad(e.state.bicyclingLayer))},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.BicyclingLayer;this.setState((function(){return{bicyclingLayer:t}}),this.setBicyclingLayerCallback)},n.componentWillUnmount=function(){null!==this.state.bicyclingLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);T.contextType=c;var V=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={transitLayer:null},e.setTransitLayerCallback=function(){null!==e.state.transitLayer&&(e.state.transitLayer.setMap(e.context),e.props.onLoad&&e.props.onLoad(e.state.transitLayer))},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.TransitLayer;this.setState((function(){return{transitLayer:t}}),this.setTransitLayerCallback)},n.componentWillUnmount=function(){null!==this.state.transitLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);V.contextType=c;var I={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},_={drawingMode:function(t,e){t.setDrawingMode(e)},options:function(t,e){t.setOptions(e)}},B=function(t){function o(e){var o;return(o=t.call(this,e)||this).registeredEvents=[],o.state={drawingManager:null},o.setDrawingManagerCallback=function(){null!==o.state.drawingManager&&o.props.onLoad&&o.props.onLoad(o.state.drawingManager)},google.maps.drawing||n(!1),o}a(o,t);var r=o.prototype;return r.componentDidMount=function(){var t=new google.maps.drawing.DrawingManager(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:_,eventMap:I,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{drawingManager:t}}),this.setDrawingManagerCallback)},r.componentDidUpdate=function(t){null!==this.state.drawingManager&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:_,eventMap:I,prevProps:t,nextProps:this.props,instance:this.state.drawingManager}))},r.componentWillUnmount=function(){null!==this.state.drawingManager&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),u(this.registeredEvents),this.state.drawingManager.setMap(null))},r.render=function(){return e.createElement(e.Fragment,null)},o}(e.PureComponent);B.contextType=c;var W={onAnimationChanged:"animation_changed",onClick:"click",onClickableChanged:"clickable_changed",onCursorChanged:"cursor_changed",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDraggableChanged:"draggable_changed",onDragStart:"dragstart",onFlatChanged:"flat_changed",onIconChanged:"icon_changed",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onPositionChanged:"position_changed",onRightClick:"rightclick",onShapeChanged:"shape_changed",onTitleChanged:"title_changed",onVisibleChanged:"visible_changed",onZindexChanged:"zindex_changed"},A={animation:function(t,e){t.setAnimation(e)},clickable:function(t,e){t.setClickable(e)},cursor:function(t,e){t.setCursor(e)},draggable:function(t,e){t.setDraggable(e)},icon:function(t,e){t.setIcon(e)},label:function(t,e){t.setLabel(e)},map:function(t,e){t.setMap(e)},opacity:function(t,e){t.setOpacity(e)},options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},shape:function(t,e){t.setShape(e)},title:function(t,e){t.setTitle(e)},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},N=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={marker:null},e.setMarkerCallback=function(){null!==e.state.marker&&e.props.onLoad&&e.props.onLoad(e.state.marker)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=i({},this.props.options||{},{},this.props.clusterer?{}:{map:this.context},{position:this.props.position}),e=new google.maps.Marker(t);this.props.clusterer?this.props.clusterer.addMarker(e,!!this.props.noClustererRedraw):e.setMap(this.context),this.registeredEvents=d({updaterMap:A,eventMap:W,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{marker:e}}),this.setMarkerCallback)},o.componentDidUpdate=function(t){null!==this.state.marker&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:A,eventMap:W,prevProps:t,nextProps:this.props,instance:this.state.marker}))},o.componentWillUnmount=function(){null!==this.state.marker&&(this.props.onUnmount&&this.props.onUnmount(this.state.marker),u(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.state.marker,!!this.props.noClustererRedraw):this.state.marker&&this.state.marker.setMap(null))},o.render=function(){var t=this,n=null;return this.props.children&&(n=e.Children.map(this.props.children,(function(n){return e.isValidElement(n)?e.cloneElement(n,{anchor:t.state.marker}):n}))),n||null},n}(e.PureComponent);N.contextType=c;var j={onClick:"click",onClusteringBegin:"clusteringbegin",onClusteringEnd:"clusteringend",onMouseOut:"mouseout",onMouseOver:"mouseover"},z={averageCenter:function(t,e){t.setAverageCenter(e)},batchSizeIE:function(t,e){t.setBatchSizeIE(e)},calculator:function(t,e){t.setCalculator(e)},clusterClass:function(t,e){t.setClusterClass(e)},enableRetinaIcons:function(t,e){t.setEnableRetinaIcons(e)},gridSize:function(t,e){t.setGridSize(e)},ignoreHidden:function(t,e){t.setIgnoreHidden(e)},imageExtension:function(t,e){t.setImageExtension(e)},imagePath:function(t,e){t.setImagePath(e)},imageSizes:function(t,e){t.setImageSizes(e)},maxZoom:function(t,e){t.setMaxZoom(e)},minimumClusterSize:function(t,e){t.setMinimumClusterSize(e)},styles:function(t,e){t.setStyles(e)},title:function(t,e){t.setTitle(e)},zoomOnClick:function(t,e){t.setZoomOnClick(e)}},F=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={markerClusterer:null},e.setClustererCallback=function(){null!==e.state.markerClusterer&&e.props.onLoad&&e.props.onLoad(e.state.markerClusterer)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){if(this.context){var t=new o.Clusterer(this.context,[],this.props.options);this.registeredEvents=d({updaterMap:z,eventMap:j,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{markerClusterer:t}}),this.setClustererCallback)}},n.componentDidUpdate=function(t){this.state.markerClusterer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:z,eventMap:j,prevProps:t,nextProps:this.props,instance:this.state.markerClusterer}))},n.componentWillUnmount=function(){null!==this.state.markerClusterer&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),u(this.registeredEvents),this.state.markerClusterer.setMap(null))},n.render=function(){return null!==this.state.markerClusterer?this.props.children(this.state.markerClusterer):null},e}(e.PureComponent);F.contextType=c;var G={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},Z={options:function(t,e){t.setOptions(e)},position:function(t,e){e instanceof google.maps.LatLng?t.setPosition(e):t.setPosition(new google.maps.LatLng(e.lat,e.lng))},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},H=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.containerElement=null,e.state={infoBox:null},e.open=function(t,o){o?t.open(e.context,o):t.getPosition()?t.open(e.context):n(!1)},e.setInfoBoxCallback=function(){var t=e.props,n=t.anchor,o=t.onLoad,r=e.state.infoBox;null!==r&&null!==e.containerElement&&(r.setContent(e.containerElement),e.open(r,n),o&&o(r))},e}a(o,t);var c=o.prototype;return c.componentDidMount=function(){var t,e=this.props.options||{},n=e.position,o=p(e,["position"]);!n||n instanceof google.maps.LatLng||(t=new google.maps.LatLng(n.lat,n.lng));var r=new s.InfoBox(i({},o,{},t?{position:t}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=d({updaterMap:Z,eventMap:G,prevProps:{},nextProps:this.props,instance:r}),this.setState({infoBox:r},this.setInfoBoxCallback)},c.componentDidUpdate=function(t){var e=this.state.infoBox;null!==e&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Z,eventMap:G,prevProps:t,nextProps:this.props,instance:e}))},c.componentWillUnmount=function(){var t=this.props.onUnmount,e=this.state.infoBox;null!==e&&(t&&t(e),u(this.registeredEvents),e.close())},c.render=function(){return this.containerElement?r.createPortal(e.Children.only(this.props.children),this.containerElement):null},o}(e.PureComponent);H.contextType=c;var K={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},q={options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},zIndex:function(t,e){t.setZIndex(e)}},Y=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.containerElement=null,e.state={infoWindow:null},e.open=function(t,o){o?t.open(e.context,o):t.getPosition()?t.open(e.context):n(!1)},e.setInfoWindowCallback=function(){null!==e.state.infoWindow&&null!==e.containerElement&&(e.state.infoWindow.setContent(e.containerElement),e.open(e.state.infoWindow,e.props.anchor),e.props.onLoad&&e.props.onLoad(e.state.infoWindow))},e}a(o,t);var s=o.prototype;return s.componentDidMount=function(){var t=new google.maps.InfoWindow(i({},this.props.options||{}));this.containerElement=document.createElement("div"),this.registeredEvents=d({updaterMap:q,eventMap:K,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{infoWindow:t}}),this.setInfoWindowCallback)},s.componentDidUpdate=function(t){null!==this.state.infoWindow&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:q,eventMap:K,prevProps:t,nextProps:this.props,instance:this.state.infoWindow}))},s.componentWillUnmount=function(){null!==this.state.infoWindow&&(u(this.registeredEvents),this.state.infoWindow.close())},s.render=function(){return this.containerElement?r.createPortal(e.Children.only(this.props.children),this.containerElement):e.createElement(e.Fragment,null)},o}(e.PureComponent);Y.contextType=c;var J={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},Q={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},visible:function(t,e){t.setVisible(e)}},X=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={polyline:null},e.setPolylineCallback=function(){null!==e.state.polyline&&e.props.onLoad&&e.props.onLoad(e.state.polyline)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.Polyline(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:Q,eventMap:J,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{polyline:t}}),this.setPolylineCallback)},o.componentDidUpdate=function(t){null!==this.state.polyline&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Q,eventMap:J,prevProps:t,nextProps:this.props,instance:this.state.polyline}))},o.componentWillUnmount=function(){null!==this.state.polyline&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),u(this.registeredEvents),this.state.polyline.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);X.contextType=c;var $={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},tt={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},paths:function(t,e){t.setPaths(e)},visible:function(t,e){t.setVisible(e)}},et=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={polygon:null},e.setPolygonCallback=function(){null!==e.state.polygon&&e.props.onLoad&&e.props.onLoad(e.state.polygon)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.Polygon(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:tt,eventMap:$,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{polygon:t}}),this.setPolygonCallback)},n.componentDidUpdate=function(t){null!==this.state.polygon&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:tt,eventMap:$,prevProps:t,nextProps:this.props,instance:this.state.polygon}))},n.componentWillUnmount=function(){null!==this.state.polygon&&(this.props.onUnmount&&this.props.onUnmount(this.state.polygon),u(this.registeredEvents),this.state.polygon&&this.state.polygon.setMap(null))},n.render=function(){return null},e}(e.PureComponent);et.contextType=c;var nt={onBoundsChanged:"bounds_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},ot={bounds:function(t,e){t.setBounds(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},visible:function(t,e){t.setVisible(e)}},rt=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={rectangle:null},e.setRectangleCallback=function(){null!==e.state.rectangle&&e.props.onLoad&&e.props.onLoad(e.state.rectangle)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.Rectangle(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:ot,eventMap:nt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{rectangle:t}}),this.setRectangleCallback)},o.componentDidUpdate=function(t){null!==this.state.rectangle&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:ot,eventMap:nt,prevProps:t,nextProps:this.props,instance:this.state.rectangle}))},o.componentWillUnmount=function(){null!==this.state.rectangle&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),u(this.registeredEvents),this.state.rectangle.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);rt.contextType=c;var st={onCenterChanged:"center_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRadiusChanged:"radius_changed",onRightClick:"rightclick"},it={center:function(t,e){t.setCenter(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},radius:function(t,e){t.setRadius(e)},visible:function(t,e){t.setVisible(e)}},at=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={circle:null},e.setCircleCallback=function(){null!==e.state.circle&&e.props.onLoad&&e.props.onLoad(e.state.circle)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.Circle(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:it,eventMap:st,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{circle:t}}),this.setCircleCallback)},o.componentDidUpdate=function(t){null!==this.state.circle&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:it,eventMap:st,prevProps:t,nextProps:this.props,instance:this.state.circle}))},o.componentWillUnmount=function(){null!==this.state.circle&&(this.props.onUnmount&&this.props.onUnmount(this.state.circle),u(this.registeredEvents),this.state.circle&&this.state.circle.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);at.contextType=c;var pt={onAddFeature:"addfeature",onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onRightClick:"rightclick",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},ct={add:function(t,e){t.add(e)},addgeojson:function(t,e,n){t.addGeoJson(e,n)},contains:function(t,e){t.contains(e)},foreach:function(t,e){t.forEach(e)},loadgeojson:function(t,e,n,o){t.loadGeoJson(e,n,o)},overridestyle:function(t,e,n){t.overrideStyle(e,n)},remove:function(t,e){t.remove(e)},revertstyle:function(t,e){t.revertStyle(e)},controlposition:function(t,e){t.setControlPosition(e)},controls:function(t,e){t.setControls(e)},drawingmode:function(t,e){t.setDrawingMode(e)},map:function(t,e){t.setMap(e)},style:function(t,e){t.setStyle(e)},togeojson:function(t,e){t.toGeoJson(e)}},lt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={data:null},e.setDataCallback=function(){null!==e.state.data&&e.props.onLoad&&e.props.onLoad(e.state.data)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.Data(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:ct,eventMap:pt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{data:t}}),this.setDataCallback)},n.componentDidUpdate=function(t){null!==this.state.data&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:ct,eventMap:pt,prevProps:t,nextProps:this.props,instance:this.state.data}))},n.componentWillUnmount=function(){null!==this.state.data&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),u(this.registeredEvents),this.state.data&&this.state.data.setMap(null))},n.render=function(){return null},e}(e.PureComponent);lt.contextType=c;var ut={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},dt={options:function(t,e){t.setOptions(e)},url:function(t,e){t.setUrl(e)},zIndex:function(t,e){t.setZIndex(e)}},ht=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={kmlLayer:null},e.setKmlLayerCallback=function(){null!==e.state.kmlLayer&&e.props.onLoad&&e.props.onLoad(e.state.kmlLayer)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.KmlLayer(i({},this.props.options,{map:this.context}));this.registeredEvents=d({updaterMap:dt,eventMap:ut,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{kmlLayer:t}}),this.setKmlLayerCallback)},n.componentDidUpdate=function(t){null!==this.state.kmlLayer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:dt,eventMap:ut,prevProps:t,nextProps:this.props,instance:this.state.kmlLayer}))},n.componentWillUnmount=function(){null!==this.state.kmlLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),u(this.registeredEvents),this.state.kmlLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);ht.contextType=c;var gt=function(t,e){return new e(t.lat,t.lng)},ft=function(t,e){return new e(new google.maps.LatLng(t.ne.lat,t.ne.lng),new google.maps.LatLng(t.sw.lat,t.sw.lng))},mt=function(t,e,n){return t instanceof e?t:n(t,e)},vt=function(t){function e(){return t.apply(this,arguments)||this}a(e,t);var n=e.prototype;return n.componentDidMount=function(){this.props.onLoad&&this.props.onLoad()},n.render=function(){return this.props.children},e}(e.Component);function yt(t){return t instanceof google.maps.LatLng?t:t?new google.maps.LatLng(t.lat,t.lng):t}function Mt(t){return t instanceof google.maps.LatLngBounds?t:t?new google.maps.LatLngBounds(new google.maps.LatLng(t.south,t.east),new google.maps.LatLng(t.north,t.west)):t}var Ct=function(t){function o(o){var r;return(r=t.call(this,o)||this).state={overlayView:null,containerStyle:{}},r.mapPaneEl=null,r.setOverlayViewCallback=function(){null!==r.state.overlayView&&r.props.onLoad&&r.props.onLoad(r.state.overlayView),r.onPositionElement()},r.onAdd=function(){var t;r.props.mapPaneName||n(!1);var e=null===(t=r.state.overlayView)||void 0===t?void 0:t.getPanes();e&&(r.mapPaneEl=e[r.props.mapPaneName])},r.onPositionElement=function(){if(null!==r.state.overlayView){var t=(e=r.state.overlayView.getProjection(),n=i({x:0,y:0},r.containerRef.current?(a=r.containerRef.current,"function"==typeof(p=r.props.getPixelPositionOffset)?p(a.offsetWidth,a.offsetHeight):{}):{}),s=r.props.position,void 0!==(o=r.props.bounds)?function(t,e,n){var o=t.fromLatLngToDivPixel(n.getNorthEast()),r=t.fromLatLngToDivPixel(n.getSouthWest());return o&&r?{left:r.x+e.x+"px",top:o.y+e.y+"px",width:o.x-r.x-e.x+"px",height:r.y-o.y-e.y+"px"}:{left:"-9999px",top:"-9999px"}}(e,n,mt(o,google.maps.LatLngBounds,ft)):function(t,e,n){var o=t.fromLatLngToDivPixel(n);return o?{left:o.x+e.x+"px",top:o.y+e.y+"px"}:{left:"-9999px",top:"-9999px"}}(e,n,mt(s,google.maps.LatLng,gt)));r.setState({containerStyle:t})}var e,n,o,s,a,p},r.draw=function(){r.onPositionElement()},r.onRemove=function(){r.mapPaneEl=null},r.containerRef=e.createRef(),r}a(o,t);var s=o.prototype;return s.componentDidMount=function(){var t=new google.maps.OverlayView;t.onAdd=this.onAdd,t.draw=this.draw,t.onRemove=this.onRemove,t.setMap(this.context),this.setState((function(){return{overlayView:t}}))},s.componentDidUpdate=function(t){var e=this,n=yt(t.position),o=yt(this.props.position),r=Mt(t.bounds),s=Mt(this.props.bounds);n===o&&r===s||setTimeout((function(){null!==e.state.overlayView&&e.state.overlayView.draw()}),0)},s.componentWillUnmount=function(){null!==this.state.overlayView&&(this.props.onUnmount&&this.props.onUnmount(this.state.overlayView),this.state.overlayView.setMap(null))},s.render=function(){return this.mapPaneEl?r.createPortal(e.createElement("div",{ref:this.containerRef,style:i({},this.state.containerStyle,{position:"absolute"})},e.createElement(vt,{onLoad:this.setOverlayViewCallback},e.Children.only(this.props.children))),this.mapPaneEl):e.createElement(e.Fragment,null)},o}(e.PureComponent);Ct.FLOAT_PANE="floatPane",Ct.MAP_PANE="mapPane",Ct.MARKER_LAYER="markerLayer",Ct.OVERLAY_LAYER="overlayLayer",Ct.OVERLAY_MOUSE_TARGET="overlayMouseTarget",Ct.contextType=c;var Et={onDblClick:"dblclick",onClick:"click"},xt={opacity:function(t,e){t.setOpacity(e)}},Pt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={groundOverlay:null},e.setGroundOverlayCallback=function(){null!==e.state.groundOverlay&&e.props.onLoad&&e.props.onLoad(e.state.groundOverlay)},e}a(e,t);var o=e.prototype;return o.componentDidMount=function(){this.props.url||this.props.bounds||n(!1);var t=new google.maps.GroundOverlay(this.props.url,this.props.bounds,i({},this.props.options,{map:this.context}));this.registeredEvents=d({updaterMap:xt,eventMap:Et,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{groundOverlay:t}}),this.setGroundOverlayCallback)},o.componentDidUpdate=function(t){null!==this.state.groundOverlay&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:xt,eventMap:Et,prevProps:t,nextProps:this.props,instance:this.state.groundOverlay}))},o.componentWillUnmount=function(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))},o.render=function(){return null},e}(e.PureComponent);Pt.defaultProps={onLoad:function(){}},Pt.contextType=c;var kt={},Lt={data:function(t,e){t.setData(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)}},wt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={heatmapLayer:null},e.setHeatmapLayerCallback=function(){null!==e.state.heatmapLayer&&e.props.onLoad&&e.props.onLoad(e.state.heatmapLayer)},e}a(e,t);var o=e.prototype;return o.componentDidMount=function(){google.maps.visualization||n(!1),this.props.data||n(!1);var t=new google.maps.visualization.HeatmapLayer(i({},this.props.options||{},{data:this.props.data,map:this.context}));this.registeredEvents=d({updaterMap:Lt,eventMap:kt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{heatmapLayer:t}}),this.setHeatmapLayerCallback)},o.componentDidUpdate=function(t){u(this.registeredEvents),this.registeredEvents=d({updaterMap:Lt,eventMap:kt,prevProps:t,nextProps:this.props,instance:this.state.heatmapLayer})},o.componentWillUnmount=function(){null!==this.state.heatmapLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),u(this.registeredEvents),this.state.heatmapLayer.setMap(null))},o.render=function(){return null},e}(e.PureComponent);wt.contextType=c;var bt={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},St={register:function(t,e,n){t.registerPanoProvider(e,n)},links:function(t,e){t.setLinks(e)},motionTracking:function(t,e){t.setMotionTracking(e)},options:function(t,e){t.setOptions(e)},pano:function(t,e){t.setPano(e)},position:function(t,e){t.setPosition(e)},pov:function(t,e){t.setPov(e)},visible:function(t,e){t.setVisible(e)},zoom:function(t,e){t.setZoom(e)}},Dt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={streetViewPanorama:null},e.setStreetViewPanoramaCallback=function(){null!==e.state.streetViewPanorama&&e.props.onLoad&&e.props.onLoad(e.state.streetViewPanorama)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=this.context.getStreetView();this.registeredEvents=d({updaterMap:St,eventMap:bt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{streetViewPanorama:t}}),this.setStreetViewPanoramaCallback)},n.componentDidUpdate=function(t){null!==this.state.streetViewPanorama&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:St,eventMap:bt,prevProps:t,nextProps:this.props,instance:this.state.streetViewPanorama}))},n.componentWillUnmount=function(){null!==this.state.streetViewPanorama&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),u(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))},n.render=function(){return null},e}(e.PureComponent);Dt.contextType=c;var Ut=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={streetViewService:null},e.setStreetViewServiceCallback=function(){null!==e.state.streetViewService&&e.props.onLoad&&e.props.onLoad(e.state.streetViewService)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.StreetViewService;this.setState((function(){return{streetViewService:t}}),this.setStreetViewServiceCallback)},n.componentWillUnmount=function(){null!==this.state.streetViewService&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)},n.render=function(){return null},e}(e.PureComponent);Ut.contextType=c;var Ot=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).state={directionsService:null},e.setDirectionsServiceCallback=function(){null!==e.state.directionsService&&e.props.onLoad&&e.props.onLoad(e.state.directionsService)},e}a(o,t);var r=o.prototype;return r.componentDidMount=function(){this.props.options||n(!1);var t=new google.maps.DirectionsService;this.setState((function(){return{directionsService:t}}),this.setDirectionsServiceCallback)},r.componentDidUpdate=function(){null!==this.state.directionsService&&this.state.directionsService.route(this.props.options,this.props.callback)},r.componentWillUnmount=function(){null!==this.state.directionsService&&this.props.onUnmount&&this.props.onUnmount(this.state.directionsService)},r.render=function(){return e.createElement(e.Fragment,null)},o}(e.PureComponent),Rt={onDirectionsChanged:"directions_changed"},Tt={directions:function(t,e){t.setDirections(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},panel:function(t,e){t.setPanel(e)},routeIndex:function(t,e){t.setRouteIndex(e)}},Vt=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={directionsRenderer:null},e.setDirectionsRendererCallback=function(){null!==e.state.directionsRenderer&&(e.state.directionsRenderer.setMap(e.context),e.props.onLoad&&e.props.onLoad(e.state.directionsRenderer))},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=d({updaterMap:Tt,eventMap:Rt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{directionsRenderer:t}}),this.setDirectionsRendererCallback)},o.componentDidUpdate=function(t){null!==this.state.directionsRenderer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Tt,eventMap:Rt,prevProps:t,nextProps:this.props,instance:this.state.directionsRenderer}))},o.componentWillUnmount=function(){null!==this.state.directionsRenderer&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),u(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);Vt.contextType=c;var It=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).state={distanceMatrixService:null},e.setDistanceMatrixServiceCallback=function(){null!==e.state.distanceMatrixService&&e.props.onLoad&&e.props.onLoad(e.state.distanceMatrixService)},e}a(o,t);var r=o.prototype;return r.componentDidMount=function(){this.props.options||n(!1);var t=new google.maps.DistanceMatrixService;this.setState((function(){return{distanceMatrixService:t}}),this.setDistanceMatrixServiceCallback)},r.componentDidUpdate=function(){null!==this.state.distanceMatrixService&&this.state.distanceMatrixService.getDistanceMatrix(this.props.options,this.props.callback)},r.componentWillUnmount=function(){null!==this.state.distanceMatrixService&&this.props.onUnmount&&this.props.onUnmount(this.state.distanceMatrixService)},r.render=function(){return e.createElement(e.Fragment,null)},o}(e.PureComponent),_t={onPlacesChanged:"places_changed"},Bt={bounds:function(t,e){t.setBounds(e)}},Wt=function(t){function o(){var n;return(n=t.apply(this,arguments)||this).registeredEvents=[],n.containerElement=e.createRef(),n.state={searchBox:null},n.setSearchBoxCallback=function(){null!==n.state.searchBox&&n.props.onLoad&&n.props.onLoad(n.state.searchBox)},n}a(o,t);var r=o.prototype;return r.componentDidMount=function(){if(google.maps.places||n(!1),null!==this.containerElement&&null!==this.containerElement.current){var t=this.containerElement.current.querySelector("input");if(null!==t){var e=new google.maps.places.SearchBox(t,this.props.options);this.registeredEvents=d({updaterMap:Bt,eventMap:_t,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{searchBox:e}}),this.setSearchBoxCallback)}}},r.componentDidUpdate=function(t){null!==this.state.searchBox&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Bt,eventMap:_t,prevProps:t,nextProps:this.props,instance:this.state.searchBox}))},r.componentWillUnmount=function(){null!==this.state.searchBox&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),u(this.registeredEvents))},r.render=function(){return e.createElement("div",{ref:this.containerElement},e.Children.only(this.props.children))},o}(e.PureComponent);Wt.contextType=c;var At={onPlaceChanged:"place_changed"},Nt={bounds:function(t,e){t.setBounds(e)},restrictions:function(t,e){t.setComponentRestrictions(e)},fields:function(t,e){t.setFields(e)},options:function(t,e){t.setOptions(e)},types:function(t,e){t.setTypes(e)}},jt=function(t){function o(){var n;return(n=t.apply(this,arguments)||this).registeredEvents=[],n.containerElement=e.createRef(),n.state={autocomplete:null},n.setAutocompleteCallback=function(){null!==n.state.autocomplete&&n.props.onLoad&&n.props.onLoad(n.state.autocomplete)},n}a(o,t);var r=o.prototype;return r.componentDidMount=function(){google.maps.places||n(!1);var t=this.containerElement.current.querySelector("input");if(t){var e=new google.maps.places.Autocomplete(t,this.props.options);this.registeredEvents=d({updaterMap:Nt,eventMap:At,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{autocomplete:e}}),this.setAutocompleteCallback)}},r.componentDidUpdate=function(t){u(this.registeredEvents),this.registeredEvents=d({updaterMap:Nt,eventMap:At,prevProps:t,nextProps:this.props,instance:this.state.autocomplete})},r.componentWillUnmount=function(){null!==this.state.autocomplete&&u(this.registeredEvents)},r.render=function(){return e.createElement("div",{ref:this.containerElement},e.Children.only(this.props.children))},o}(e.PureComponent);jt.contextType=c,exports.Autocomplete=jt,exports.BicyclingLayer=T,exports.Circle=at,exports.Data=lt,exports.DirectionsRenderer=Vt,exports.DirectionsService=Ot,exports.DistanceMatrixService=It,exports.DrawingManager=B,exports.GoogleMap=f,exports.GroundOverlay=Pt,exports.HeatmapLayer=wt,exports.InfoBox=H,exports.InfoWindow=Y,exports.KmlLayer=ht,exports.LoadScript=L,exports.LoadScriptNext=D,exports.MapContext=c,exports.Marker=N,exports.MarkerClusterer=F,exports.OverlayView=Ct,exports.Polygon=et,exports.Polyline=X,exports.Rectangle=rt,exports.StandaloneSearchBox=Wt,exports.StreetViewPanorama=Dt,exports.StreetViewService=Ut,exports.TrafficLayer=R,exports.TransitLayer=V,exports.useGoogleMap=function(){e.useContext||n(!1);var t=e.useContext(c);return t||n(!1),t},exports.useLoadScript=w; | ||
"use strict";var t,e=require("react"),n=(t=require("invariant"))&&"object"==typeof t&&"default"in t?t.default:t,o=require("@react-google-maps/marker-clusterer"),r=require("react-dom"),s=require("@react-google-maps/infobox");function i(){return(i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function p(t,e){if(null==t)return{};var n,o,r={},s=Object.keys(t);for(o=0;o<s.length;o++)e.indexOf(n=s[o])>=0||(r[n]=t[n]);return r}var c=e.createContext(null);function l(t){google.maps.event.removeListener(t)}function u(t){void 0===t&&(t=[]),t.forEach(l)}function d(t){var e=t.updaterMap,n=t.prevProps,o=t.nextProps,r=t.instance,s=function(t,e,n){return o=n,Object.keys(o).reduce((function(n,r){return s=n,"function"==typeof t[i=r]&&s.push(google.maps.event.addListener(e,o[r],t[i])),s;var s,i}),[]);var o}(o,r,t.eventMap);return function(t,e,n,o){var r,s={};r=t,Object.keys(r).forEach((function(t){return function(t,r){var i=n[r];i!==e[r]&&(s[r]=i,t(o,i))}(r[t],t)}))}(e,n,o,r),s}var h={onDblClick:"dblclick",onDragEnd:"dragend",onDragStart:"dragstart",onMapTypeIdChanged:"maptypeid_changed",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseDown:"mousedown",onMouseUp:"mouseup",onRightClick:"rightclick",onTilesLoaded:"tilesloaded",onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onDrag:"drag",onHeadingChanged:"heading_changed",onIdle:"idle",onProjectionChanged:"projection_changed",onResize:"resize",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed"},g={extraMapTypes:function(t,e){e.forEach((function(e,n){t.mapTypes.set(String(n),e)}))},center:function(t,e){t.setCenter(e)},clickableIcons:function(t,e){t.setClickableIcons(e)},heading:function(t,e){t.setHeading(e)},mapTypeId:function(t,e){t.setMapTypeId(e)},options:function(t,e){t.setOptions(e)},streetView:function(t,e){t.setStreetView(e)},tilt:function(t,e){t.setTilt(e)},zoom:function(t,e){t.setZoom(e)}},f=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={map:null},e.registeredEvents=[],e.mapRef=null,e.getInstance=function(){return null===e.mapRef?null:new google.maps.Map(e.mapRef,e.props.options)},e.panTo=function(t){var n=e.getInstance();n&&n.panTo(t)},e.setMapCallback=function(){null!==e.state.map&&e.props.onLoad&&e.props.onLoad(e.state.map)},e.getRef=function(t){e.mapRef=t},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=this.getInstance();this.registeredEvents=d({updaterMap:g,eventMap:h,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{map:t}}),this.setMapCallback)},o.componentDidUpdate=function(t){null!==this.state.map&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:g,eventMap:h,prevProps:t,nextProps:this.props,instance:this.state.map}))},o.componentWillUnmount=function(){null!==this.state.map&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),u(this.registeredEvents))},o.render=function(){return e.createElement("div",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName},e.createElement(c.Provider,{value:this.state.map},null!==this.state.map?this.props.children:e.createElement(e.Fragment,null)))},n}(e.PureComponent),m="undefined"!=typeof document,v=function(t){var e=t.url,n=t.id;return m?new Promise((function(t,o){var r=document.getElementById(n),s=window;if(r){var i=r.getAttribute("data-state");if(r.src===e&&"error"!==i){if("ready"===i)return t(n);var a=s.initMap,p=r.onerror;return s.initMap=function(){a&&a(),t(n)},void(r.onerror=function(t){p&&p(t),o(t)})}r.remove()}var c=document.createElement("script");c.type="text/javascript",c.src=e,c.id=n,c.async=!0,c.onerror=function(t){c.setAttribute("data-state","error"),o(t)},s.initMap=function(){c.setAttribute("data-state","ready"),t(n)},document.head.appendChild(c)})).catch((function(t){throw console.error("injectScript error: ",t),t})):Promise.reject(new Error("document is undefined"))},y=function(t){return!((!t.href||0!==t.href.indexOf("https://fonts.googleapis.com/css?family=Roboto"))&&("style"===t.tagName.toLowerCase()&&t.styleSheet&&t.styleSheet.cssText&&0===t.styleSheet.cssText.replace("\r\n","").indexOf(".gm-style")?(t.styleSheet.cssText="",0):"style"===t.tagName.toLowerCase()&&t.innerHTML&&0===t.innerHTML.replace("\r\n","").indexOf(".gm-style")?(t.innerHTML="",0):"style"!==t.tagName.toLowerCase()||t.styleSheet||t.innerHTML))},M=function(){var t=document.getElementsByTagName("head")[0],e=t.insertBefore.bind(t);t.insertBefore=function(n,o){y(n)||Reflect.apply(e,t,[n,o])};var n=t.appendChild.bind(t);t.appendChild=function(e){y(e)||Reflect.apply(n,t,[e])}};function C(t){var e=t.googleMapsApiKey,o=t.googleMapsClientId,r=t.version,s=void 0===r?"weekly":r,i=t.language,a=t.region,p=t.libraries,c=t.channel,l=[];return e&&o||!e||!o||n(!1),e?l.push("key="+e):o&&l.push("client="+o),s&&l.push("v="+s),i&&l.push("language="+i),a&&l.push("region="+a),p&&p.length&&l.push("libraries="+p.sort().join(",")),c&&l.push("channel="+c),l.push("callback=initMap"),"https://maps.googleapis.com/maps/api/js?"+l.join("&")}var E=!1;function x(){return e.createElement("div",null,"Loading...")}var P,k={id:"script-loader",version:"weekly"},L=function(t){function o(){var o;return(o=t.apply(this,arguments)||this).check=e.createRef(),o.state={loaded:!1},o.cleanupCallback=function(){delete window.google,o.injectScript()},o.isCleaningUp=function(){try{return Promise.resolve(new Promise((function(t){if(E){if(m)var e=window.setInterval((function(){E||(window.clearInterval(e),t())}),1)}else t()})))}catch(t){return Promise.reject(t)}},o.cleanup=function(){E=!0;var t=document.getElementById(o.props.id);t&&t.parentNode&&t.parentNode.removeChild(t),Array.prototype.slice.call(document.getElementsByTagName("script")).filter((function(t){return"string"==typeof t.src&&t.src.includes("maps.googleapis")})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)})),Array.prototype.slice.call(document.getElementsByTagName("link")).filter((function(t){return"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"===t.href})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)})),Array.prototype.slice.call(document.getElementsByTagName("style")).filter((function(t){return void 0!==t.innerText&&t.innerText.length>0&&t.innerText.includes(".gm-")})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)}))},o.injectScript=function(){o.props.preventGoogleFontsLoading&&M(),o.props.id||n(!1);var t={id:o.props.id,url:C(o.props)};v(t).then((function(){o.props.onLoad&&o.props.onLoad(),o.setState((function(){return{loaded:!0}}))})).catch((function(t){o.props.onError&&o.props.onError(t),console.error("\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key ("+(o.props.googleMapsApiKey||"-")+") or Client ID ("+(o.props.googleMapsClientId||"-")+") to <LoadScript />\n Otherwise it is a Network issue.\n ")}))},o}a(o,t);var r=o.prototype;return r.componentDidMount=function(){if(m){if(window.google&&!E)return void console.error("google api is already presented");this.isCleaningUp().then(this.injectScript).catch((function(t){console.error("Error at injecting script after cleaning up: ",t)}))}},r.componentDidUpdate=function(t){this.props.libraries!==t.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),m&&t.language!==this.props.language&&(this.cleanup(),this.setState((function(){return{loaded:!1}}),this.cleanupCallback))},r.componentWillUnmount=function(){var t=this;m&&(this.cleanup(),window.setTimeout((function(){t.check.current||(delete window.google,E=!1)}),1),this.props.onUnmount&&this.props.onUnmount())},r.render=function(){return e.createElement(e.Fragment,null,e.createElement("div",{ref:this.check}),this.state.loaded?this.props.children:this.props.loadingElement||e.createElement(x,null))},o}(e.PureComponent);function w(t){var o=t.id,r=void 0===o?k.id:o,s=t.version,i=void 0===s?k.version:s,a=t.googleMapsApiKey,p=t.googleMapsClientId,c=t.language,l=t.region,u=t.libraries,d=t.preventGoogleFontsLoading,h=t.channel,g=e.useRef(!1),f=e.useState(!1),y=f[0],E=f[1],x=e.useState(void 0),L=x[0],w=x[1];e.useEffect((function(){return g.current=!0,function(){g.current=!1}}),[]),e.useEffect((function(){m&&d&&M()}),[d]),e.useEffect((function(){y&&(window.google||n(!1))}),[y]);var b=C({version:i,googleMapsApiKey:a,googleMapsClientId:p,language:c,region:l,libraries:u,channel:h});e.useEffect((function(){function t(){g.current&&(E(!0),P=b)}m&&(window.google&&P===b?t():v({id:r,url:b}).then(t).catch((function(t){g.current&&w(t),console.warn("\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key ("+(a||"-")+") or Client ID ("+(p||"-")+")\n Otherwise it is a Network issue.\n "),console.error(t)})))}),[r,b]);var S=e.useRef();return e.useEffect((function(){S.current&&u!==S.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),S.current=u}),[u]),{isLoaded:y,loadError:L,url:b}}L.defaultProps=k;var b=e.createElement(x,null);function S(t){var n=t.loadingElement,o=t.onLoad,r=t.onError,s=t.onUnmount,i=t.children,a=w(p(t,["loadingElement","onLoad","onError","onUnmount","children"])),c=a.isLoaded,l=a.loadError;return e.useEffect((function(){c&&"function"==typeof o&&o()}),[c,o]),e.useEffect((function(){l&&"function"==typeof r&&r(l)}),[l,r]),e.useEffect((function(){return function(){s&&s()}}),[s]),c?i:n||b}var D=e.memo(S),U={},O={options:function(t,e){t.setOptions(e)}},R=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={trafficLayer:null},e.setTrafficLayerCallback=function(){null!==e.state.trafficLayer&&e.props.onLoad&&e.props.onLoad(e.state.trafficLayer)},e.registeredEvents=[],e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.TrafficLayer(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:O,eventMap:U,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{trafficLayer:t}}),this.setTrafficLayerCallback)},n.componentDidUpdate=function(t){null!==this.state.trafficLayer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:O,eventMap:U,prevProps:t,nextProps:this.props,instance:this.state.trafficLayer}))},n.componentWillUnmount=function(){null!==this.state.trafficLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),u(this.registeredEvents),this.state.trafficLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);R.contextType=c;var T=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={bicyclingLayer:null},e.setBicyclingLayerCallback=function(){null!==e.state.bicyclingLayer&&(e.state.bicyclingLayer.setMap(e.context),e.props.onLoad&&e.props.onLoad(e.state.bicyclingLayer))},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.BicyclingLayer;this.setState((function(){return{bicyclingLayer:t}}),this.setBicyclingLayerCallback)},n.componentWillUnmount=function(){null!==this.state.bicyclingLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);T.contextType=c;var V=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={transitLayer:null},e.setTransitLayerCallback=function(){null!==e.state.transitLayer&&(e.state.transitLayer.setMap(e.context),e.props.onLoad&&e.props.onLoad(e.state.transitLayer))},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.TransitLayer;this.setState((function(){return{transitLayer:t}}),this.setTransitLayerCallback)},n.componentWillUnmount=function(){null!==this.state.transitLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);V.contextType=c;var I={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},_={drawingMode:function(t,e){t.setDrawingMode(e)},options:function(t,e){t.setOptions(e)}},B=function(t){function o(e){var o;return(o=t.call(this,e)||this).registeredEvents=[],o.state={drawingManager:null},o.setDrawingManagerCallback=function(){null!==o.state.drawingManager&&o.props.onLoad&&o.props.onLoad(o.state.drawingManager)},google.maps.drawing||n(!1),o}a(o,t);var r=o.prototype;return r.componentDidMount=function(){var t=new google.maps.drawing.DrawingManager(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:_,eventMap:I,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{drawingManager:t}}),this.setDrawingManagerCallback)},r.componentDidUpdate=function(t){null!==this.state.drawingManager&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:_,eventMap:I,prevProps:t,nextProps:this.props,instance:this.state.drawingManager}))},r.componentWillUnmount=function(){null!==this.state.drawingManager&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),u(this.registeredEvents),this.state.drawingManager.setMap(null))},r.render=function(){return e.createElement(e.Fragment,null)},o}(e.PureComponent);B.contextType=c;var W={onAnimationChanged:"animation_changed",onClick:"click",onClickableChanged:"clickable_changed",onCursorChanged:"cursor_changed",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDraggableChanged:"draggable_changed",onDragStart:"dragstart",onFlatChanged:"flat_changed",onIconChanged:"icon_changed",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onPositionChanged:"position_changed",onRightClick:"rightclick",onShapeChanged:"shape_changed",onTitleChanged:"title_changed",onVisibleChanged:"visible_changed",onZindexChanged:"zindex_changed"},A={animation:function(t,e){t.setAnimation(e)},clickable:function(t,e){t.setClickable(e)},cursor:function(t,e){t.setCursor(e)},draggable:function(t,e){t.setDraggable(e)},icon:function(t,e){t.setIcon(e)},label:function(t,e){t.setLabel(e)},map:function(t,e){t.setMap(e)},opacity:function(t,e){t.setOpacity(e)},options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},shape:function(t,e){t.setShape(e)},title:function(t,e){t.setTitle(e)},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},N=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={marker:null},e.setMarkerCallback=function(){null!==e.state.marker&&e.props.onLoad&&e.props.onLoad(e.state.marker)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=i({},this.props.options||{},{},this.props.clusterer?{}:{map:this.context},{position:this.props.position}),e=new google.maps.Marker(t);this.props.clusterer?this.props.clusterer.addMarker(e,!!this.props.noClustererRedraw):e.setMap(this.context),this.registeredEvents=d({updaterMap:A,eventMap:W,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{marker:e}}),this.setMarkerCallback)},o.componentDidUpdate=function(t){null!==this.state.marker&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:A,eventMap:W,prevProps:t,nextProps:this.props,instance:this.state.marker}))},o.componentWillUnmount=function(){null!==this.state.marker&&(this.props.onUnmount&&this.props.onUnmount(this.state.marker),u(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.state.marker,!!this.props.noClustererRedraw):this.state.marker&&this.state.marker.setMap(null))},o.render=function(){var t=this,n=null;return this.props.children&&(n=e.Children.map(this.props.children,(function(n){return e.isValidElement(n)?e.cloneElement(n,{anchor:t.state.marker}):n}))),n||null},n}(e.PureComponent);N.contextType=c;var j={onClick:"click",onClusteringBegin:"clusteringbegin",onClusteringEnd:"clusteringend",onMouseOut:"mouseout",onMouseOver:"mouseover"},z={averageCenter:function(t,e){t.setAverageCenter(e)},batchSizeIE:function(t,e){t.setBatchSizeIE(e)},calculator:function(t,e){t.setCalculator(e)},clusterClass:function(t,e){t.setClusterClass(e)},enableRetinaIcons:function(t,e){t.setEnableRetinaIcons(e)},gridSize:function(t,e){t.setGridSize(e)},ignoreHidden:function(t,e){t.setIgnoreHidden(e)},imageExtension:function(t,e){t.setImageExtension(e)},imagePath:function(t,e){t.setImagePath(e)},imageSizes:function(t,e){t.setImageSizes(e)},maxZoom:function(t,e){t.setMaxZoom(e)},minimumClusterSize:function(t,e){t.setMinimumClusterSize(e)},styles:function(t,e){t.setStyles(e)},title:function(t,e){t.setTitle(e)},zoomOnClick:function(t,e){t.setZoomOnClick(e)}},F=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={markerClusterer:null},e.setClustererCallback=function(){null!==e.state.markerClusterer&&e.props.onLoad&&e.props.onLoad(e.state.markerClusterer)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){if(this.context){var t=new o.Clusterer(this.context,[],this.props.options);this.registeredEvents=d({updaterMap:z,eventMap:j,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{markerClusterer:t}}),this.setClustererCallback)}},n.componentDidUpdate=function(t){this.state.markerClusterer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:z,eventMap:j,prevProps:t,nextProps:this.props,instance:this.state.markerClusterer}))},n.componentWillUnmount=function(){null!==this.state.markerClusterer&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),u(this.registeredEvents),this.state.markerClusterer.setMap(null))},n.render=function(){return null!==this.state.markerClusterer?this.props.children(this.state.markerClusterer):null},e}(e.PureComponent);F.contextType=c;var G={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},Z={options:function(t,e){t.setOptions(e)},position:function(t,e){e instanceof google.maps.LatLng?t.setPosition(e):t.setPosition(new google.maps.LatLng(e.lat,e.lng))},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},H=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.containerElement=null,e.state={infoBox:null},e.open=function(t,o){o?t.open(e.context,o):t.getPosition()?t.open(e.context):n(!1)},e.setInfoBoxCallback=function(){var t=e.props,n=t.anchor,o=t.onLoad,r=e.state.infoBox;null!==r&&null!==e.containerElement&&(r.setContent(e.containerElement),e.open(r,n),o&&o(r))},e}a(o,t);var c=o.prototype;return c.componentDidMount=function(){var t,e=this.props.options||{},n=e.position,o=p(e,["position"]);!n||n instanceof google.maps.LatLng||(t=new google.maps.LatLng(n.lat,n.lng));var r=new s.InfoBox(i({},o,{},t?{position:t}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=d({updaterMap:Z,eventMap:G,prevProps:{},nextProps:this.props,instance:r}),this.setState({infoBox:r},this.setInfoBoxCallback)},c.componentDidUpdate=function(t){var e=this.state.infoBox;null!==e&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Z,eventMap:G,prevProps:t,nextProps:this.props,instance:e}))},c.componentWillUnmount=function(){var t=this.props.onUnmount,e=this.state.infoBox;null!==e&&(t&&t(e),u(this.registeredEvents),e.close())},c.render=function(){return this.containerElement?r.createPortal(e.Children.only(this.props.children),this.containerElement):null},o}(e.PureComponent);H.contextType=c;var K={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},q={options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},zIndex:function(t,e){t.setZIndex(e)}},Y=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.containerElement=null,e.state={infoWindow:null},e.open=function(t,o){o?t.open(e.context,o):t.getPosition()?t.open(e.context):n(!1)},e.setInfoWindowCallback=function(){null!==e.state.infoWindow&&null!==e.containerElement&&(e.state.infoWindow.setContent(e.containerElement),e.open(e.state.infoWindow,e.props.anchor),e.props.onLoad&&e.props.onLoad(e.state.infoWindow))},e}a(o,t);var s=o.prototype;return s.componentDidMount=function(){var t=new google.maps.InfoWindow(i({},this.props.options||{}));this.containerElement=document.createElement("div"),this.registeredEvents=d({updaterMap:q,eventMap:K,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{infoWindow:t}}),this.setInfoWindowCallback)},s.componentDidUpdate=function(t){null!==this.state.infoWindow&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:q,eventMap:K,prevProps:t,nextProps:this.props,instance:this.state.infoWindow}))},s.componentWillUnmount=function(){null!==this.state.infoWindow&&(u(this.registeredEvents),this.state.infoWindow.close())},s.render=function(){return this.containerElement?r.createPortal(e.Children.only(this.props.children),this.containerElement):e.createElement(e.Fragment,null)},o}(e.PureComponent);Y.contextType=c;var J={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},Q={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},visible:function(t,e){t.setVisible(e)}},X=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={polyline:null},e.setPolylineCallback=function(){null!==e.state.polyline&&e.props.onLoad&&e.props.onLoad(e.state.polyline)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.Polyline(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:Q,eventMap:J,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{polyline:t}}),this.setPolylineCallback)},o.componentDidUpdate=function(t){null!==this.state.polyline&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Q,eventMap:J,prevProps:t,nextProps:this.props,instance:this.state.polyline}))},o.componentWillUnmount=function(){null!==this.state.polyline&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),u(this.registeredEvents),this.state.polyline.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);X.contextType=c;var $={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},tt={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},paths:function(t,e){t.setPaths(e)},visible:function(t,e){t.setVisible(e)}},et=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={polygon:null},e.setPolygonCallback=function(){null!==e.state.polygon&&e.props.onLoad&&e.props.onLoad(e.state.polygon)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.Polygon(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:tt,eventMap:$,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{polygon:t}}),this.setPolygonCallback)},n.componentDidUpdate=function(t){null!==this.state.polygon&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:tt,eventMap:$,prevProps:t,nextProps:this.props,instance:this.state.polygon}))},n.componentWillUnmount=function(){null!==this.state.polygon&&(this.props.onUnmount&&this.props.onUnmount(this.state.polygon),u(this.registeredEvents),this.state.polygon&&this.state.polygon.setMap(null))},n.render=function(){return null},e}(e.PureComponent);et.contextType=c;var nt={onBoundsChanged:"bounds_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},ot={bounds:function(t,e){t.setBounds(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},visible:function(t,e){t.setVisible(e)}},rt=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={rectangle:null},e.setRectangleCallback=function(){null!==e.state.rectangle&&e.props.onLoad&&e.props.onLoad(e.state.rectangle)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.Rectangle(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:ot,eventMap:nt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{rectangle:t}}),this.setRectangleCallback)},o.componentDidUpdate=function(t){null!==this.state.rectangle&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:ot,eventMap:nt,prevProps:t,nextProps:this.props,instance:this.state.rectangle}))},o.componentWillUnmount=function(){null!==this.state.rectangle&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),u(this.registeredEvents),this.state.rectangle.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);rt.contextType=c;var st={onCenterChanged:"center_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRadiusChanged:"radius_changed",onRightClick:"rightclick"},it={center:function(t,e){t.setCenter(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},radius:function(t,e){t.setRadius(e)},visible:function(t,e){t.setVisible(e)}},at=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={circle:null},e.setCircleCallback=function(){null!==e.state.circle&&e.props.onLoad&&e.props.onLoad(e.state.circle)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.Circle(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:it,eventMap:st,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{circle:t}}),this.setCircleCallback)},o.componentDidUpdate=function(t){null!==this.state.circle&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:it,eventMap:st,prevProps:t,nextProps:this.props,instance:this.state.circle}))},o.componentWillUnmount=function(){null!==this.state.circle&&(this.props.onUnmount&&this.props.onUnmount(this.state.circle),u(this.registeredEvents),this.state.circle&&this.state.circle.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);at.contextType=c;var pt={onAddFeature:"addfeature",onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onRightClick:"rightclick",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},ct={add:function(t,e){t.add(e)},addgeojson:function(t,e,n){t.addGeoJson(e,n)},contains:function(t,e){t.contains(e)},foreach:function(t,e){t.forEach(e)},loadgeojson:function(t,e,n,o){t.loadGeoJson(e,n,o)},overridestyle:function(t,e,n){t.overrideStyle(e,n)},remove:function(t,e){t.remove(e)},revertstyle:function(t,e){t.revertStyle(e)},controlposition:function(t,e){t.setControlPosition(e)},controls:function(t,e){t.setControls(e)},drawingmode:function(t,e){t.setDrawingMode(e)},map:function(t,e){t.setMap(e)},style:function(t,e){t.setStyle(e)},togeojson:function(t,e){t.toGeoJson(e)}},lt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={data:null},e.setDataCallback=function(){null!==e.state.data&&e.props.onLoad&&e.props.onLoad(e.state.data)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.Data(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:ct,eventMap:pt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{data:t}}),this.setDataCallback)},n.componentDidUpdate=function(t){null!==this.state.data&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:ct,eventMap:pt,prevProps:t,nextProps:this.props,instance:this.state.data}))},n.componentWillUnmount=function(){null!==this.state.data&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),u(this.registeredEvents),this.state.data&&this.state.data.setMap(null))},n.render=function(){return null},e}(e.PureComponent);lt.contextType=c;var ut={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},dt={options:function(t,e){t.setOptions(e)},url:function(t,e){t.setUrl(e)},zIndex:function(t,e){t.setZIndex(e)}},ht=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={kmlLayer:null},e.setKmlLayerCallback=function(){null!==e.state.kmlLayer&&e.props.onLoad&&e.props.onLoad(e.state.kmlLayer)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.KmlLayer(i({},this.props.options,{map:this.context}));this.registeredEvents=d({updaterMap:dt,eventMap:ut,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{kmlLayer:t}}),this.setKmlLayerCallback)},n.componentDidUpdate=function(t){null!==this.state.kmlLayer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:dt,eventMap:ut,prevProps:t,nextProps:this.props,instance:this.state.kmlLayer}))},n.componentWillUnmount=function(){null!==this.state.kmlLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),u(this.registeredEvents),this.state.kmlLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);ht.contextType=c;var gt=function(t,e){return new e(t.lat,t.lng)},ft=function(t,e){return new e(new google.maps.LatLng(t.ne.lat,t.ne.lng),new google.maps.LatLng(t.sw.lat,t.sw.lng))},mt=function(t,e,n){return t instanceof e?t:n(t,e)},vt=function(t){function e(){return t.apply(this,arguments)||this}a(e,t);var n=e.prototype;return n.componentDidMount=function(){this.props.onLoad&&this.props.onLoad()},n.render=function(){return this.props.children},e}(e.Component);function yt(t){return t?(t instanceof google.maps.LatLng?t:new google.maps.LatLng(t.lat,t.lng))+"":""}function Mt(t){return t?(t instanceof google.maps.LatLngBounds?t:new google.maps.LatLngBounds(new google.maps.LatLng(t.south,t.east),new google.maps.LatLng(t.north,t.west)))+"":""}var Ct=function(t){function o(o){var r;return(r=t.call(this,o)||this).state={overlayView:null,containerStyle:{}},r.mapPaneEl=null,r.setOverlayViewCallback=function(){null!==r.state.overlayView&&r.props.onLoad&&r.props.onLoad(r.state.overlayView),r.onPositionElement()},r.onAdd=function(){var t;r.props.mapPaneName||n(!1);var e=null===(t=r.state.overlayView)||void 0===t?void 0:t.getPanes();e&&(r.mapPaneEl=e[r.props.mapPaneName])},r.onPositionElement=function(){if(null!==r.state.overlayView){var t=(e=r.state.overlayView.getProjection(),n=i({x:0,y:0},r.containerRef.current?(a=r.containerRef.current,"function"==typeof(p=r.props.getPixelPositionOffset)?p(a.offsetWidth,a.offsetHeight):{}):{}),s=r.props.position,void 0!==(o=r.props.bounds)?function(t,e,n){var o=t.fromLatLngToDivPixel(n.getNorthEast()),r=t.fromLatLngToDivPixel(n.getSouthWest());return o&&r?{left:r.x+e.x+"px",top:o.y+e.y+"px",width:o.x-r.x-e.x+"px",height:r.y-o.y-e.y+"px"}:{left:"-9999px",top:"-9999px"}}(e,n,mt(o,google.maps.LatLngBounds,ft)):function(t,e,n){var o=t.fromLatLngToDivPixel(n);return o?{left:o.x+e.x+"px",top:o.y+e.y+"px"}:{left:"-9999px",top:"-9999px"}}(e,n,mt(s,google.maps.LatLng,gt)));r.setState({containerStyle:t})}var e,n,o,s,a,p},r.draw=function(){r.onPositionElement()},r.onRemove=function(){r.mapPaneEl=null},r.containerRef=e.createRef(),r}a(o,t);var s=o.prototype;return s.componentDidMount=function(){var t=new google.maps.OverlayView;t.onAdd=this.onAdd,t.draw=this.draw,t.onRemove=this.onRemove,t.setMap(this.context),this.setState((function(){return{overlayView:t}}))},s.componentDidUpdate=function(t){var e=this,n=yt(t.position),o=yt(this.props.position),r=Mt(t.bounds),s=Mt(this.props.bounds);n===o&&r===s||setTimeout((function(){null!==e.state.overlayView&&e.state.overlayView.draw()}),0)},s.componentWillUnmount=function(){null!==this.state.overlayView&&(this.props.onUnmount&&this.props.onUnmount(this.state.overlayView),this.state.overlayView.setMap(null))},s.render=function(){return this.mapPaneEl?r.createPortal(e.createElement("div",{ref:this.containerRef,style:i({},this.state.containerStyle,{position:"absolute"})},e.createElement(vt,{onLoad:this.setOverlayViewCallback},e.Children.only(this.props.children))),this.mapPaneEl):e.createElement(e.Fragment,null)},o}(e.PureComponent);Ct.FLOAT_PANE="floatPane",Ct.MAP_PANE="mapPane",Ct.MARKER_LAYER="markerLayer",Ct.OVERLAY_LAYER="overlayLayer",Ct.OVERLAY_MOUSE_TARGET="overlayMouseTarget",Ct.contextType=c;var Et={onDblClick:"dblclick",onClick:"click"},xt={opacity:function(t,e){t.setOpacity(e)}},Pt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={groundOverlay:null},e.setGroundOverlayCallback=function(){null!==e.state.groundOverlay&&e.props.onLoad&&e.props.onLoad(e.state.groundOverlay)},e}a(e,t);var o=e.prototype;return o.componentDidMount=function(){this.props.url||this.props.bounds||n(!1);var t=new google.maps.GroundOverlay(this.props.url,this.props.bounds,i({},this.props.options,{map:this.context}));this.registeredEvents=d({updaterMap:xt,eventMap:Et,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{groundOverlay:t}}),this.setGroundOverlayCallback)},o.componentDidUpdate=function(t){null!==this.state.groundOverlay&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:xt,eventMap:Et,prevProps:t,nextProps:this.props,instance:this.state.groundOverlay}))},o.componentWillUnmount=function(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))},o.render=function(){return null},e}(e.PureComponent);Pt.defaultProps={onLoad:function(){}},Pt.contextType=c;var kt={},Lt={data:function(t,e){t.setData(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)}},wt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={heatmapLayer:null},e.setHeatmapLayerCallback=function(){null!==e.state.heatmapLayer&&e.props.onLoad&&e.props.onLoad(e.state.heatmapLayer)},e}a(e,t);var o=e.prototype;return o.componentDidMount=function(){google.maps.visualization||n(!1),this.props.data||n(!1);var t=new google.maps.visualization.HeatmapLayer(i({},this.props.options||{},{data:this.props.data,map:this.context}));this.registeredEvents=d({updaterMap:Lt,eventMap:kt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{heatmapLayer:t}}),this.setHeatmapLayerCallback)},o.componentDidUpdate=function(t){u(this.registeredEvents),this.registeredEvents=d({updaterMap:Lt,eventMap:kt,prevProps:t,nextProps:this.props,instance:this.state.heatmapLayer})},o.componentWillUnmount=function(){null!==this.state.heatmapLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),u(this.registeredEvents),this.state.heatmapLayer.setMap(null))},o.render=function(){return null},e}(e.PureComponent);wt.contextType=c;var bt={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},St={register:function(t,e,n){t.registerPanoProvider(e,n)},links:function(t,e){t.setLinks(e)},motionTracking:function(t,e){t.setMotionTracking(e)},options:function(t,e){t.setOptions(e)},pano:function(t,e){t.setPano(e)},position:function(t,e){t.setPosition(e)},pov:function(t,e){t.setPov(e)},visible:function(t,e){t.setVisible(e)},zoom:function(t,e){t.setZoom(e)}},Dt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={streetViewPanorama:null},e.setStreetViewPanoramaCallback=function(){null!==e.state.streetViewPanorama&&e.props.onLoad&&e.props.onLoad(e.state.streetViewPanorama)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=this.context.getStreetView();this.registeredEvents=d({updaterMap:St,eventMap:bt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{streetViewPanorama:t}}),this.setStreetViewPanoramaCallback)},n.componentDidUpdate=function(t){null!==this.state.streetViewPanorama&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:St,eventMap:bt,prevProps:t,nextProps:this.props,instance:this.state.streetViewPanorama}))},n.componentWillUnmount=function(){null!==this.state.streetViewPanorama&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),u(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))},n.render=function(){return null},e}(e.PureComponent);Dt.contextType=c;var Ut=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={streetViewService:null},e.setStreetViewServiceCallback=function(){null!==e.state.streetViewService&&e.props.onLoad&&e.props.onLoad(e.state.streetViewService)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.StreetViewService;this.setState((function(){return{streetViewService:t}}),this.setStreetViewServiceCallback)},n.componentWillUnmount=function(){null!==this.state.streetViewService&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)},n.render=function(){return null},e}(e.PureComponent);Ut.contextType=c;var Ot=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).state={directionsService:null},e.setDirectionsServiceCallback=function(){null!==e.state.directionsService&&e.props.onLoad&&e.props.onLoad(e.state.directionsService)},e}a(o,t);var r=o.prototype;return r.componentDidMount=function(){this.props.options||n(!1);var t=new google.maps.DirectionsService;this.setState((function(){return{directionsService:t}}),this.setDirectionsServiceCallback)},r.componentDidUpdate=function(){null!==this.state.directionsService&&this.state.directionsService.route(this.props.options,this.props.callback)},r.componentWillUnmount=function(){null!==this.state.directionsService&&this.props.onUnmount&&this.props.onUnmount(this.state.directionsService)},r.render=function(){return e.createElement(e.Fragment,null)},o}(e.PureComponent),Rt={onDirectionsChanged:"directions_changed"},Tt={directions:function(t,e){t.setDirections(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},panel:function(t,e){t.setPanel(e)},routeIndex:function(t,e){t.setRouteIndex(e)}},Vt=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={directionsRenderer:null},e.setDirectionsRendererCallback=function(){null!==e.state.directionsRenderer&&(e.state.directionsRenderer.setMap(e.context),e.props.onLoad&&e.props.onLoad(e.state.directionsRenderer))},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=d({updaterMap:Tt,eventMap:Rt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{directionsRenderer:t}}),this.setDirectionsRendererCallback)},o.componentDidUpdate=function(t){null!==this.state.directionsRenderer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Tt,eventMap:Rt,prevProps:t,nextProps:this.props,instance:this.state.directionsRenderer}))},o.componentWillUnmount=function(){null!==this.state.directionsRenderer&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),u(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);Vt.contextType=c;var It=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).state={distanceMatrixService:null},e.setDistanceMatrixServiceCallback=function(){null!==e.state.distanceMatrixService&&e.props.onLoad&&e.props.onLoad(e.state.distanceMatrixService)},e}a(o,t);var r=o.prototype;return r.componentDidMount=function(){this.props.options||n(!1);var t=new google.maps.DistanceMatrixService;this.setState((function(){return{distanceMatrixService:t}}),this.setDistanceMatrixServiceCallback)},r.componentDidUpdate=function(){null!==this.state.distanceMatrixService&&this.state.distanceMatrixService.getDistanceMatrix(this.props.options,this.props.callback)},r.componentWillUnmount=function(){null!==this.state.distanceMatrixService&&this.props.onUnmount&&this.props.onUnmount(this.state.distanceMatrixService)},r.render=function(){return e.createElement(e.Fragment,null)},o}(e.PureComponent),_t={onPlacesChanged:"places_changed"},Bt={bounds:function(t,e){t.setBounds(e)}},Wt=function(t){function o(){var n;return(n=t.apply(this,arguments)||this).registeredEvents=[],n.containerElement=e.createRef(),n.state={searchBox:null},n.setSearchBoxCallback=function(){null!==n.state.searchBox&&n.props.onLoad&&n.props.onLoad(n.state.searchBox)},n}a(o,t);var r=o.prototype;return r.componentDidMount=function(){if(google.maps.places||n(!1),null!==this.containerElement&&null!==this.containerElement.current){var t=this.containerElement.current.querySelector("input");if(null!==t){var e=new google.maps.places.SearchBox(t,this.props.options);this.registeredEvents=d({updaterMap:Bt,eventMap:_t,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{searchBox:e}}),this.setSearchBoxCallback)}}},r.componentDidUpdate=function(t){null!==this.state.searchBox&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Bt,eventMap:_t,prevProps:t,nextProps:this.props,instance:this.state.searchBox}))},r.componentWillUnmount=function(){null!==this.state.searchBox&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),u(this.registeredEvents))},r.render=function(){return e.createElement("div",{ref:this.containerElement},e.Children.only(this.props.children))},o}(e.PureComponent);Wt.contextType=c;var At={onPlaceChanged:"place_changed"},Nt={bounds:function(t,e){t.setBounds(e)},restrictions:function(t,e){t.setComponentRestrictions(e)},fields:function(t,e){t.setFields(e)},options:function(t,e){t.setOptions(e)},types:function(t,e){t.setTypes(e)}},jt=function(t){function o(){var n;return(n=t.apply(this,arguments)||this).registeredEvents=[],n.containerElement=e.createRef(),n.state={autocomplete:null},n.setAutocompleteCallback=function(){null!==n.state.autocomplete&&n.props.onLoad&&n.props.onLoad(n.state.autocomplete)},n}a(o,t);var r=o.prototype;return r.componentDidMount=function(){google.maps.places||n(!1);var t=this.containerElement.current.querySelector("input");if(t){var e=new google.maps.places.Autocomplete(t,this.props.options);this.registeredEvents=d({updaterMap:Nt,eventMap:At,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{autocomplete:e}}),this.setAutocompleteCallback)}},r.componentDidUpdate=function(t){u(this.registeredEvents),this.registeredEvents=d({updaterMap:Nt,eventMap:At,prevProps:t,nextProps:this.props,instance:this.state.autocomplete})},r.componentWillUnmount=function(){null!==this.state.autocomplete&&u(this.registeredEvents)},r.render=function(){return e.createElement("div",{ref:this.containerElement},e.Children.only(this.props.children))},o}(e.PureComponent);jt.contextType=c,exports.Autocomplete=jt,exports.BicyclingLayer=T,exports.Circle=at,exports.Data=lt,exports.DirectionsRenderer=Vt,exports.DirectionsService=Ot,exports.DistanceMatrixService=It,exports.DrawingManager=B,exports.GoogleMap=f,exports.GroundOverlay=Pt,exports.HeatmapLayer=wt,exports.InfoBox=H,exports.InfoWindow=Y,exports.KmlLayer=ht,exports.LoadScript=L,exports.LoadScriptNext=D,exports.MapContext=c,exports.Marker=N,exports.MarkerClusterer=F,exports.OverlayView=Ct,exports.Polygon=et,exports.Polyline=X,exports.Rectangle=rt,exports.StandaloneSearchBox=Wt,exports.StreetViewPanorama=Dt,exports.StreetViewService=Ut,exports.TrafficLayer=R,exports.TransitLayer=V,exports.useGoogleMap=function(){e.useContext||n(!1);var t=e.useContext(c);return t||n(!1),t},exports.useLoadScript=w; | ||
//# sourceMappingURL=reactgooglemapsapi.cjs.production.min.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("invariant"),require("@react-google-maps/marker-clusterer"),require("react-dom"),require("@react-google-maps/infobox")):"function"==typeof define&&define.amd?define(["exports","react","invariant","@react-google-maps/marker-clusterer","react-dom","@react-google-maps/infobox"],e):e((t=t||self).reactGoogleMapsApi={},t.React,t.invariant,t.markerClusterer,t.ReactDOM,t.infobox)}(this,(function(t,e,n,o,r,s){"use strict";function i(){return(i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function p(t,e){if(null==t)return{};var n,o,r={},s=Object.keys(t);for(o=0;o<s.length;o++)e.indexOf(n=s[o])>=0||(r[n]=t[n]);return r}n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;var c=e.createContext(null);function l(t){google.maps.event.removeListener(t)}function u(t){void 0===t&&(t=[]),t.forEach(l)}function d(t){var e=t.updaterMap,n=t.prevProps,o=t.nextProps,r=t.instance,s=function(t,e,n){return o=n,Object.keys(o).reduce((function(n,r){return s=n,"function"==typeof t[i=r]&&s.push(google.maps.event.addListener(e,o[r],t[i])),s;var s,i}),[]);var o}(o,r,t.eventMap);return function(t,e,n,o){var r,s={};r=t,Object.keys(r).forEach((function(t){return function(t,r){var i=n[r];i!==e[r]&&(s[r]=i,t(o,i))}(r[t],t)}))}(e,n,o,r),s}var h={onDblClick:"dblclick",onDragEnd:"dragend",onDragStart:"dragstart",onMapTypeIdChanged:"maptypeid_changed",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseDown:"mousedown",onMouseUp:"mouseup",onRightClick:"rightclick",onTilesLoaded:"tilesloaded",onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onDrag:"drag",onHeadingChanged:"heading_changed",onIdle:"idle",onProjectionChanged:"projection_changed",onResize:"resize",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed"},g={extraMapTypes:function(t,e){e.forEach((function(e,n){t.mapTypes.set(String(n),e)}))},center:function(t,e){t.setCenter(e)},clickableIcons:function(t,e){t.setClickableIcons(e)},heading:function(t,e){t.setHeading(e)},mapTypeId:function(t,e){t.setMapTypeId(e)},options:function(t,e){t.setOptions(e)},streetView:function(t,e){t.setStreetView(e)},tilt:function(t,e){t.setTilt(e)},zoom:function(t,e){t.setZoom(e)}},f=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={map:null},e.registeredEvents=[],e.mapRef=null,e.getInstance=function(){return null===e.mapRef?null:new google.maps.Map(e.mapRef,e.props.options)},e.panTo=function(t){var n=e.getInstance();n&&n.panTo(t)},e.setMapCallback=function(){null!==e.state.map&&e.props.onLoad&&e.props.onLoad(e.state.map)},e.getRef=function(t){e.mapRef=t},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=this.getInstance();this.registeredEvents=d({updaterMap:g,eventMap:h,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{map:t}}),this.setMapCallback)},o.componentDidUpdate=function(t){null!==this.state.map&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:g,eventMap:h,prevProps:t,nextProps:this.props,instance:this.state.map}))},o.componentWillUnmount=function(){null!==this.state.map&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),u(this.registeredEvents))},o.render=function(){return e.createElement("div",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName},e.createElement(c.Provider,{value:this.state.map},null!==this.state.map?this.props.children:e.createElement(e.Fragment,null)))},n}(e.PureComponent),m="undefined"!=typeof document,v=function(t){var e=t.url,n=t.id;return m?new Promise((function(t,o){var r=document.getElementById(n),s=window;if(r){var i=r.getAttribute("data-state");if(r.src===e&&"error"!==i){if("ready"===i)return t(n);var a=s.initMap,p=r.onerror;return s.initMap=function(){a&&a(),t(n)},void(r.onerror=function(t){p&&p(t),o(t)})}r.remove()}var c=document.createElement("script");c.type="text/javascript",c.src=e,c.id=n,c.async=!0,c.onerror=function(t){c.setAttribute("data-state","error"),o(t)},s.initMap=function(){c.setAttribute("data-state","ready"),t(n)},document.head.appendChild(c)})).catch((function(t){throw console.error("injectScript error: ",t),t})):Promise.reject(new Error("document is undefined"))},y=function(t){return!((!t.href||0!==t.href.indexOf("https://fonts.googleapis.com/css?family=Roboto"))&&("style"===t.tagName.toLowerCase()&&t.styleSheet&&t.styleSheet.cssText&&0===t.styleSheet.cssText.replace("\r\n","").indexOf(".gm-style")?(t.styleSheet.cssText="",0):"style"===t.tagName.toLowerCase()&&t.innerHTML&&0===t.innerHTML.replace("\r\n","").indexOf(".gm-style")?(t.innerHTML="",0):"style"!==t.tagName.toLowerCase()||t.styleSheet||t.innerHTML))},M=function(){var t=document.getElementsByTagName("head")[0],e=t.insertBefore.bind(t);t.insertBefore=function(n,o){y(n)||Reflect.apply(e,t,[n,o])};var n=t.appendChild.bind(t);t.appendChild=function(e){y(e)||Reflect.apply(n,t,[e])}};function C(t){var e=t.googleMapsApiKey,o=t.googleMapsClientId,r=t.version,s=void 0===r?"weekly":r,i=t.language,a=t.region,p=t.libraries,c=t.channel,l=[];return e&&o||!e||!o||n(!1),e?l.push("key="+e):o&&l.push("client="+o),s&&l.push("v="+s),i&&l.push("language="+i),a&&l.push("region="+a),p&&p.length&&l.push("libraries="+p.sort().join(",")),c&&l.push("channel="+c),l.push("callback=initMap"),"https://maps.googleapis.com/maps/api/js?"+l.join("&")}var E=!1;function P(){return e.createElement("div",null,"Loading...")}var k,x={id:"script-loader",version:"weekly"},L=function(t){function o(){var o;return(o=t.apply(this,arguments)||this).check=e.createRef(),o.state={loaded:!1},o.cleanupCallback=function(){delete window.google,o.injectScript()},o.isCleaningUp=function(){try{return Promise.resolve(new Promise((function(t){if(E){if(m)var e=window.setInterval((function(){E||(window.clearInterval(e),t())}),1)}else t()})))}catch(t){return Promise.reject(t)}},o.cleanup=function(){E=!0;var t=document.getElementById(o.props.id);t&&t.parentNode&&t.parentNode.removeChild(t),Array.prototype.slice.call(document.getElementsByTagName("script")).filter((function(t){return"string"==typeof t.src&&t.src.includes("maps.googleapis")})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)})),Array.prototype.slice.call(document.getElementsByTagName("link")).filter((function(t){return"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"===t.href})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)})),Array.prototype.slice.call(document.getElementsByTagName("style")).filter((function(t){return void 0!==t.innerText&&t.innerText.length>0&&t.innerText.includes(".gm-")})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)}))},o.injectScript=function(){o.props.preventGoogleFontsLoading&&M(),o.props.id||n(!1);var t={id:o.props.id,url:C(o.props)};v(t).then((function(){o.props.onLoad&&o.props.onLoad(),o.setState((function(){return{loaded:!0}}))})).catch((function(t){o.props.onError&&o.props.onError(t),console.error("\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key ("+(o.props.googleMapsApiKey||"-")+") or Client ID ("+(o.props.googleMapsClientId||"-")+") to <LoadScript />\n Otherwise it is a Network issue.\n ")}))},o}a(o,t);var r=o.prototype;return r.componentDidMount=function(){if(m){if(window.google&&!E)return void console.error("google api is already presented");this.isCleaningUp().then(this.injectScript).catch((function(t){console.error("Error at injecting script after cleaning up: ",t)}))}},r.componentDidUpdate=function(t){this.props.libraries!==t.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),m&&t.language!==this.props.language&&(this.cleanup(),this.setState((function(){return{loaded:!1}}),this.cleanupCallback))},r.componentWillUnmount=function(){var t=this;m&&(this.cleanup(),window.setTimeout((function(){t.check.current||(delete window.google,E=!1)}),1),this.props.onUnmount&&this.props.onUnmount())},r.render=function(){return e.createElement(e.Fragment,null,e.createElement("div",{ref:this.check}),this.state.loaded?this.props.children:this.props.loadingElement||e.createElement(P,null))},o}(e.PureComponent);function w(t){var o=t.id,r=void 0===o?x.id:o,s=t.version,i=void 0===s?x.version:s,a=t.googleMapsApiKey,p=t.googleMapsClientId,c=t.language,l=t.region,u=t.libraries,d=t.preventGoogleFontsLoading,h=t.channel,g=e.useRef(!1),f=e.useState(!1),y=f[0],E=f[1],P=e.useState(void 0),L=P[0],w=P[1];e.useEffect((function(){return g.current=!0,function(){g.current=!1}}),[]),e.useEffect((function(){m&&d&&M()}),[d]),e.useEffect((function(){y&&(window.google||n(!1))}),[y]);var b=C({version:i,googleMapsApiKey:a,googleMapsClientId:p,language:c,region:l,libraries:u,channel:h});e.useEffect((function(){function t(){g.current&&(E(!0),k=b)}m&&(window.google&&k===b?t():v({id:r,url:b}).then(t).catch((function(t){g.current&&w(t),console.warn("\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key ("+(a||"-")+") or Client ID ("+(p||"-")+")\n Otherwise it is a Network issue.\n "),console.error(t)})))}),[r,b]);var S=e.useRef();return e.useEffect((function(){S.current&&u!==S.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),S.current=u}),[u]),{isLoaded:y,loadError:L,url:b}}L.defaultProps=x;var b=e.createElement(P,null);function S(t){var n=t.loadingElement,o=t.onLoad,r=t.onError,s=t.onUnmount,i=t.children,a=w(p(t,["loadingElement","onLoad","onError","onUnmount","children"])),c=a.isLoaded,l=a.loadError;return e.useEffect((function(){c&&"function"==typeof o&&o()}),[c,o]),e.useEffect((function(){l&&"function"==typeof r&&r(l)}),[l,r]),e.useEffect((function(){return function(){s&&s()}}),[s]),c?i:n||b}var D=e.memo(S),U={},O={options:function(t,e){t.setOptions(e)}},R=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={trafficLayer:null},e.setTrafficLayerCallback=function(){null!==e.state.trafficLayer&&e.props.onLoad&&e.props.onLoad(e.state.trafficLayer)},e.registeredEvents=[],e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.TrafficLayer(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:O,eventMap:U,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{trafficLayer:t}}),this.setTrafficLayerCallback)},n.componentDidUpdate=function(t){null!==this.state.trafficLayer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:O,eventMap:U,prevProps:t,nextProps:this.props,instance:this.state.trafficLayer}))},n.componentWillUnmount=function(){null!==this.state.trafficLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),u(this.registeredEvents),this.state.trafficLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);R.contextType=c;var T=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={bicyclingLayer:null},e.setBicyclingLayerCallback=function(){null!==e.state.bicyclingLayer&&(e.state.bicyclingLayer.setMap(e.context),e.props.onLoad&&e.props.onLoad(e.state.bicyclingLayer))},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.BicyclingLayer;this.setState((function(){return{bicyclingLayer:t}}),this.setBicyclingLayerCallback)},n.componentWillUnmount=function(){null!==this.state.bicyclingLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);T.contextType=c;var V=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={transitLayer:null},e.setTransitLayerCallback=function(){null!==e.state.transitLayer&&(e.state.transitLayer.setMap(e.context),e.props.onLoad&&e.props.onLoad(e.state.transitLayer))},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.TransitLayer;this.setState((function(){return{transitLayer:t}}),this.setTransitLayerCallback)},n.componentWillUnmount=function(){null!==this.state.transitLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);V.contextType=c;var I={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},_={drawingMode:function(t,e){t.setDrawingMode(e)},options:function(t,e){t.setOptions(e)}},B=function(t){function o(e){var o;return(o=t.call(this,e)||this).registeredEvents=[],o.state={drawingManager:null},o.setDrawingManagerCallback=function(){null!==o.state.drawingManager&&o.props.onLoad&&o.props.onLoad(o.state.drawingManager)},google.maps.drawing||n(!1),o}a(o,t);var r=o.prototype;return r.componentDidMount=function(){var t=new google.maps.drawing.DrawingManager(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:_,eventMap:I,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{drawingManager:t}}),this.setDrawingManagerCallback)},r.componentDidUpdate=function(t){null!==this.state.drawingManager&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:_,eventMap:I,prevProps:t,nextProps:this.props,instance:this.state.drawingManager}))},r.componentWillUnmount=function(){null!==this.state.drawingManager&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),u(this.registeredEvents),this.state.drawingManager.setMap(null))},r.render=function(){return e.createElement(e.Fragment,null)},o}(e.PureComponent);B.contextType=c;var W={onAnimationChanged:"animation_changed",onClick:"click",onClickableChanged:"clickable_changed",onCursorChanged:"cursor_changed",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDraggableChanged:"draggable_changed",onDragStart:"dragstart",onFlatChanged:"flat_changed",onIconChanged:"icon_changed",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onPositionChanged:"position_changed",onRightClick:"rightclick",onShapeChanged:"shape_changed",onTitleChanged:"title_changed",onVisibleChanged:"visible_changed",onZindexChanged:"zindex_changed"},A={animation:function(t,e){t.setAnimation(e)},clickable:function(t,e){t.setClickable(e)},cursor:function(t,e){t.setCursor(e)},draggable:function(t,e){t.setDraggable(e)},icon:function(t,e){t.setIcon(e)},label:function(t,e){t.setLabel(e)},map:function(t,e){t.setMap(e)},opacity:function(t,e){t.setOpacity(e)},options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},shape:function(t,e){t.setShape(e)},title:function(t,e){t.setTitle(e)},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},j=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={marker:null},e.setMarkerCallback=function(){null!==e.state.marker&&e.props.onLoad&&e.props.onLoad(e.state.marker)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=i({},this.props.options||{},{},this.props.clusterer?{}:{map:this.context},{position:this.props.position}),e=new google.maps.Marker(t);this.props.clusterer?this.props.clusterer.addMarker(e,!!this.props.noClustererRedraw):e.setMap(this.context),this.registeredEvents=d({updaterMap:A,eventMap:W,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{marker:e}}),this.setMarkerCallback)},o.componentDidUpdate=function(t){null!==this.state.marker&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:A,eventMap:W,prevProps:t,nextProps:this.props,instance:this.state.marker}))},o.componentWillUnmount=function(){null!==this.state.marker&&(this.props.onUnmount&&this.props.onUnmount(this.state.marker),u(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.state.marker,!!this.props.noClustererRedraw):this.state.marker&&this.state.marker.setMap(null))},o.render=function(){var t=this,n=null;return this.props.children&&(n=e.Children.map(this.props.children,(function(n){return e.isValidElement(n)?e.cloneElement(n,{anchor:t.state.marker}):n}))),n||null},n}(e.PureComponent);j.contextType=c;var N={onClick:"click",onClusteringBegin:"clusteringbegin",onClusteringEnd:"clusteringend",onMouseOut:"mouseout",onMouseOver:"mouseover"},z={averageCenter:function(t,e){t.setAverageCenter(e)},batchSizeIE:function(t,e){t.setBatchSizeIE(e)},calculator:function(t,e){t.setCalculator(e)},clusterClass:function(t,e){t.setClusterClass(e)},enableRetinaIcons:function(t,e){t.setEnableRetinaIcons(e)},gridSize:function(t,e){t.setGridSize(e)},ignoreHidden:function(t,e){t.setIgnoreHidden(e)},imageExtension:function(t,e){t.setImageExtension(e)},imagePath:function(t,e){t.setImagePath(e)},imageSizes:function(t,e){t.setImageSizes(e)},maxZoom:function(t,e){t.setMaxZoom(e)},minimumClusterSize:function(t,e){t.setMinimumClusterSize(e)},styles:function(t,e){t.setStyles(e)},title:function(t,e){t.setTitle(e)},zoomOnClick:function(t,e){t.setZoomOnClick(e)}},F=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={markerClusterer:null},e.setClustererCallback=function(){null!==e.state.markerClusterer&&e.props.onLoad&&e.props.onLoad(e.state.markerClusterer)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){if(this.context){var t=new o.Clusterer(this.context,[],this.props.options);this.registeredEvents=d({updaterMap:z,eventMap:N,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{markerClusterer:t}}),this.setClustererCallback)}},n.componentDidUpdate=function(t){this.state.markerClusterer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:z,eventMap:N,prevProps:t,nextProps:this.props,instance:this.state.markerClusterer}))},n.componentWillUnmount=function(){null!==this.state.markerClusterer&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),u(this.registeredEvents),this.state.markerClusterer.setMap(null))},n.render=function(){return null!==this.state.markerClusterer?this.props.children(this.state.markerClusterer):null},e}(e.PureComponent);F.contextType=c;var G={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},Z={options:function(t,e){t.setOptions(e)},position:function(t,e){e instanceof google.maps.LatLng?t.setPosition(e):t.setPosition(new google.maps.LatLng(e.lat,e.lng))},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},H=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.containerElement=null,e.state={infoBox:null},e.open=function(t,o){o?t.open(e.context,o):t.getPosition()?t.open(e.context):n(!1)},e.setInfoBoxCallback=function(){var t=e.props,n=t.anchor,o=t.onLoad,r=e.state.infoBox;null!==r&&null!==e.containerElement&&(r.setContent(e.containerElement),e.open(r,n),o&&o(r))},e}a(o,t);var c=o.prototype;return c.componentDidMount=function(){var t,e=this.props.options||{},n=e.position,o=p(e,["position"]);!n||n instanceof google.maps.LatLng||(t=new google.maps.LatLng(n.lat,n.lng));var r=new s.InfoBox(i({},o,{},t?{position:t}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=d({updaterMap:Z,eventMap:G,prevProps:{},nextProps:this.props,instance:r}),this.setState({infoBox:r},this.setInfoBoxCallback)},c.componentDidUpdate=function(t){var e=this.state.infoBox;null!==e&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Z,eventMap:G,prevProps:t,nextProps:this.props,instance:e}))},c.componentWillUnmount=function(){var t=this.props.onUnmount,e=this.state.infoBox;null!==e&&(t&&t(e),u(this.registeredEvents),e.close())},c.render=function(){return this.containerElement?r.createPortal(e.Children.only(this.props.children),this.containerElement):null},o}(e.PureComponent);H.contextType=c;var K={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},q={options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},zIndex:function(t,e){t.setZIndex(e)}},Y=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.containerElement=null,e.state={infoWindow:null},e.open=function(t,o){o?t.open(e.context,o):t.getPosition()?t.open(e.context):n(!1)},e.setInfoWindowCallback=function(){null!==e.state.infoWindow&&null!==e.containerElement&&(e.state.infoWindow.setContent(e.containerElement),e.open(e.state.infoWindow,e.props.anchor),e.props.onLoad&&e.props.onLoad(e.state.infoWindow))},e}a(o,t);var s=o.prototype;return s.componentDidMount=function(){var t=new google.maps.InfoWindow(i({},this.props.options||{}));this.containerElement=document.createElement("div"),this.registeredEvents=d({updaterMap:q,eventMap:K,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{infoWindow:t}}),this.setInfoWindowCallback)},s.componentDidUpdate=function(t){null!==this.state.infoWindow&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:q,eventMap:K,prevProps:t,nextProps:this.props,instance:this.state.infoWindow}))},s.componentWillUnmount=function(){null!==this.state.infoWindow&&(u(this.registeredEvents),this.state.infoWindow.close())},s.render=function(){return this.containerElement?r.createPortal(e.Children.only(this.props.children),this.containerElement):e.createElement(e.Fragment,null)},o}(e.PureComponent);Y.contextType=c;var J={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},Q={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},visible:function(t,e){t.setVisible(e)}},X=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={polyline:null},e.setPolylineCallback=function(){null!==e.state.polyline&&e.props.onLoad&&e.props.onLoad(e.state.polyline)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.Polyline(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:Q,eventMap:J,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{polyline:t}}),this.setPolylineCallback)},o.componentDidUpdate=function(t){null!==this.state.polyline&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Q,eventMap:J,prevProps:t,nextProps:this.props,instance:this.state.polyline}))},o.componentWillUnmount=function(){null!==this.state.polyline&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),u(this.registeredEvents),this.state.polyline.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);X.contextType=c;var $={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},tt={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},paths:function(t,e){t.setPaths(e)},visible:function(t,e){t.setVisible(e)}},et=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={polygon:null},e.setPolygonCallback=function(){null!==e.state.polygon&&e.props.onLoad&&e.props.onLoad(e.state.polygon)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.Polygon(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:tt,eventMap:$,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{polygon:t}}),this.setPolygonCallback)},n.componentDidUpdate=function(t){null!==this.state.polygon&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:tt,eventMap:$,prevProps:t,nextProps:this.props,instance:this.state.polygon}))},n.componentWillUnmount=function(){null!==this.state.polygon&&(this.props.onUnmount&&this.props.onUnmount(this.state.polygon),u(this.registeredEvents),this.state.polygon&&this.state.polygon.setMap(null))},n.render=function(){return null},e}(e.PureComponent);et.contextType=c;var nt={onBoundsChanged:"bounds_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},ot={bounds:function(t,e){t.setBounds(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},visible:function(t,e){t.setVisible(e)}},rt=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={rectangle:null},e.setRectangleCallback=function(){null!==e.state.rectangle&&e.props.onLoad&&e.props.onLoad(e.state.rectangle)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.Rectangle(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:ot,eventMap:nt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{rectangle:t}}),this.setRectangleCallback)},o.componentDidUpdate=function(t){null!==this.state.rectangle&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:ot,eventMap:nt,prevProps:t,nextProps:this.props,instance:this.state.rectangle}))},o.componentWillUnmount=function(){null!==this.state.rectangle&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),u(this.registeredEvents),this.state.rectangle.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);rt.contextType=c;var st={onCenterChanged:"center_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRadiusChanged:"radius_changed",onRightClick:"rightclick"},it={center:function(t,e){t.setCenter(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},radius:function(t,e){t.setRadius(e)},visible:function(t,e){t.setVisible(e)}},at=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={circle:null},e.setCircleCallback=function(){null!==e.state.circle&&e.props.onLoad&&e.props.onLoad(e.state.circle)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.Circle(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:it,eventMap:st,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{circle:t}}),this.setCircleCallback)},o.componentDidUpdate=function(t){null!==this.state.circle&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:it,eventMap:st,prevProps:t,nextProps:this.props,instance:this.state.circle}))},o.componentWillUnmount=function(){null!==this.state.circle&&(this.props.onUnmount&&this.props.onUnmount(this.state.circle),u(this.registeredEvents),this.state.circle&&this.state.circle.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);at.contextType=c;var pt={onAddFeature:"addfeature",onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onRightClick:"rightclick",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},ct={add:function(t,e){t.add(e)},addgeojson:function(t,e,n){t.addGeoJson(e,n)},contains:function(t,e){t.contains(e)},foreach:function(t,e){t.forEach(e)},loadgeojson:function(t,e,n,o){t.loadGeoJson(e,n,o)},overridestyle:function(t,e,n){t.overrideStyle(e,n)},remove:function(t,e){t.remove(e)},revertstyle:function(t,e){t.revertStyle(e)},controlposition:function(t,e){t.setControlPosition(e)},controls:function(t,e){t.setControls(e)},drawingmode:function(t,e){t.setDrawingMode(e)},map:function(t,e){t.setMap(e)},style:function(t,e){t.setStyle(e)},togeojson:function(t,e){t.toGeoJson(e)}},lt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={data:null},e.setDataCallback=function(){null!==e.state.data&&e.props.onLoad&&e.props.onLoad(e.state.data)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.Data(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:ct,eventMap:pt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{data:t}}),this.setDataCallback)},n.componentDidUpdate=function(t){null!==this.state.data&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:ct,eventMap:pt,prevProps:t,nextProps:this.props,instance:this.state.data}))},n.componentWillUnmount=function(){null!==this.state.data&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),u(this.registeredEvents),this.state.data&&this.state.data.setMap(null))},n.render=function(){return null},e}(e.PureComponent);lt.contextType=c;var ut={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},dt={options:function(t,e){t.setOptions(e)},url:function(t,e){t.setUrl(e)},zIndex:function(t,e){t.setZIndex(e)}},ht=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={kmlLayer:null},e.setKmlLayerCallback=function(){null!==e.state.kmlLayer&&e.props.onLoad&&e.props.onLoad(e.state.kmlLayer)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.KmlLayer(i({},this.props.options,{map:this.context}));this.registeredEvents=d({updaterMap:dt,eventMap:ut,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{kmlLayer:t}}),this.setKmlLayerCallback)},n.componentDidUpdate=function(t){null!==this.state.kmlLayer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:dt,eventMap:ut,prevProps:t,nextProps:this.props,instance:this.state.kmlLayer}))},n.componentWillUnmount=function(){null!==this.state.kmlLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),u(this.registeredEvents),this.state.kmlLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);ht.contextType=c;var gt=function(t,e){return new e(t.lat,t.lng)},ft=function(t,e){return new e(new google.maps.LatLng(t.ne.lat,t.ne.lng),new google.maps.LatLng(t.sw.lat,t.sw.lng))},mt=function(t,e,n){return t instanceof e?t:n(t,e)},vt=function(t){function e(){return t.apply(this,arguments)||this}a(e,t);var n=e.prototype;return n.componentDidMount=function(){this.props.onLoad&&this.props.onLoad()},n.render=function(){return this.props.children},e}(e.Component);function yt(t){return t instanceof google.maps.LatLng?t:t?new google.maps.LatLng(t.lat,t.lng):t}function Mt(t){return t instanceof google.maps.LatLngBounds?t:t?new google.maps.LatLngBounds(new google.maps.LatLng(t.south,t.east),new google.maps.LatLng(t.north,t.west)):t}var Ct=function(t){function o(o){var r;return(r=t.call(this,o)||this).state={overlayView:null,containerStyle:{}},r.mapPaneEl=null,r.setOverlayViewCallback=function(){null!==r.state.overlayView&&r.props.onLoad&&r.props.onLoad(r.state.overlayView),r.onPositionElement()},r.onAdd=function(){var t;r.props.mapPaneName||n(!1);var e=null===(t=r.state.overlayView)||void 0===t?void 0:t.getPanes();e&&(r.mapPaneEl=e[r.props.mapPaneName])},r.onPositionElement=function(){if(null!==r.state.overlayView){var t=(e=r.state.overlayView.getProjection(),n=i({x:0,y:0},r.containerRef.current?(a=r.containerRef.current,"function"==typeof(p=r.props.getPixelPositionOffset)?p(a.offsetWidth,a.offsetHeight):{}):{}),s=r.props.position,void 0!==(o=r.props.bounds)?function(t,e,n){var o=t.fromLatLngToDivPixel(n.getNorthEast()),r=t.fromLatLngToDivPixel(n.getSouthWest());return o&&r?{left:r.x+e.x+"px",top:o.y+e.y+"px",width:o.x-r.x-e.x+"px",height:r.y-o.y-e.y+"px"}:{left:"-9999px",top:"-9999px"}}(e,n,mt(o,google.maps.LatLngBounds,ft)):function(t,e,n){var o=t.fromLatLngToDivPixel(n);return o?{left:o.x+e.x+"px",top:o.y+e.y+"px"}:{left:"-9999px",top:"-9999px"}}(e,n,mt(s,google.maps.LatLng,gt)));r.setState({containerStyle:t})}var e,n,o,s,a,p},r.draw=function(){r.onPositionElement()},r.onRemove=function(){r.mapPaneEl=null},r.containerRef=e.createRef(),r}a(o,t);var s=o.prototype;return s.componentDidMount=function(){var t=new google.maps.OverlayView;t.onAdd=this.onAdd,t.draw=this.draw,t.onRemove=this.onRemove,t.setMap(this.context),this.setState((function(){return{overlayView:t}}))},s.componentDidUpdate=function(t){var e=this,n=yt(t.position),o=yt(this.props.position),r=Mt(t.bounds),s=Mt(this.props.bounds);n===o&&r===s||setTimeout((function(){null!==e.state.overlayView&&e.state.overlayView.draw()}),0)},s.componentWillUnmount=function(){null!==this.state.overlayView&&(this.props.onUnmount&&this.props.onUnmount(this.state.overlayView),this.state.overlayView.setMap(null))},s.render=function(){return this.mapPaneEl?r.createPortal(e.createElement("div",{ref:this.containerRef,style:i({},this.state.containerStyle,{position:"absolute"})},e.createElement(vt,{onLoad:this.setOverlayViewCallback},e.Children.only(this.props.children))),this.mapPaneEl):e.createElement(e.Fragment,null)},o}(e.PureComponent);Ct.FLOAT_PANE="floatPane",Ct.MAP_PANE="mapPane",Ct.MARKER_LAYER="markerLayer",Ct.OVERLAY_LAYER="overlayLayer",Ct.OVERLAY_MOUSE_TARGET="overlayMouseTarget",Ct.contextType=c;var Et={onDblClick:"dblclick",onClick:"click"},Pt={opacity:function(t,e){t.setOpacity(e)}},kt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={groundOverlay:null},e.setGroundOverlayCallback=function(){null!==e.state.groundOverlay&&e.props.onLoad&&e.props.onLoad(e.state.groundOverlay)},e}a(e,t);var o=e.prototype;return o.componentDidMount=function(){this.props.url||this.props.bounds||n(!1);var t=new google.maps.GroundOverlay(this.props.url,this.props.bounds,i({},this.props.options,{map:this.context}));this.registeredEvents=d({updaterMap:Pt,eventMap:Et,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{groundOverlay:t}}),this.setGroundOverlayCallback)},o.componentDidUpdate=function(t){null!==this.state.groundOverlay&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Pt,eventMap:Et,prevProps:t,nextProps:this.props,instance:this.state.groundOverlay}))},o.componentWillUnmount=function(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))},o.render=function(){return null},e}(e.PureComponent);kt.defaultProps={onLoad:function(){}},kt.contextType=c;var xt={},Lt={data:function(t,e){t.setData(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)}},wt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={heatmapLayer:null},e.setHeatmapLayerCallback=function(){null!==e.state.heatmapLayer&&e.props.onLoad&&e.props.onLoad(e.state.heatmapLayer)},e}a(e,t);var o=e.prototype;return o.componentDidMount=function(){google.maps.visualization||n(!1),this.props.data||n(!1);var t=new google.maps.visualization.HeatmapLayer(i({},this.props.options||{},{data:this.props.data,map:this.context}));this.registeredEvents=d({updaterMap:Lt,eventMap:xt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{heatmapLayer:t}}),this.setHeatmapLayerCallback)},o.componentDidUpdate=function(t){u(this.registeredEvents),this.registeredEvents=d({updaterMap:Lt,eventMap:xt,prevProps:t,nextProps:this.props,instance:this.state.heatmapLayer})},o.componentWillUnmount=function(){null!==this.state.heatmapLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),u(this.registeredEvents),this.state.heatmapLayer.setMap(null))},o.render=function(){return null},e}(e.PureComponent);wt.contextType=c;var bt={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},St={register:function(t,e,n){t.registerPanoProvider(e,n)},links:function(t,e){t.setLinks(e)},motionTracking:function(t,e){t.setMotionTracking(e)},options:function(t,e){t.setOptions(e)},pano:function(t,e){t.setPano(e)},position:function(t,e){t.setPosition(e)},pov:function(t,e){t.setPov(e)},visible:function(t,e){t.setVisible(e)},zoom:function(t,e){t.setZoom(e)}},Dt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={streetViewPanorama:null},e.setStreetViewPanoramaCallback=function(){null!==e.state.streetViewPanorama&&e.props.onLoad&&e.props.onLoad(e.state.streetViewPanorama)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=this.context.getStreetView();this.registeredEvents=d({updaterMap:St,eventMap:bt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{streetViewPanorama:t}}),this.setStreetViewPanoramaCallback)},n.componentDidUpdate=function(t){null!==this.state.streetViewPanorama&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:St,eventMap:bt,prevProps:t,nextProps:this.props,instance:this.state.streetViewPanorama}))},n.componentWillUnmount=function(){null!==this.state.streetViewPanorama&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),u(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))},n.render=function(){return null},e}(e.PureComponent);Dt.contextType=c;var Ut=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={streetViewService:null},e.setStreetViewServiceCallback=function(){null!==e.state.streetViewService&&e.props.onLoad&&e.props.onLoad(e.state.streetViewService)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.StreetViewService;this.setState((function(){return{streetViewService:t}}),this.setStreetViewServiceCallback)},n.componentWillUnmount=function(){null!==this.state.streetViewService&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)},n.render=function(){return null},e}(e.PureComponent);Ut.contextType=c;var Ot=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).state={directionsService:null},e.setDirectionsServiceCallback=function(){null!==e.state.directionsService&&e.props.onLoad&&e.props.onLoad(e.state.directionsService)},e}a(o,t);var r=o.prototype;return r.componentDidMount=function(){this.props.options||n(!1);var t=new google.maps.DirectionsService;this.setState((function(){return{directionsService:t}}),this.setDirectionsServiceCallback)},r.componentDidUpdate=function(){null!==this.state.directionsService&&this.state.directionsService.route(this.props.options,this.props.callback)},r.componentWillUnmount=function(){null!==this.state.directionsService&&this.props.onUnmount&&this.props.onUnmount(this.state.directionsService)},r.render=function(){return e.createElement(e.Fragment,null)},o}(e.PureComponent),Rt={onDirectionsChanged:"directions_changed"},Tt={directions:function(t,e){t.setDirections(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},panel:function(t,e){t.setPanel(e)},routeIndex:function(t,e){t.setRouteIndex(e)}},Vt=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={directionsRenderer:null},e.setDirectionsRendererCallback=function(){null!==e.state.directionsRenderer&&(e.state.directionsRenderer.setMap(e.context),e.props.onLoad&&e.props.onLoad(e.state.directionsRenderer))},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=d({updaterMap:Tt,eventMap:Rt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{directionsRenderer:t}}),this.setDirectionsRendererCallback)},o.componentDidUpdate=function(t){null!==this.state.directionsRenderer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Tt,eventMap:Rt,prevProps:t,nextProps:this.props,instance:this.state.directionsRenderer}))},o.componentWillUnmount=function(){null!==this.state.directionsRenderer&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),u(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);Vt.contextType=c;var It=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).state={distanceMatrixService:null},e.setDistanceMatrixServiceCallback=function(){null!==e.state.distanceMatrixService&&e.props.onLoad&&e.props.onLoad(e.state.distanceMatrixService)},e}a(o,t);var r=o.prototype;return r.componentDidMount=function(){this.props.options||n(!1);var t=new google.maps.DistanceMatrixService;this.setState((function(){return{distanceMatrixService:t}}),this.setDistanceMatrixServiceCallback)},r.componentDidUpdate=function(){null!==this.state.distanceMatrixService&&this.state.distanceMatrixService.getDistanceMatrix(this.props.options,this.props.callback)},r.componentWillUnmount=function(){null!==this.state.distanceMatrixService&&this.props.onUnmount&&this.props.onUnmount(this.state.distanceMatrixService)},r.render=function(){return e.createElement(e.Fragment,null)},o}(e.PureComponent),_t={onPlacesChanged:"places_changed"},Bt={bounds:function(t,e){t.setBounds(e)}},Wt=function(t){function o(){var n;return(n=t.apply(this,arguments)||this).registeredEvents=[],n.containerElement=e.createRef(),n.state={searchBox:null},n.setSearchBoxCallback=function(){null!==n.state.searchBox&&n.props.onLoad&&n.props.onLoad(n.state.searchBox)},n}a(o,t);var r=o.prototype;return r.componentDidMount=function(){if(google.maps.places||n(!1),null!==this.containerElement&&null!==this.containerElement.current){var t=this.containerElement.current.querySelector("input");if(null!==t){var e=new google.maps.places.SearchBox(t,this.props.options);this.registeredEvents=d({updaterMap:Bt,eventMap:_t,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{searchBox:e}}),this.setSearchBoxCallback)}}},r.componentDidUpdate=function(t){null!==this.state.searchBox&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Bt,eventMap:_t,prevProps:t,nextProps:this.props,instance:this.state.searchBox}))},r.componentWillUnmount=function(){null!==this.state.searchBox&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),u(this.registeredEvents))},r.render=function(){return e.createElement("div",{ref:this.containerElement},e.Children.only(this.props.children))},o}(e.PureComponent);Wt.contextType=c;var At={onPlaceChanged:"place_changed"},jt={bounds:function(t,e){t.setBounds(e)},restrictions:function(t,e){t.setComponentRestrictions(e)},fields:function(t,e){t.setFields(e)},options:function(t,e){t.setOptions(e)},types:function(t,e){t.setTypes(e)}},Nt=function(t){function o(){var n;return(n=t.apply(this,arguments)||this).registeredEvents=[],n.containerElement=e.createRef(),n.state={autocomplete:null},n.setAutocompleteCallback=function(){null!==n.state.autocomplete&&n.props.onLoad&&n.props.onLoad(n.state.autocomplete)},n}a(o,t);var r=o.prototype;return r.componentDidMount=function(){google.maps.places||n(!1);var t=this.containerElement.current.querySelector("input");if(t){var e=new google.maps.places.Autocomplete(t,this.props.options);this.registeredEvents=d({updaterMap:jt,eventMap:At,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{autocomplete:e}}),this.setAutocompleteCallback)}},r.componentDidUpdate=function(t){u(this.registeredEvents),this.registeredEvents=d({updaterMap:jt,eventMap:At,prevProps:t,nextProps:this.props,instance:this.state.autocomplete})},r.componentWillUnmount=function(){null!==this.state.autocomplete&&u(this.registeredEvents)},r.render=function(){return e.createElement("div",{ref:this.containerElement},e.Children.only(this.props.children))},o}(e.PureComponent);Nt.contextType=c,t.Autocomplete=Nt,t.BicyclingLayer=T,t.Circle=at,t.Data=lt,t.DirectionsRenderer=Vt,t.DirectionsService=Ot,t.DistanceMatrixService=It,t.DrawingManager=B,t.GoogleMap=f,t.GroundOverlay=kt,t.HeatmapLayer=wt,t.InfoBox=H,t.InfoWindow=Y,t.KmlLayer=ht,t.LoadScript=L,t.LoadScriptNext=D,t.MapContext=c,t.Marker=j,t.MarkerClusterer=F,t.OverlayView=Ct,t.Polygon=et,t.Polyline=X,t.Rectangle=rt,t.StandaloneSearchBox=Wt,t.StreetViewPanorama=Dt,t.StreetViewService=Ut,t.TrafficLayer=R,t.TransitLayer=V,t.useGoogleMap=function(){e.useContext||n(!1);var t=e.useContext(c);return t||n(!1),t},t.useLoadScript=w})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("invariant"),require("@react-google-maps/marker-clusterer"),require("react-dom"),require("@react-google-maps/infobox")):"function"==typeof define&&define.amd?define(["exports","react","invariant","@react-google-maps/marker-clusterer","react-dom","@react-google-maps/infobox"],e):e((t=t||self).reactGoogleMapsApi={},t.React,t.invariant,t.markerClusterer,t.ReactDOM,t.infobox)}(this,(function(t,e,n,o,r,s){"use strict";function i(){return(i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t}).apply(this,arguments)}function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function p(t,e){if(null==t)return{};var n,o,r={},s=Object.keys(t);for(o=0;o<s.length;o++)e.indexOf(n=s[o])>=0||(r[n]=t[n]);return r}n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;var c=e.createContext(null);function l(t){google.maps.event.removeListener(t)}function u(t){void 0===t&&(t=[]),t.forEach(l)}function d(t){var e=t.updaterMap,n=t.prevProps,o=t.nextProps,r=t.instance,s=function(t,e,n){return o=n,Object.keys(o).reduce((function(n,r){return s=n,"function"==typeof t[i=r]&&s.push(google.maps.event.addListener(e,o[r],t[i])),s;var s,i}),[]);var o}(o,r,t.eventMap);return function(t,e,n,o){var r,s={};r=t,Object.keys(r).forEach((function(t){return function(t,r){var i=n[r];i!==e[r]&&(s[r]=i,t(o,i))}(r[t],t)}))}(e,n,o,r),s}var h={onDblClick:"dblclick",onDragEnd:"dragend",onDragStart:"dragstart",onMapTypeIdChanged:"maptypeid_changed",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseDown:"mousedown",onMouseUp:"mouseup",onRightClick:"rightclick",onTilesLoaded:"tilesloaded",onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onDrag:"drag",onHeadingChanged:"heading_changed",onIdle:"idle",onProjectionChanged:"projection_changed",onResize:"resize",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed"},g={extraMapTypes:function(t,e){e.forEach((function(e,n){t.mapTypes.set(String(n),e)}))},center:function(t,e){t.setCenter(e)},clickableIcons:function(t,e){t.setClickableIcons(e)},heading:function(t,e){t.setHeading(e)},mapTypeId:function(t,e){t.setMapTypeId(e)},options:function(t,e){t.setOptions(e)},streetView:function(t,e){t.setStreetView(e)},tilt:function(t,e){t.setTilt(e)},zoom:function(t,e){t.setZoom(e)}},f=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={map:null},e.registeredEvents=[],e.mapRef=null,e.getInstance=function(){return null===e.mapRef?null:new google.maps.Map(e.mapRef,e.props.options)},e.panTo=function(t){var n=e.getInstance();n&&n.panTo(t)},e.setMapCallback=function(){null!==e.state.map&&e.props.onLoad&&e.props.onLoad(e.state.map)},e.getRef=function(t){e.mapRef=t},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=this.getInstance();this.registeredEvents=d({updaterMap:g,eventMap:h,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{map:t}}),this.setMapCallback)},o.componentDidUpdate=function(t){null!==this.state.map&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:g,eventMap:h,prevProps:t,nextProps:this.props,instance:this.state.map}))},o.componentWillUnmount=function(){null!==this.state.map&&(this.props.onUnmount&&this.props.onUnmount(this.state.map),u(this.registeredEvents))},o.render=function(){return e.createElement("div",{id:this.props.id,ref:this.getRef,style:this.props.mapContainerStyle,className:this.props.mapContainerClassName},e.createElement(c.Provider,{value:this.state.map},null!==this.state.map?this.props.children:e.createElement(e.Fragment,null)))},n}(e.PureComponent),m="undefined"!=typeof document,v=function(t){var e=t.url,n=t.id;return m?new Promise((function(t,o){var r=document.getElementById(n),s=window;if(r){var i=r.getAttribute("data-state");if(r.src===e&&"error"!==i){if("ready"===i)return t(n);var a=s.initMap,p=r.onerror;return s.initMap=function(){a&&a(),t(n)},void(r.onerror=function(t){p&&p(t),o(t)})}r.remove()}var c=document.createElement("script");c.type="text/javascript",c.src=e,c.id=n,c.async=!0,c.onerror=function(t){c.setAttribute("data-state","error"),o(t)},s.initMap=function(){c.setAttribute("data-state","ready"),t(n)},document.head.appendChild(c)})).catch((function(t){throw console.error("injectScript error: ",t),t})):Promise.reject(new Error("document is undefined"))},y=function(t){return!((!t.href||0!==t.href.indexOf("https://fonts.googleapis.com/css?family=Roboto"))&&("style"===t.tagName.toLowerCase()&&t.styleSheet&&t.styleSheet.cssText&&0===t.styleSheet.cssText.replace("\r\n","").indexOf(".gm-style")?(t.styleSheet.cssText="",0):"style"===t.tagName.toLowerCase()&&t.innerHTML&&0===t.innerHTML.replace("\r\n","").indexOf(".gm-style")?(t.innerHTML="",0):"style"!==t.tagName.toLowerCase()||t.styleSheet||t.innerHTML))},M=function(){var t=document.getElementsByTagName("head")[0],e=t.insertBefore.bind(t);t.insertBefore=function(n,o){y(n)||Reflect.apply(e,t,[n,o])};var n=t.appendChild.bind(t);t.appendChild=function(e){y(e)||Reflect.apply(n,t,[e])}};function C(t){var e=t.googleMapsApiKey,o=t.googleMapsClientId,r=t.version,s=void 0===r?"weekly":r,i=t.language,a=t.region,p=t.libraries,c=t.channel,l=[];return e&&o||!e||!o||n(!1),e?l.push("key="+e):o&&l.push("client="+o),s&&l.push("v="+s),i&&l.push("language="+i),a&&l.push("region="+a),p&&p.length&&l.push("libraries="+p.sort().join(",")),c&&l.push("channel="+c),l.push("callback=initMap"),"https://maps.googleapis.com/maps/api/js?"+l.join("&")}var E=!1;function P(){return e.createElement("div",null,"Loading...")}var k,x={id:"script-loader",version:"weekly"},L=function(t){function o(){var o;return(o=t.apply(this,arguments)||this).check=e.createRef(),o.state={loaded:!1},o.cleanupCallback=function(){delete window.google,o.injectScript()},o.isCleaningUp=function(){try{return Promise.resolve(new Promise((function(t){if(E){if(m)var e=window.setInterval((function(){E||(window.clearInterval(e),t())}),1)}else t()})))}catch(t){return Promise.reject(t)}},o.cleanup=function(){E=!0;var t=document.getElementById(o.props.id);t&&t.parentNode&&t.parentNode.removeChild(t),Array.prototype.slice.call(document.getElementsByTagName("script")).filter((function(t){return"string"==typeof t.src&&t.src.includes("maps.googleapis")})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)})),Array.prototype.slice.call(document.getElementsByTagName("link")).filter((function(t){return"https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"===t.href})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)})),Array.prototype.slice.call(document.getElementsByTagName("style")).filter((function(t){return void 0!==t.innerText&&t.innerText.length>0&&t.innerText.includes(".gm-")})).forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)}))},o.injectScript=function(){o.props.preventGoogleFontsLoading&&M(),o.props.id||n(!1);var t={id:o.props.id,url:C(o.props)};v(t).then((function(){o.props.onLoad&&o.props.onLoad(),o.setState((function(){return{loaded:!0}}))})).catch((function(t){o.props.onError&&o.props.onError(t),console.error("\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key ("+(o.props.googleMapsApiKey||"-")+") or Client ID ("+(o.props.googleMapsClientId||"-")+") to <LoadScript />\n Otherwise it is a Network issue.\n ")}))},o}a(o,t);var r=o.prototype;return r.componentDidMount=function(){if(m){if(window.google&&!E)return void console.error("google api is already presented");this.isCleaningUp().then(this.injectScript).catch((function(t){console.error("Error at injecting script after cleaning up: ",t)}))}},r.componentDidUpdate=function(t){this.props.libraries!==t.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),m&&t.language!==this.props.language&&(this.cleanup(),this.setState((function(){return{loaded:!1}}),this.cleanupCallback))},r.componentWillUnmount=function(){var t=this;m&&(this.cleanup(),window.setTimeout((function(){t.check.current||(delete window.google,E=!1)}),1),this.props.onUnmount&&this.props.onUnmount())},r.render=function(){return e.createElement(e.Fragment,null,e.createElement("div",{ref:this.check}),this.state.loaded?this.props.children:this.props.loadingElement||e.createElement(P,null))},o}(e.PureComponent);function w(t){var o=t.id,r=void 0===o?x.id:o,s=t.version,i=void 0===s?x.version:s,a=t.googleMapsApiKey,p=t.googleMapsClientId,c=t.language,l=t.region,u=t.libraries,d=t.preventGoogleFontsLoading,h=t.channel,g=e.useRef(!1),f=e.useState(!1),y=f[0],E=f[1],P=e.useState(void 0),L=P[0],w=P[1];e.useEffect((function(){return g.current=!0,function(){g.current=!1}}),[]),e.useEffect((function(){m&&d&&M()}),[d]),e.useEffect((function(){y&&(window.google||n(!1))}),[y]);var b=C({version:i,googleMapsApiKey:a,googleMapsClientId:p,language:c,region:l,libraries:u,channel:h});e.useEffect((function(){function t(){g.current&&(E(!0),k=b)}m&&(window.google&&k===b?t():v({id:r,url:b}).then(t).catch((function(t){g.current&&w(t),console.warn("\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key ("+(a||"-")+") or Client ID ("+(p||"-")+")\n Otherwise it is a Network issue.\n "),console.error(t)})))}),[r,b]);var S=e.useRef();return e.useEffect((function(){S.current&&u!==S.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),S.current=u}),[u]),{isLoaded:y,loadError:L,url:b}}L.defaultProps=x;var b=e.createElement(P,null);function S(t){var n=t.loadingElement,o=t.onLoad,r=t.onError,s=t.onUnmount,i=t.children,a=w(p(t,["loadingElement","onLoad","onError","onUnmount","children"])),c=a.isLoaded,l=a.loadError;return e.useEffect((function(){c&&"function"==typeof o&&o()}),[c,o]),e.useEffect((function(){l&&"function"==typeof r&&r(l)}),[l,r]),e.useEffect((function(){return function(){s&&s()}}),[s]),c?i:n||b}var D=e.memo(S),U={},O={options:function(t,e){t.setOptions(e)}},R=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={trafficLayer:null},e.setTrafficLayerCallback=function(){null!==e.state.trafficLayer&&e.props.onLoad&&e.props.onLoad(e.state.trafficLayer)},e.registeredEvents=[],e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.TrafficLayer(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:O,eventMap:U,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{trafficLayer:t}}),this.setTrafficLayerCallback)},n.componentDidUpdate=function(t){null!==this.state.trafficLayer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:O,eventMap:U,prevProps:t,nextProps:this.props,instance:this.state.trafficLayer}))},n.componentWillUnmount=function(){null!==this.state.trafficLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),u(this.registeredEvents),this.state.trafficLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);R.contextType=c;var T=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={bicyclingLayer:null},e.setBicyclingLayerCallback=function(){null!==e.state.bicyclingLayer&&(e.state.bicyclingLayer.setMap(e.context),e.props.onLoad&&e.props.onLoad(e.state.bicyclingLayer))},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.BicyclingLayer;this.setState((function(){return{bicyclingLayer:t}}),this.setBicyclingLayerCallback)},n.componentWillUnmount=function(){null!==this.state.bicyclingLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);T.contextType=c;var V=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={transitLayer:null},e.setTransitLayerCallback=function(){null!==e.state.transitLayer&&(e.state.transitLayer.setMap(e.context),e.props.onLoad&&e.props.onLoad(e.state.transitLayer))},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.TransitLayer;this.setState((function(){return{transitLayer:t}}),this.setTransitLayerCallback)},n.componentWillUnmount=function(){null!==this.state.transitLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);V.contextType=c;var I={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},_={drawingMode:function(t,e){t.setDrawingMode(e)},options:function(t,e){t.setOptions(e)}},B=function(t){function o(e){var o;return(o=t.call(this,e)||this).registeredEvents=[],o.state={drawingManager:null},o.setDrawingManagerCallback=function(){null!==o.state.drawingManager&&o.props.onLoad&&o.props.onLoad(o.state.drawingManager)},google.maps.drawing||n(!1),o}a(o,t);var r=o.prototype;return r.componentDidMount=function(){var t=new google.maps.drawing.DrawingManager(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:_,eventMap:I,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{drawingManager:t}}),this.setDrawingManagerCallback)},r.componentDidUpdate=function(t){null!==this.state.drawingManager&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:_,eventMap:I,prevProps:t,nextProps:this.props,instance:this.state.drawingManager}))},r.componentWillUnmount=function(){null!==this.state.drawingManager&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),u(this.registeredEvents),this.state.drawingManager.setMap(null))},r.render=function(){return e.createElement(e.Fragment,null)},o}(e.PureComponent);B.contextType=c;var W={onAnimationChanged:"animation_changed",onClick:"click",onClickableChanged:"clickable_changed",onCursorChanged:"cursor_changed",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDraggableChanged:"draggable_changed",onDragStart:"dragstart",onFlatChanged:"flat_changed",onIconChanged:"icon_changed",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onPositionChanged:"position_changed",onRightClick:"rightclick",onShapeChanged:"shape_changed",onTitleChanged:"title_changed",onVisibleChanged:"visible_changed",onZindexChanged:"zindex_changed"},A={animation:function(t,e){t.setAnimation(e)},clickable:function(t,e){t.setClickable(e)},cursor:function(t,e){t.setCursor(e)},draggable:function(t,e){t.setDraggable(e)},icon:function(t,e){t.setIcon(e)},label:function(t,e){t.setLabel(e)},map:function(t,e){t.setMap(e)},opacity:function(t,e){t.setOpacity(e)},options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},shape:function(t,e){t.setShape(e)},title:function(t,e){t.setTitle(e)},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},j=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={marker:null},e.setMarkerCallback=function(){null!==e.state.marker&&e.props.onLoad&&e.props.onLoad(e.state.marker)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=i({},this.props.options||{},{},this.props.clusterer?{}:{map:this.context},{position:this.props.position}),e=new google.maps.Marker(t);this.props.clusterer?this.props.clusterer.addMarker(e,!!this.props.noClustererRedraw):e.setMap(this.context),this.registeredEvents=d({updaterMap:A,eventMap:W,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{marker:e}}),this.setMarkerCallback)},o.componentDidUpdate=function(t){null!==this.state.marker&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:A,eventMap:W,prevProps:t,nextProps:this.props,instance:this.state.marker}))},o.componentWillUnmount=function(){null!==this.state.marker&&(this.props.onUnmount&&this.props.onUnmount(this.state.marker),u(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.state.marker,!!this.props.noClustererRedraw):this.state.marker&&this.state.marker.setMap(null))},o.render=function(){var t=this,n=null;return this.props.children&&(n=e.Children.map(this.props.children,(function(n){return e.isValidElement(n)?e.cloneElement(n,{anchor:t.state.marker}):n}))),n||null},n}(e.PureComponent);j.contextType=c;var N={onClick:"click",onClusteringBegin:"clusteringbegin",onClusteringEnd:"clusteringend",onMouseOut:"mouseout",onMouseOver:"mouseover"},z={averageCenter:function(t,e){t.setAverageCenter(e)},batchSizeIE:function(t,e){t.setBatchSizeIE(e)},calculator:function(t,e){t.setCalculator(e)},clusterClass:function(t,e){t.setClusterClass(e)},enableRetinaIcons:function(t,e){t.setEnableRetinaIcons(e)},gridSize:function(t,e){t.setGridSize(e)},ignoreHidden:function(t,e){t.setIgnoreHidden(e)},imageExtension:function(t,e){t.setImageExtension(e)},imagePath:function(t,e){t.setImagePath(e)},imageSizes:function(t,e){t.setImageSizes(e)},maxZoom:function(t,e){t.setMaxZoom(e)},minimumClusterSize:function(t,e){t.setMinimumClusterSize(e)},styles:function(t,e){t.setStyles(e)},title:function(t,e){t.setTitle(e)},zoomOnClick:function(t,e){t.setZoomOnClick(e)}},F=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={markerClusterer:null},e.setClustererCallback=function(){null!==e.state.markerClusterer&&e.props.onLoad&&e.props.onLoad(e.state.markerClusterer)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){if(this.context){var t=new o.Clusterer(this.context,[],this.props.options);this.registeredEvents=d({updaterMap:z,eventMap:N,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{markerClusterer:t}}),this.setClustererCallback)}},n.componentDidUpdate=function(t){this.state.markerClusterer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:z,eventMap:N,prevProps:t,nextProps:this.props,instance:this.state.markerClusterer}))},n.componentWillUnmount=function(){null!==this.state.markerClusterer&&(this.props.onUnmount&&this.props.onUnmount(this.state.markerClusterer),u(this.registeredEvents),this.state.markerClusterer.setMap(null))},n.render=function(){return null!==this.state.markerClusterer?this.props.children(this.state.markerClusterer):null},e}(e.PureComponent);F.contextType=c;var G={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},Z={options:function(t,e){t.setOptions(e)},position:function(t,e){e instanceof google.maps.LatLng?t.setPosition(e):t.setPosition(new google.maps.LatLng(e.lat,e.lng))},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},H=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.containerElement=null,e.state={infoBox:null},e.open=function(t,o){o?t.open(e.context,o):t.getPosition()?t.open(e.context):n(!1)},e.setInfoBoxCallback=function(){var t=e.props,n=t.anchor,o=t.onLoad,r=e.state.infoBox;null!==r&&null!==e.containerElement&&(r.setContent(e.containerElement),e.open(r,n),o&&o(r))},e}a(o,t);var c=o.prototype;return c.componentDidMount=function(){var t,e=this.props.options||{},n=e.position,o=p(e,["position"]);!n||n instanceof google.maps.LatLng||(t=new google.maps.LatLng(n.lat,n.lng));var r=new s.InfoBox(i({},o,{},t?{position:t}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=d({updaterMap:Z,eventMap:G,prevProps:{},nextProps:this.props,instance:r}),this.setState({infoBox:r},this.setInfoBoxCallback)},c.componentDidUpdate=function(t){var e=this.state.infoBox;null!==e&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Z,eventMap:G,prevProps:t,nextProps:this.props,instance:e}))},c.componentWillUnmount=function(){var t=this.props.onUnmount,e=this.state.infoBox;null!==e&&(t&&t(e),u(this.registeredEvents),e.close())},c.render=function(){return this.containerElement?r.createPortal(e.Children.only(this.props.children),this.containerElement):null},o}(e.PureComponent);H.contextType=c;var K={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},q={options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},zIndex:function(t,e){t.setZIndex(e)}},Y=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.containerElement=null,e.state={infoWindow:null},e.open=function(t,o){o?t.open(e.context,o):t.getPosition()?t.open(e.context):n(!1)},e.setInfoWindowCallback=function(){null!==e.state.infoWindow&&null!==e.containerElement&&(e.state.infoWindow.setContent(e.containerElement),e.open(e.state.infoWindow,e.props.anchor),e.props.onLoad&&e.props.onLoad(e.state.infoWindow))},e}a(o,t);var s=o.prototype;return s.componentDidMount=function(){var t=new google.maps.InfoWindow(i({},this.props.options||{}));this.containerElement=document.createElement("div"),this.registeredEvents=d({updaterMap:q,eventMap:K,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{infoWindow:t}}),this.setInfoWindowCallback)},s.componentDidUpdate=function(t){null!==this.state.infoWindow&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:q,eventMap:K,prevProps:t,nextProps:this.props,instance:this.state.infoWindow}))},s.componentWillUnmount=function(){null!==this.state.infoWindow&&(u(this.registeredEvents),this.state.infoWindow.close())},s.render=function(){return this.containerElement?r.createPortal(e.Children.only(this.props.children),this.containerElement):e.createElement(e.Fragment,null)},o}(e.PureComponent);Y.contextType=c;var J={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},Q={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},visible:function(t,e){t.setVisible(e)}},X=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={polyline:null},e.setPolylineCallback=function(){null!==e.state.polyline&&e.props.onLoad&&e.props.onLoad(e.state.polyline)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.Polyline(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:Q,eventMap:J,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{polyline:t}}),this.setPolylineCallback)},o.componentDidUpdate=function(t){null!==this.state.polyline&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Q,eventMap:J,prevProps:t,nextProps:this.props,instance:this.state.polyline}))},o.componentWillUnmount=function(){null!==this.state.polyline&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),u(this.registeredEvents),this.state.polyline.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);X.contextType=c;var $={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},tt={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},paths:function(t,e){t.setPaths(e)},visible:function(t,e){t.setVisible(e)}},et=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={polygon:null},e.setPolygonCallback=function(){null!==e.state.polygon&&e.props.onLoad&&e.props.onLoad(e.state.polygon)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.Polygon(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:tt,eventMap:$,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{polygon:t}}),this.setPolygonCallback)},n.componentDidUpdate=function(t){null!==this.state.polygon&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:tt,eventMap:$,prevProps:t,nextProps:this.props,instance:this.state.polygon}))},n.componentWillUnmount=function(){null!==this.state.polygon&&(this.props.onUnmount&&this.props.onUnmount(this.state.polygon),u(this.registeredEvents),this.state.polygon&&this.state.polygon.setMap(null))},n.render=function(){return null},e}(e.PureComponent);et.contextType=c;var nt={onBoundsChanged:"bounds_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},ot={bounds:function(t,e){t.setBounds(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},visible:function(t,e){t.setVisible(e)}},rt=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={rectangle:null},e.setRectangleCallback=function(){null!==e.state.rectangle&&e.props.onLoad&&e.props.onLoad(e.state.rectangle)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.Rectangle(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:ot,eventMap:nt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{rectangle:t}}),this.setRectangleCallback)},o.componentDidUpdate=function(t){null!==this.state.rectangle&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:ot,eventMap:nt,prevProps:t,nextProps:this.props,instance:this.state.rectangle}))},o.componentWillUnmount=function(){null!==this.state.rectangle&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),u(this.registeredEvents),this.state.rectangle.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);rt.contextType=c;var st={onCenterChanged:"center_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRadiusChanged:"radius_changed",onRightClick:"rightclick"},it={center:function(t,e){t.setCenter(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},radius:function(t,e){t.setRadius(e)},visible:function(t,e){t.setVisible(e)}},at=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={circle:null},e.setCircleCallback=function(){null!==e.state.circle&&e.props.onLoad&&e.props.onLoad(e.state.circle)},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.Circle(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:it,eventMap:st,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{circle:t}}),this.setCircleCallback)},o.componentDidUpdate=function(t){null!==this.state.circle&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:it,eventMap:st,prevProps:t,nextProps:this.props,instance:this.state.circle}))},o.componentWillUnmount=function(){null!==this.state.circle&&(this.props.onUnmount&&this.props.onUnmount(this.state.circle),u(this.registeredEvents),this.state.circle&&this.state.circle.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);at.contextType=c;var pt={onAddFeature:"addfeature",onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onRightClick:"rightclick",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},ct={add:function(t,e){t.add(e)},addgeojson:function(t,e,n){t.addGeoJson(e,n)},contains:function(t,e){t.contains(e)},foreach:function(t,e){t.forEach(e)},loadgeojson:function(t,e,n,o){t.loadGeoJson(e,n,o)},overridestyle:function(t,e,n){t.overrideStyle(e,n)},remove:function(t,e){t.remove(e)},revertstyle:function(t,e){t.revertStyle(e)},controlposition:function(t,e){t.setControlPosition(e)},controls:function(t,e){t.setControls(e)},drawingmode:function(t,e){t.setDrawingMode(e)},map:function(t,e){t.setMap(e)},style:function(t,e){t.setStyle(e)},togeojson:function(t,e){t.toGeoJson(e)}},lt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={data:null},e.setDataCallback=function(){null!==e.state.data&&e.props.onLoad&&e.props.onLoad(e.state.data)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.Data(i({},this.props.options||{},{map:this.context}));this.registeredEvents=d({updaterMap:ct,eventMap:pt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{data:t}}),this.setDataCallback)},n.componentDidUpdate=function(t){null!==this.state.data&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:ct,eventMap:pt,prevProps:t,nextProps:this.props,instance:this.state.data}))},n.componentWillUnmount=function(){null!==this.state.data&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),u(this.registeredEvents),this.state.data&&this.state.data.setMap(null))},n.render=function(){return null},e}(e.PureComponent);lt.contextType=c;var ut={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},dt={options:function(t,e){t.setOptions(e)},url:function(t,e){t.setUrl(e)},zIndex:function(t,e){t.setZIndex(e)}},ht=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={kmlLayer:null},e.setKmlLayerCallback=function(){null!==e.state.kmlLayer&&e.props.onLoad&&e.props.onLoad(e.state.kmlLayer)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.KmlLayer(i({},this.props.options,{map:this.context}));this.registeredEvents=d({updaterMap:dt,eventMap:ut,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{kmlLayer:t}}),this.setKmlLayerCallback)},n.componentDidUpdate=function(t){null!==this.state.kmlLayer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:dt,eventMap:ut,prevProps:t,nextProps:this.props,instance:this.state.kmlLayer}))},n.componentWillUnmount=function(){null!==this.state.kmlLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),u(this.registeredEvents),this.state.kmlLayer.setMap(null))},n.render=function(){return null},e}(e.PureComponent);ht.contextType=c;var gt=function(t,e){return new e(t.lat,t.lng)},ft=function(t,e){return new e(new google.maps.LatLng(t.ne.lat,t.ne.lng),new google.maps.LatLng(t.sw.lat,t.sw.lng))},mt=function(t,e,n){return t instanceof e?t:n(t,e)},vt=function(t){function e(){return t.apply(this,arguments)||this}a(e,t);var n=e.prototype;return n.componentDidMount=function(){this.props.onLoad&&this.props.onLoad()},n.render=function(){return this.props.children},e}(e.Component);function yt(t){return t?(t instanceof google.maps.LatLng?t:new google.maps.LatLng(t.lat,t.lng))+"":""}function Mt(t){return t?(t instanceof google.maps.LatLngBounds?t:new google.maps.LatLngBounds(new google.maps.LatLng(t.south,t.east),new google.maps.LatLng(t.north,t.west)))+"":""}var Ct=function(t){function o(o){var r;return(r=t.call(this,o)||this).state={overlayView:null,containerStyle:{}},r.mapPaneEl=null,r.setOverlayViewCallback=function(){null!==r.state.overlayView&&r.props.onLoad&&r.props.onLoad(r.state.overlayView),r.onPositionElement()},r.onAdd=function(){var t;r.props.mapPaneName||n(!1);var e=null===(t=r.state.overlayView)||void 0===t?void 0:t.getPanes();e&&(r.mapPaneEl=e[r.props.mapPaneName])},r.onPositionElement=function(){if(null!==r.state.overlayView){var t=(e=r.state.overlayView.getProjection(),n=i({x:0,y:0},r.containerRef.current?(a=r.containerRef.current,"function"==typeof(p=r.props.getPixelPositionOffset)?p(a.offsetWidth,a.offsetHeight):{}):{}),s=r.props.position,void 0!==(o=r.props.bounds)?function(t,e,n){var o=t.fromLatLngToDivPixel(n.getNorthEast()),r=t.fromLatLngToDivPixel(n.getSouthWest());return o&&r?{left:r.x+e.x+"px",top:o.y+e.y+"px",width:o.x-r.x-e.x+"px",height:r.y-o.y-e.y+"px"}:{left:"-9999px",top:"-9999px"}}(e,n,mt(o,google.maps.LatLngBounds,ft)):function(t,e,n){var o=t.fromLatLngToDivPixel(n);return o?{left:o.x+e.x+"px",top:o.y+e.y+"px"}:{left:"-9999px",top:"-9999px"}}(e,n,mt(s,google.maps.LatLng,gt)));r.setState({containerStyle:t})}var e,n,o,s,a,p},r.draw=function(){r.onPositionElement()},r.onRemove=function(){r.mapPaneEl=null},r.containerRef=e.createRef(),r}a(o,t);var s=o.prototype;return s.componentDidMount=function(){var t=new google.maps.OverlayView;t.onAdd=this.onAdd,t.draw=this.draw,t.onRemove=this.onRemove,t.setMap(this.context),this.setState((function(){return{overlayView:t}}))},s.componentDidUpdate=function(t){var e=this,n=yt(t.position),o=yt(this.props.position),r=Mt(t.bounds),s=Mt(this.props.bounds);n===o&&r===s||setTimeout((function(){null!==e.state.overlayView&&e.state.overlayView.draw()}),0)},s.componentWillUnmount=function(){null!==this.state.overlayView&&(this.props.onUnmount&&this.props.onUnmount(this.state.overlayView),this.state.overlayView.setMap(null))},s.render=function(){return this.mapPaneEl?r.createPortal(e.createElement("div",{ref:this.containerRef,style:i({},this.state.containerStyle,{position:"absolute"})},e.createElement(vt,{onLoad:this.setOverlayViewCallback},e.Children.only(this.props.children))),this.mapPaneEl):e.createElement(e.Fragment,null)},o}(e.PureComponent);Ct.FLOAT_PANE="floatPane",Ct.MAP_PANE="mapPane",Ct.MARKER_LAYER="markerLayer",Ct.OVERLAY_LAYER="overlayLayer",Ct.OVERLAY_MOUSE_TARGET="overlayMouseTarget",Ct.contextType=c;var Et={onDblClick:"dblclick",onClick:"click"},Pt={opacity:function(t,e){t.setOpacity(e)}},kt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={groundOverlay:null},e.setGroundOverlayCallback=function(){null!==e.state.groundOverlay&&e.props.onLoad&&e.props.onLoad(e.state.groundOverlay)},e}a(e,t);var o=e.prototype;return o.componentDidMount=function(){this.props.url||this.props.bounds||n(!1);var t=new google.maps.GroundOverlay(this.props.url,this.props.bounds,i({},this.props.options,{map:this.context}));this.registeredEvents=d({updaterMap:Pt,eventMap:Et,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{groundOverlay:t}}),this.setGroundOverlayCallback)},o.componentDidUpdate=function(t){null!==this.state.groundOverlay&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Pt,eventMap:Et,prevProps:t,nextProps:this.props,instance:this.state.groundOverlay}))},o.componentWillUnmount=function(){this.state.groundOverlay&&(this.props.onUnmount&&this.props.onUnmount(this.state.groundOverlay),this.state.groundOverlay.setMap(null))},o.render=function(){return null},e}(e.PureComponent);kt.defaultProps={onLoad:function(){}},kt.contextType=c;var xt={},Lt={data:function(t,e){t.setData(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)}},wt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={heatmapLayer:null},e.setHeatmapLayerCallback=function(){null!==e.state.heatmapLayer&&e.props.onLoad&&e.props.onLoad(e.state.heatmapLayer)},e}a(e,t);var o=e.prototype;return o.componentDidMount=function(){google.maps.visualization||n(!1),this.props.data||n(!1);var t=new google.maps.visualization.HeatmapLayer(i({},this.props.options||{},{data:this.props.data,map:this.context}));this.registeredEvents=d({updaterMap:Lt,eventMap:xt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{heatmapLayer:t}}),this.setHeatmapLayerCallback)},o.componentDidUpdate=function(t){u(this.registeredEvents),this.registeredEvents=d({updaterMap:Lt,eventMap:xt,prevProps:t,nextProps:this.props,instance:this.state.heatmapLayer})},o.componentWillUnmount=function(){null!==this.state.heatmapLayer&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),u(this.registeredEvents),this.state.heatmapLayer.setMap(null))},o.render=function(){return null},e}(e.PureComponent);wt.contextType=c;var bt={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},St={register:function(t,e,n){t.registerPanoProvider(e,n)},links:function(t,e){t.setLinks(e)},motionTracking:function(t,e){t.setMotionTracking(e)},options:function(t,e){t.setOptions(e)},pano:function(t,e){t.setPano(e)},position:function(t,e){t.setPosition(e)},pov:function(t,e){t.setPov(e)},visible:function(t,e){t.setVisible(e)},zoom:function(t,e){t.setZoom(e)}},Dt=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={streetViewPanorama:null},e.setStreetViewPanoramaCallback=function(){null!==e.state.streetViewPanorama&&e.props.onLoad&&e.props.onLoad(e.state.streetViewPanorama)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=this.context.getStreetView();this.registeredEvents=d({updaterMap:St,eventMap:bt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{streetViewPanorama:t}}),this.setStreetViewPanoramaCallback)},n.componentDidUpdate=function(t){null!==this.state.streetViewPanorama&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:St,eventMap:bt,prevProps:t,nextProps:this.props,instance:this.state.streetViewPanorama}))},n.componentWillUnmount=function(){null!==this.state.streetViewPanorama&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),u(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))},n.render=function(){return null},e}(e.PureComponent);Dt.contextType=c;var Ut=function(t){function e(){var e;return(e=t.apply(this,arguments)||this).state={streetViewService:null},e.setStreetViewServiceCallback=function(){null!==e.state.streetViewService&&e.props.onLoad&&e.props.onLoad(e.state.streetViewService)},e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var t=new google.maps.StreetViewService;this.setState((function(){return{streetViewService:t}}),this.setStreetViewServiceCallback)},n.componentWillUnmount=function(){null!==this.state.streetViewService&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)},n.render=function(){return null},e}(e.PureComponent);Ut.contextType=c;var Ot=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).state={directionsService:null},e.setDirectionsServiceCallback=function(){null!==e.state.directionsService&&e.props.onLoad&&e.props.onLoad(e.state.directionsService)},e}a(o,t);var r=o.prototype;return r.componentDidMount=function(){this.props.options||n(!1);var t=new google.maps.DirectionsService;this.setState((function(){return{directionsService:t}}),this.setDirectionsServiceCallback)},r.componentDidUpdate=function(){null!==this.state.directionsService&&this.state.directionsService.route(this.props.options,this.props.callback)},r.componentWillUnmount=function(){null!==this.state.directionsService&&this.props.onUnmount&&this.props.onUnmount(this.state.directionsService)},r.render=function(){return e.createElement(e.Fragment,null)},o}(e.PureComponent),Rt={onDirectionsChanged:"directions_changed"},Tt={directions:function(t,e){t.setDirections(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},panel:function(t,e){t.setPanel(e)},routeIndex:function(t,e){t.setRouteIndex(e)}},Vt=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).registeredEvents=[],e.state={directionsRenderer:null},e.setDirectionsRendererCallback=function(){null!==e.state.directionsRenderer&&(e.state.directionsRenderer.setMap(e.context),e.props.onLoad&&e.props.onLoad(e.state.directionsRenderer))},e}a(n,t);var o=n.prototype;return o.componentDidMount=function(){var t=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=d({updaterMap:Tt,eventMap:Rt,prevProps:{},nextProps:this.props,instance:t}),this.setState((function(){return{directionsRenderer:t}}),this.setDirectionsRendererCallback)},o.componentDidUpdate=function(t){null!==this.state.directionsRenderer&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Tt,eventMap:Rt,prevProps:t,nextProps:this.props,instance:this.state.directionsRenderer}))},o.componentWillUnmount=function(){null!==this.state.directionsRenderer&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),u(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))},o.render=function(){return e.createElement(e.Fragment,null)},n}(e.PureComponent);Vt.contextType=c;var It=function(t){function o(){var e;return(e=t.apply(this,arguments)||this).state={distanceMatrixService:null},e.setDistanceMatrixServiceCallback=function(){null!==e.state.distanceMatrixService&&e.props.onLoad&&e.props.onLoad(e.state.distanceMatrixService)},e}a(o,t);var r=o.prototype;return r.componentDidMount=function(){this.props.options||n(!1);var t=new google.maps.DistanceMatrixService;this.setState((function(){return{distanceMatrixService:t}}),this.setDistanceMatrixServiceCallback)},r.componentDidUpdate=function(){null!==this.state.distanceMatrixService&&this.state.distanceMatrixService.getDistanceMatrix(this.props.options,this.props.callback)},r.componentWillUnmount=function(){null!==this.state.distanceMatrixService&&this.props.onUnmount&&this.props.onUnmount(this.state.distanceMatrixService)},r.render=function(){return e.createElement(e.Fragment,null)},o}(e.PureComponent),_t={onPlacesChanged:"places_changed"},Bt={bounds:function(t,e){t.setBounds(e)}},Wt=function(t){function o(){var n;return(n=t.apply(this,arguments)||this).registeredEvents=[],n.containerElement=e.createRef(),n.state={searchBox:null},n.setSearchBoxCallback=function(){null!==n.state.searchBox&&n.props.onLoad&&n.props.onLoad(n.state.searchBox)},n}a(o,t);var r=o.prototype;return r.componentDidMount=function(){if(google.maps.places||n(!1),null!==this.containerElement&&null!==this.containerElement.current){var t=this.containerElement.current.querySelector("input");if(null!==t){var e=new google.maps.places.SearchBox(t,this.props.options);this.registeredEvents=d({updaterMap:Bt,eventMap:_t,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{searchBox:e}}),this.setSearchBoxCallback)}}},r.componentDidUpdate=function(t){null!==this.state.searchBox&&(u(this.registeredEvents),this.registeredEvents=d({updaterMap:Bt,eventMap:_t,prevProps:t,nextProps:this.props,instance:this.state.searchBox}))},r.componentWillUnmount=function(){null!==this.state.searchBox&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),u(this.registeredEvents))},r.render=function(){return e.createElement("div",{ref:this.containerElement},e.Children.only(this.props.children))},o}(e.PureComponent);Wt.contextType=c;var At={onPlaceChanged:"place_changed"},jt={bounds:function(t,e){t.setBounds(e)},restrictions:function(t,e){t.setComponentRestrictions(e)},fields:function(t,e){t.setFields(e)},options:function(t,e){t.setOptions(e)},types:function(t,e){t.setTypes(e)}},Nt=function(t){function o(){var n;return(n=t.apply(this,arguments)||this).registeredEvents=[],n.containerElement=e.createRef(),n.state={autocomplete:null},n.setAutocompleteCallback=function(){null!==n.state.autocomplete&&n.props.onLoad&&n.props.onLoad(n.state.autocomplete)},n}a(o,t);var r=o.prototype;return r.componentDidMount=function(){google.maps.places||n(!1);var t=this.containerElement.current.querySelector("input");if(t){var e=new google.maps.places.Autocomplete(t,this.props.options);this.registeredEvents=d({updaterMap:jt,eventMap:At,prevProps:{},nextProps:this.props,instance:e}),this.setState((function(){return{autocomplete:e}}),this.setAutocompleteCallback)}},r.componentDidUpdate=function(t){u(this.registeredEvents),this.registeredEvents=d({updaterMap:jt,eventMap:At,prevProps:t,nextProps:this.props,instance:this.state.autocomplete})},r.componentWillUnmount=function(){null!==this.state.autocomplete&&u(this.registeredEvents)},r.render=function(){return e.createElement("div",{ref:this.containerElement},e.Children.only(this.props.children))},o}(e.PureComponent);Nt.contextType=c,t.Autocomplete=Nt,t.BicyclingLayer=T,t.Circle=at,t.Data=lt,t.DirectionsRenderer=Vt,t.DirectionsService=Ot,t.DistanceMatrixService=It,t.DrawingManager=B,t.GoogleMap=f,t.GroundOverlay=kt,t.HeatmapLayer=wt,t.InfoBox=H,t.InfoWindow=Y,t.KmlLayer=ht,t.LoadScript=L,t.LoadScriptNext=D,t.MapContext=c,t.Marker=j,t.MarkerClusterer=F,t.OverlayView=Ct,t.Polygon=et,t.Polyline=X,t.Rectangle=rt,t.StandaloneSearchBox=Wt,t.StreetViewPanorama=Dt,t.StreetViewService=Ut,t.TrafficLayer=R,t.TransitLayer=V,t.useGoogleMap=function(){e.useContext||n(!1);var t=e.useContext(c);return t||n(!1),t},t.useLoadScript=w})); | ||
//# sourceMappingURL=reactgooglemapsapi.umd.production.min.js.map |
{ | ||
"name": "@react-google-maps/api", | ||
"sideEffects": false, | ||
"version": "1.9.4", | ||
"version": "1.9.5", | ||
"description": "React.js Google Maps API integration", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -35,2 +35,50 @@ # @react-google-maps/api | ||
```jsx | ||
import React from 'react' | ||
import { GoogleMap, LoadScript } from '@react-google-maps/api'; | ||
const containerStyle = { | ||
width: '400px', | ||
height: '400px' | ||
}; | ||
const center = { | ||
lat: -3.745, | ||
lng: -38.523 | ||
}; | ||
function MyComponent() { | ||
const [map, setMap] = React.useState(null) | ||
const onLoad = React.useCallback(function callback(map) { | ||
const bounds = new window.google.maps.LatLngBounds(); | ||
map.fitBounds(bounds); | ||
setMap(map) | ||
}, []) | ||
const onUnmount = React.useCallback(function callback(map) { | ||
setMap(null) | ||
}, []) | ||
return ( | ||
<LoadScript | ||
googleMapsApiKey="YOUR_API_KEY" | ||
> | ||
<GoogleMap | ||
mapContainerStyle={containerStyle} | ||
center={center} | ||
zoom={10} | ||
onLoad={onLoad} | ||
onUnmount={onUnmount} | ||
> | ||
{ /* Child components, such as markers, info windows, etc. */ } | ||
<></> | ||
</GoogleMap> | ||
</LoadScript> | ||
) | ||
} | ||
export default React.memo(MyComponent) | ||
``` | ||
## Migration from react-google-maps@9.4.5 | ||
@@ -43,3 +91,3 @@ | ||
```jsx | ||
// before | ||
// before - don't do that! | ||
<GoogleMap | ||
@@ -68,2 +116,4 @@ ref={map => { | ||
If you want to use `window.google` object, you need to extract GoogleMap in separate module, so it is lazy executed then `google-maps-api` script is loaded and executed by `<LoadScript />`. If you try to use `window.google` before it is loaded it will be undefined and you'll get a TypeError. | ||
## Main features | ||
@@ -70,0 +120,0 @@ |
@@ -58,6 +58,15 @@ # Install @react-google-maps/api | ||
import React from 'react' | ||
import { GoogleMap, LoadScript } from '@react-google-maps/api'; | ||
function MyComponent(props) { | ||
const { containerStyle, center } = props; | ||
const containerStyle = { | ||
width: '400px', | ||
height: '400px' | ||
}; | ||
const center = { | ||
lat: -3.745, | ||
lng: -38.523 | ||
}; | ||
function MyComponent() { | ||
return ( | ||
@@ -73,2 +82,3 @@ <LoadScript | ||
{ /* Child components, such as markers, info windows, etc. */ } | ||
<></> | ||
</GoogleMap> | ||
@@ -75,0 +85,0 @@ </LoadScript> |
Sorry, the diff of this file is too big to display
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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1776506
14602
166