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

google-maps-js-api-react

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-maps-js-api-react - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

3

dist/hooks/useAutocompleteService.d.ts
/// <reference types="google.maps" />
/**
* @param startLoading - if `true`, starts loading if {@link google.maps} not loaded yet, overwise just waited for loading if it not done yet
* @throws error if `places` not included to libraries in loader {@link Loader.options options}
*/
declare const useAutocompleteService: () => google.maps.places.AutocompleteService | undefined;
declare const useAutocompleteService: (startLoading?: boolean | undefined) => google.maps.places.AutocompleteService | undefined;
export default useAutocompleteService;
/// <reference types="google.maps" />
/**
* @param startLoading - if `true`, starts loading if {@link google.maps} not loaded yet, overwise just waited for loading if it not done yet
* @throws error if `places` not included to libraries in loader {@link Loader.options options}
*/
declare const usePlacesService: (container?: null | (() => HTMLDivElement) | HTMLDivElement | google.maps.Map) => google.maps.places.PlacesService | undefined;
declare const usePlacesService: (startLoading?: boolean | undefined, container?: null | (() => HTMLDivElement) | HTMLDivElement | google.maps.Map) => google.maps.places.PlacesService | undefined;
export default usePlacesService;

@@ -9,1 +9,2 @@ export { default as createGoogleMapComponent, GoogleMapsBaseProps, GoogleMapsHandlers, } from './createComponents/createGoogleMap';

export { default as useAutocompleteService } from './hooks/useAutocompleteService';
export { default as usePlacesService } from './hooks/usePlacesService';

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

var e=require("react"),n=require("fast-deep-equal"),t=require("google-maps-js-api-loader"),o=require("react-dom"),r=require("marker-cluster");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=/*#__PURE__*/a(e),i=/*#__PURE__*/a(n),l=/*#__PURE__*/a(t),c=/*#__PURE__*/a(r);function s(){return s=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},s.apply(this,arguments)}function d(e,n){return d=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e},d(e,n)}function f(e,n){if(null==e)return{};var t,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n.indexOf(t=a[o])>=0||(r[t]=e[t]);return r}var g,C=e.createContext(null),E=function(){return e.useContext(C)};!function(e){e.CLICK="click",e.CONTEXT_MENU="contextmenu",e.DOUBLE_CLICK="dblclick",e.DRAG="drag",e.DRAG_END="dragend",e.DRAG_START="dragstart",e.MOUSE_MOVE="mousemove",e.MOUSE_OUT="mouseout",e.MOUSE_OVER="mouseover",e.RIGHT_CLICK="rightclick",e.BOUNDS_CHANGED="bounds_changed",e.CENTER_CHANGED="center_changed",e.HEADING_CHANGED="heading_changed",e.IDLE="idle",e.MAP_TYPE_ID_CHANGED="maptypeid_changed",e.PROJECTION_CHANGED="projection_changed",e.RESIZE="resize",e.TILES_LOADED="tilesloaded",e.TILT_CHANGED="tilt_changed",e.ZOOM_CHANGED="zoom_changed",e.ANIMATION_CHANGED="animation_changed",e.CLICKABLE_CHANGED="clickable_changed",e.CURSOR_CHANGED="cursor_changed",e.DRAGGABLE_CHANGED="draggable_changed",e.FLAT_CHANGED="flat_changed",e.ICON_CHANGED="icon_changed",e.MOUSE_DOWN="mousedown",e.MOUSE_UP="mouseup",e.POSITION_CHANGED="position_changed",e.SHAPE_CHANGED="shape_changed",e.TITLE_CHANGED="title_changed",e.VISIBLE_CHANGED="visible_changed",e.Z_INDEX_CHANGED="zindex_changed"}(g||(g={}));var p=Object.freeze({onClick:g.CLICK,onDoubleClick:g.DOUBLE_CLICK,onDrag:g.DRAG,onDragEnd:g.DRAG_END,onDragStart:g.DRAG_START,onContextMenu:g.CONTEXT_MENU,onMouseMove:g.MOUSE_MOVE,onMouseOut:g.MOUSE_OUT,onMouseOver:g.MOUSE_OVER,onRightClick:g.RIGHT_CLICK,onBoundsChanged:g.BOUNDS_CHANGED,onCenterChanged:g.CENTER_CHANGED,onHeadingChanged:g.HEADING_CHANGED,onIdle:g.IDLE,onMapTypeIdChanged:g.MAP_TYPE_ID_CHANGED,onProjectionChanged:g.PROJECTION_CHANGED,onResize:g.RESIZE,onTilesLoaded:g.TILES_LOADED,onTiltChanged:g.TILT_CHANGED,onZoomChanged:g.ZOOM_CHANGED,onAnimationChanged:g.ANIMATION_CHANGED,onClickableChanged:g.CLICKABLE_CHANGED,onCursorChanged:g.CURSOR_CHANGED,onDraggableChanged:g.DRAGGABLE_CHANGED,onFlatChanged:g.FLAT_CHANGED,onIconChanged:g.ICON_CHANGED,onMouseDown:g.MOUSE_DOWN,onMouseUp:g.MOUSE_UP,onPositionChanged:g.POSITION_CHANGED,onShapeChanged:g.SHAPE_CHANGED,onTitleChanged:g.TITLE_CHANGED,onVisibleChanged:g.VISIBLE_CHANGED,onZIndexChanged:g.Z_INDEX_CHANGED}),v=function(){};function h(n,t){return void 0===t&&(t={}),function(o,r){return n(function(n,t,o){if(0===t.length&&0===n.length)return v;n=Array.from(new Set(n)).reverse();var r=(t=Array.from(new Set(t)).reverse()).length,a=function(n,o){var a=e.useRef([]);e.useEffect(function(){var e=n.current;if(e){var u=a.current;if(u.length)for(var l=r;l--;){var c=t[l],s=o[c];i.default(s,u[l])||(e.set(c,s),u[l]=s)}else for(var d=r;d--;)u[d]=o[t[d]]}})};if(0===n.length)return a;var u=function(t,r){for(var a=function(a){var u=n[a],i=r[u];e.useEffect(function(){var e=t.current;if(e&&i){var n=o[u],r=e.addListener(p[u],n?function(){i.apply(void 0,[this.get(n)].concat([].slice.call(arguments),[this]))}:function(){i.apply(void 0,[].slice.call(arguments).concat([this]))});return function(){return r.remove()}}},[i])},u=n.length;u--;)a(u)};if(0===r)return u;for(var l=[],c=n.length;c--;){var s=n[c],d=o[s];d&&t.includes(d)&&(l.push(s),n.splice(c,1))}var f=l.length;return 0===f?function(e,n){u(e,n),a(e,n)}:(0===n.length&&(u=v),function(n,a){var c=e.useRef({isTriggeredBySetStateMap:new Map,prevStateArr:[]});u(n,a);for(var s=c.current.isTriggeredBySetStateMap,d=function(t){var r=l[t],u=a[r];e.useEffect(function(){var e=n.current;if(e&&u){var t=o[r],a=e.addListener(p[r],function(){s.has(t)?s.delete(t):u.apply(void 0,[this.get(t)].concat([].slice.call(arguments),[this]))});return function(){return a.remove()}}},[u])},g=f;g--;)d(g);e.useEffect(function(){var e=n.current;if(e){var o=c.current.prevStateArr;if(o.length)for(var u=r;u--;){var l=t[u],d=a[l];i.default(d,o[u])||(s.set(l,!0),e.set(l,d),o[u]=d)}else for(var f=r;f--;)o[f]=a[t[f]]}})})}(o,r,t))}}var _,D=["children","className","style","defaultOptions","onMount","onUnmount"],A=h(function(n){return function(t){var o=t.children,r=t.className,a=t.style,i=t.defaultOptions,l=t.onMount,c=t.onUnmount,d=f(t,D),g=e.useRef(null),E=e.useRef(),p=e.useState(),h=p[0],_=p[1];return e.useEffect(function(){var e=g.current;if(e){var n=new google.maps.Map(e,s({},i,d));E.current=n,google.maps.event.addListenerOnce(n,"idle",function(){_(n),(l||v)(n)})}return c},[]),n(E,d),u.default.createElement("div",{ref:g,className:r,style:a},o&&h&&u.default.createElement(C.Provider,{value:h},"function"==typeof o?o(h):o))}},{onCenterChanged:"center",onHeadingChanged:"heading",onMapTypeIdChanged:"mapTypeId",onTiltChanged:"tilt",onZoomChanged:"zoom",onBoundsChanged:"bounds"}),N=["defaultOptions","onMount","onUnmount"],O=h(function(n){return function(t){var o=t.defaultOptions,r=t.onMount,a=t.onUnmount,u=f(t,N),i=E(),l=e.useRef();return e.useEffect(function(){var e=new google.maps.Marker(s({map:i},o,u));return l.current=e,(r||v)(e),function(){e.setMap(null),(a||v)()}},[]),n(l,u),null}},{onAnimationChanged:"animation",onCursorChanged:"cursor",onDraggableChanged:"draggable",onIconChanged:"icon",onPositionChanged:"position",onShapeChanged:"shape",onTitleChanged:"title",onVisibleChanged:"visible",onZIndexChanged:"zIndex"}),m=function(n){void 0===n&&(n={});var o=e.useState(l.default.status),r=o[0],a=o[1];return e.useEffect(function(){r!==t.LoaderStatus.LOADED&&l.default.load().then(function(){a(t.LoaderStatus.LOADED),(n.onLoaded||v)()},function(e){a(t.LoaderStatus.ERROR),(n.onError||v)(e)})},[]),r},L=["children"],G=e.createContext(l.default.status),I=["lat","lng","onAdd","onDraw","onRemove","component","mapPaneLayer"];l.default.completion.then(function(){_=/*#__PURE__*/function(e){var n,t;function o(n,t,o){var r;return(r=e.call(this)||this)._style=void 0,r._latLng=void 0,r._onDraw=void 0,r._style=n,r._latLng=new google.maps.LatLng(t[0],t[1]),r.setCallbacks(o),r}t=e,(n=o).prototype=Object.create(t.prototype),n.prototype.constructor=n,d(n,t);var r=o.prototype;return r.setCallbacks=function(e){this.onAdd=e[0]||v,this._onDraw=e[1]||v,this.onRemove=e[2]||v},r.setCoords=function(e){this._latLng=new google.maps.LatLng(e[0],e[1]),this.draw()},r.draw=function(){var e=this.getProjection().fromLatLngToDivPixel(this._latLng);if(e){var n=e.x,t=e.y,o=this._style;o.left=n+"px",o.top=t+"px",this._onDraw(n,t)}},o}(google.maps.OverlayView)});var M=e.forwardRef(function(n,t){var r=n.lat,a=n.lng,i=n.onAdd,l=n.onDraw,c=n.onRemove,d=n.component,g=void 0===d?"div":d,C=n.mapPaneLayer,p=void 0===C?"overlayMouseTarget":C,v=f(n,I),h=E(),D=e.useRef({}),A=[r,a],N=[i,l,c],O=e.useCallback(function(e){var n=D.current;if(e){if(n.el!==e){var o;null==(o=n.overlay)||o.setMap(null),n.el=e;var r=e.style;r.position="absolute";var a=new _(r,A,N);n.overlay=a,a.setMap(h)}}else n.overlay&&(n.overlay.setMap(null),delete n.el,delete n.overlay);!function(e,n){e&&("object"==typeof e?e.current=n:e(n))}(t,e)},[t]);return e.useEffect(function(){var e=D.current,n=e.overlay;e.isNotFirstRender&&n&&n.setCallbacks(N)},N),e.useEffect(function(){var e,n=D.current;n.isNotFirstRender?null==(e=n.overlay)||e.setCoords(A):n.isNotFirstRender=!0},A),o.createPortal(u.default.createElement(g,s({ref:O},v)),h.__gm.panes[p])}),S=function(){var e;if(null!=(e=l.default.options.libraries)&&e.includes("places"))return new google.maps.places.AutocompleteService;throw Error("Places library not loaded")};Object.defineProperty(exports,"Loader",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"LoaderStatus",{enumerable:!0,get:function(){return t.LoaderStatus}}),exports.GoogleMapLoader=function(e){var n=e.children,t=f(e,L),o=m(t);return n?u.default.createElement(G.Provider,{value:o},n):null},exports.OverlayView=M,exports.createGoogleMapComponent=A,exports.createMarkerComponent=O,exports.useAutocompleteService=function(){var n=e.useState(function(){return l.default.status===t.LoaderStatus.LOADED?S():void 0}),o=n[0],r=n[1];return e.useEffect(function(){o||l.default.completion.then(function(){return r(S())})},[]),o},exports.useGoogleMap=E,exports.useGoogleMapLoader=m,exports.useGoogleMapStatus=function(){return e.useContext(G)},exports.useMarkerCluster=function(n,t,o){var r,a,u=(r=function(){return new c.default(t,o)},(a=e.useRef()).current||(a.current=r())),i=e.useState([]),l=i[0][0],s=i[1],d=e.useRef();return e.useEffect(function(){return function(){return u.cleanUp()}},[]),e.useEffect(function(){var e=function(){var e=d.current;e&&s([function(){return u.getPoints.apply(u,e.concat([].slice.call(arguments)))}])};if(null!=o&&o.asyncMode)return u.loadAsync(n).then(e),function(){var e;n!==u.points&&(null==(e=u.worker)||e.terminate(),u.worker=void 0)};u.load(n),e()},[n]),{handleBoundsChange:function(e,n){var t=e.getSouthWest(),o=e.getNorthEast(),r=[n.getZoom(),t.lng(),t.lat(),o.lng(),o.lat()];d.current=r,u.points&&s([function(){return u.getPoints.apply(u,r.concat([].slice.call(arguments)))}])},getPoints:l,markerCluster:u}};
var e=require("react"),n=require("fast-deep-equal"),t=require("google-maps-js-api-loader"),o=require("react-dom"),r=require("marker-cluster");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=/*#__PURE__*/a(e),i=/*#__PURE__*/a(n),l=/*#__PURE__*/a(t),c=/*#__PURE__*/a(r);function s(){return s=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},s.apply(this,arguments)}function d(e,n){return d=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e},d(e,n)}function f(e,n){if(null==e)return{};var t,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n.indexOf(t=a[o])>=0||(r[t]=e[t]);return r}var g,p=e.createContext(null),C=function(){return e.useContext(p)};!function(e){e.CLICK="click",e.CONTEXT_MENU="contextmenu",e.DOUBLE_CLICK="dblclick",e.DRAG="drag",e.DRAG_END="dragend",e.DRAG_START="dragstart",e.MOUSE_MOVE="mousemove",e.MOUSE_OUT="mouseout",e.MOUSE_OVER="mouseover",e.RIGHT_CLICK="rightclick",e.BOUNDS_CHANGED="bounds_changed",e.CENTER_CHANGED="center_changed",e.HEADING_CHANGED="heading_changed",e.IDLE="idle",e.MAP_TYPE_ID_CHANGED="maptypeid_changed",e.PROJECTION_CHANGED="projection_changed",e.RESIZE="resize",e.TILES_LOADED="tilesloaded",e.TILT_CHANGED="tilt_changed",e.ZOOM_CHANGED="zoom_changed",e.ANIMATION_CHANGED="animation_changed",e.CLICKABLE_CHANGED="clickable_changed",e.CURSOR_CHANGED="cursor_changed",e.DRAGGABLE_CHANGED="draggable_changed",e.FLAT_CHANGED="flat_changed",e.ICON_CHANGED="icon_changed",e.MOUSE_DOWN="mousedown",e.MOUSE_UP="mouseup",e.POSITION_CHANGED="position_changed",e.SHAPE_CHANGED="shape_changed",e.TITLE_CHANGED="title_changed",e.VISIBLE_CHANGED="visible_changed",e.Z_INDEX_CHANGED="zindex_changed"}(g||(g={}));var E=Object.freeze({onClick:g.CLICK,onDoubleClick:g.DOUBLE_CLICK,onDrag:g.DRAG,onDragEnd:g.DRAG_END,onDragStart:g.DRAG_START,onContextMenu:g.CONTEXT_MENU,onMouseMove:g.MOUSE_MOVE,onMouseOut:g.MOUSE_OUT,onMouseOver:g.MOUSE_OVER,onRightClick:g.RIGHT_CLICK,onBoundsChanged:g.BOUNDS_CHANGED,onCenterChanged:g.CENTER_CHANGED,onHeadingChanged:g.HEADING_CHANGED,onIdle:g.IDLE,onMapTypeIdChanged:g.MAP_TYPE_ID_CHANGED,onProjectionChanged:g.PROJECTION_CHANGED,onResize:g.RESIZE,onTilesLoaded:g.TILES_LOADED,onTiltChanged:g.TILT_CHANGED,onZoomChanged:g.ZOOM_CHANGED,onAnimationChanged:g.ANIMATION_CHANGED,onClickableChanged:g.CLICKABLE_CHANGED,onCursorChanged:g.CURSOR_CHANGED,onDraggableChanged:g.DRAGGABLE_CHANGED,onFlatChanged:g.FLAT_CHANGED,onIconChanged:g.ICON_CHANGED,onMouseDown:g.MOUSE_DOWN,onMouseUp:g.MOUSE_UP,onPositionChanged:g.POSITION_CHANGED,onShapeChanged:g.SHAPE_CHANGED,onTitleChanged:g.TITLE_CHANGED,onVisibleChanged:g.VISIBLE_CHANGED,onZIndexChanged:g.Z_INDEX_CHANGED}),v=function(){};function h(n,t){return void 0===t&&(t={}),function(o,r){return n(function(n,t,o){if(0===t.length&&0===n.length)return v;n=Array.from(new Set(n)).reverse();var r=(t=Array.from(new Set(t)).reverse()).length,a=function(n,o){var a=e.useRef([]);e.useEffect(function(){var e=n.current;if(e){var u=a.current;if(u.length)for(var l=r;l--;){var c=t[l],s=o[c];i.default(s,u[l])||(e.set(c,s),u[l]=s)}else for(var d=r;d--;)u[d]=o[t[d]]}})};if(0===n.length)return a;var u=function(t,r){for(var a=function(a){var u=n[a],i=r[u];e.useEffect(function(){var e=t.current;if(e&&i){var n=o[u],r=e.addListener(E[u],n?function(){i.apply(void 0,[this.get(n)].concat([].slice.call(arguments),[this]))}:function(){i.apply(void 0,[].slice.call(arguments).concat([this]))});return function(){return r.remove()}}},[i])},u=n.length;u--;)a(u)};if(0===r)return u;for(var l=[],c=n.length;c--;){var s=n[c],d=o[s];d&&t.includes(d)&&(l.push(s),n.splice(c,1))}var f=l.length;return 0===f?function(e,n){u(e,n),a(e,n)}:(0===n.length&&(u=v),function(n,a){var c=e.useRef({isTriggeredBySetStateMap:new Map,prevStateArr:[]});u(n,a);for(var s=c.current.isTriggeredBySetStateMap,d=function(t){var r=l[t],u=a[r];e.useEffect(function(){var e=n.current;if(e&&u){var t=o[r],a=e.addListener(E[r],function(){s.has(t)?s.delete(t):u.apply(void 0,[this.get(t)].concat([].slice.call(arguments),[this]))});return function(){return a.remove()}}},[u])},g=f;g--;)d(g);e.useEffect(function(){var e=n.current;if(e){var o=c.current.prevStateArr;if(o.length)for(var u=r;u--;){var l=t[u],d=a[l];i.default(d,o[u])||(s.set(l,!0),e.set(l,d),o[u]=d)}else for(var f=r;f--;)o[f]=a[t[f]]}})})}(o,r,t))}}var _,D=["children","className","style","defaultOptions","onMount","onUnmount"],A=h(function(n){return function(t){var o=t.children,r=t.className,a=t.style,i=t.defaultOptions,l=t.onMount,c=t.onUnmount,d=f(t,D),g=e.useRef(null),C=e.useRef(),E=e.useState(),h=E[0],_=E[1];return e.useEffect(function(){var e=g.current;if(e){var n=new google.maps.Map(e,s({},i,d));C.current=n,google.maps.event.addListenerOnce(n,"idle",function(){_(n),(l||v)(n)})}return c},[]),n(C,d),u.default.createElement("div",{ref:g,className:r,style:a},o&&h&&u.default.createElement(p.Provider,{value:h},"function"==typeof o?o(h):o))}},{onCenterChanged:"center",onHeadingChanged:"heading",onMapTypeIdChanged:"mapTypeId",onTiltChanged:"tilt",onZoomChanged:"zoom",onBoundsChanged:"bounds"}),N=["defaultOptions","onMount","onUnmount"],O=h(function(n){return function(t){var o=t.defaultOptions,r=t.onMount,a=t.onUnmount,u=f(t,N),i=C(),l=e.useRef();return e.useEffect(function(){var e=new google.maps.Marker(s({map:i},o,u));return l.current=e,(r||v)(e),function(){e.setMap(null),(a||v)()}},[]),n(l,u),null}},{onAnimationChanged:"animation",onCursorChanged:"cursor",onDraggableChanged:"draggable",onIconChanged:"icon",onPositionChanged:"position",onShapeChanged:"shape",onTitleChanged:"title",onVisibleChanged:"visible",onZIndexChanged:"zIndex"}),m=function(n){void 0===n&&(n={});var o=e.useState(l.default.status),r=o[0],a=o[1];return e.useEffect(function(){r!==t.LoaderStatus.LOADED&&l.default.load().then(function(){a(t.LoaderStatus.LOADED),(n.onLoaded||v)()},function(e){a(t.LoaderStatus.ERROR),(n.onError||v)(e)})},[]),r},L=["children"],G=e.createContext(l.default.status),S=["lat","lng","onAdd","onDraw","onRemove","component","mapPaneLayer"];l.default.completion.then(function(){_=/*#__PURE__*/function(e){var n,t;function o(n,t,o){var r;return(r=e.call(this)||this)._style=void 0,r._latLng=void 0,r._onDraw=void 0,r._style=n,r._latLng=new google.maps.LatLng(t[0],t[1]),r.setCallbacks(o),r}t=e,(n=o).prototype=Object.create(t.prototype),n.prototype.constructor=n,d(n,t);var r=o.prototype;return r.setCallbacks=function(e){this.onAdd=e[0]||v,this._onDraw=e[1]||v,this.onRemove=e[2]||v},r.setCoords=function(e){this._latLng=new google.maps.LatLng(e[0],e[1]),this.draw()},r.draw=function(){var e=this.getProjection().fromLatLngToDivPixel(this._latLng);if(e){var n=e.x,t=e.y,o=this._style;o.left=n+"px",o.top=t+"px",this._onDraw(n,t)}},o}(google.maps.OverlayView)});var y=e.forwardRef(function(n,t){var r=n.lat,a=n.lng,i=n.onAdd,l=n.onDraw,c=n.onRemove,d=n.component,g=void 0===d?"div":d,p=n.mapPaneLayer,E=void 0===p?"overlayMouseTarget":p,v=f(n,S),h=C(),D=e.useRef({}),A=[r,a],N=[i,l,c],O=e.useCallback(function(e){var n=D.current;if(e){if(n.el!==e){var o;null==(o=n.overlay)||o.setMap(null),n.el=e;var r=e.style;r.position="absolute";var a=new _(r,A,N);n.overlay=a,a.setMap(h)}}else n.overlay&&(n.overlay.setMap(null),delete n.el,delete n.overlay);!function(e,n){e&&("object"==typeof e?e.current=n:e(n))}(t,e)},[t]);return e.useEffect(function(){var e=D.current,n=e.overlay;e.isNotFirstRender&&n&&n.setCallbacks(N)},N),e.useEffect(function(){var e,n=D.current;n.isNotFirstRender?null==(e=n.overlay)||e.setCoords(A):n.isNotFirstRender=!0},A),o.createPortal(u.default.createElement(g,s({ref:O},v)),h.__gm.panes[E])}),I=function(){var e;if(null!=(e=l.default.options.libraries)&&e.includes("places"))return new google.maps.places.AutocompleteService;throw Error("Places library not loaded")},M=function(e){var n;if(void 0===e&&(e=null),null!=(n=l.default.options.libraries)&&n.includes("places"))return new google.maps.places.PlacesService(e);throw Error("Places library not loaded")};Object.defineProperty(exports,"Loader",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"LoaderStatus",{enumerable:!0,get:function(){return t.LoaderStatus}}),exports.GoogleMapLoader=function(e){var n=e.children,t=f(e,L),o=m(t);return n?u.default.createElement(G.Provider,{value:o},n):null},exports.OverlayView=y,exports.createGoogleMapComponent=A,exports.createMarkerComponent=O,exports.useAutocompleteService=function(n){var o=e.useState(function(){return l.default.status===t.LoaderStatus.LOADED?I():void 0}),r=o[0],a=o[1];return e.useEffect(function(){r||(n?l.default.load():l.default.completion).then(function(){return a(I())})},[]),r},exports.useGoogleMap=C,exports.useGoogleMapLoader=m,exports.useGoogleMapStatus=function(){return e.useContext(G)},exports.useMarkerCluster=function(n,t,o){var r,a,u=(r=function(){return new c.default(t,o)},(a=e.useRef()).current||(a.current=r())),i=e.useState([]),l=i[0][0],s=i[1],d=e.useRef();return e.useEffect(function(){return function(){return u.cleanUp()}},[]),e.useEffect(function(){var e=function(){var e=d.current;e&&s([function(){return u.getPoints.apply(u,e.concat([].slice.call(arguments)))}])};if(null!=o&&o.asyncMode)return u.loadAsync(n).then(e),function(){var e;n!==u.points&&(null==(e=u.worker)||e.terminate(),u.worker=void 0)};u.load(n),e()},[n]),{handleBoundsChange:function(e,n){var t=e.getSouthWest(),o=e.getNorthEast(),r=[n.getZoom(),t.lng(),t.lat(),o.lng(),o.lat()];d.current=r,u.points&&s([function(){return u.getPoints.apply(u,r.concat([].slice.call(arguments)))}])},getPoints:l,markerCluster:u}},exports.usePlacesService=function(n,o){void 0===o&&(o=null);var r=e.useState(function(){return"function"!=typeof o&&l.default.status===t.LoaderStatus.LOADED?M(o):void 0}),a=r[0],u=r[1];return e.useEffect(function(){a||(n?l.default.load():l.default.completion).then(function(){return u(M("function"!=typeof o?o:o()))})},[]),a};
//# sourceMappingURL=index.js.map

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

import n,{createContext as e,useContext as t,useRef as o,useEffect as r,useState as a,forwardRef as i,useCallback as l}from"react";import u from"fast-deep-equal";import c,{LoaderStatus as s}from"google-maps-js-api-loader";export{default as Loader,LoaderStatus}from"google-maps-js-api-loader";import{createPortal as d}from"react-dom";import g from"marker-cluster";function f(){return f=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},f.apply(this,arguments)}function C(n,e){return C=Object.setPrototypeOf||function(n,e){return n.__proto__=e,n},C(n,e)}function h(n,e){if(null==n)return{};var t,o,r={},a=Object.keys(n);for(o=0;o<a.length;o++)e.indexOf(t=a[o])>=0||(r[t]=n[t]);return r}var v,E=e(null),p=function(){return t(E)};!function(n){n.CLICK="click",n.CONTEXT_MENU="contextmenu",n.DOUBLE_CLICK="dblclick",n.DRAG="drag",n.DRAG_END="dragend",n.DRAG_START="dragstart",n.MOUSE_MOVE="mousemove",n.MOUSE_OUT="mouseout",n.MOUSE_OVER="mouseover",n.RIGHT_CLICK="rightclick",n.BOUNDS_CHANGED="bounds_changed",n.CENTER_CHANGED="center_changed",n.HEADING_CHANGED="heading_changed",n.IDLE="idle",n.MAP_TYPE_ID_CHANGED="maptypeid_changed",n.PROJECTION_CHANGED="projection_changed",n.RESIZE="resize",n.TILES_LOADED="tilesloaded",n.TILT_CHANGED="tilt_changed",n.ZOOM_CHANGED="zoom_changed",n.ANIMATION_CHANGED="animation_changed",n.CLICKABLE_CHANGED="clickable_changed",n.CURSOR_CHANGED="cursor_changed",n.DRAGGABLE_CHANGED="draggable_changed",n.FLAT_CHANGED="flat_changed",n.ICON_CHANGED="icon_changed",n.MOUSE_DOWN="mousedown",n.MOUSE_UP="mouseup",n.POSITION_CHANGED="position_changed",n.SHAPE_CHANGED="shape_changed",n.TITLE_CHANGED="title_changed",n.VISIBLE_CHANGED="visible_changed",n.Z_INDEX_CHANGED="zindex_changed"}(v||(v={}));var _=Object.freeze({onClick:v.CLICK,onDoubleClick:v.DOUBLE_CLICK,onDrag:v.DRAG,onDragEnd:v.DRAG_END,onDragStart:v.DRAG_START,onContextMenu:v.CONTEXT_MENU,onMouseMove:v.MOUSE_MOVE,onMouseOut:v.MOUSE_OUT,onMouseOver:v.MOUSE_OVER,onRightClick:v.RIGHT_CLICK,onBoundsChanged:v.BOUNDS_CHANGED,onCenterChanged:v.CENTER_CHANGED,onHeadingChanged:v.HEADING_CHANGED,onIdle:v.IDLE,onMapTypeIdChanged:v.MAP_TYPE_ID_CHANGED,onProjectionChanged:v.PROJECTION_CHANGED,onResize:v.RESIZE,onTilesLoaded:v.TILES_LOADED,onTiltChanged:v.TILT_CHANGED,onZoomChanged:v.ZOOM_CHANGED,onAnimationChanged:v.ANIMATION_CHANGED,onClickableChanged:v.CLICKABLE_CHANGED,onCursorChanged:v.CURSOR_CHANGED,onDraggableChanged:v.DRAGGABLE_CHANGED,onFlatChanged:v.FLAT_CHANGED,onIconChanged:v.ICON_CHANGED,onMouseDown:v.MOUSE_DOWN,onMouseUp:v.MOUSE_UP,onPositionChanged:v.POSITION_CHANGED,onShapeChanged:v.SHAPE_CHANGED,onTitleChanged:v.TITLE_CHANGED,onVisibleChanged:v.VISIBLE_CHANGED,onZIndexChanged:v.Z_INDEX_CHANGED}),D=function(){};function A(n,e){return void 0===e&&(e={}),function(t,a){return n(function(n,e,t){if(0===e.length&&0===n.length)return D;n=Array.from(new Set(n)).reverse();var a=(e=Array.from(new Set(e)).reverse()).length,i=function(n,t){var i=o([]);r(function(){var o=n.current;if(o){var r=i.current;if(r.length)for(var l=a;l--;){var c=e[l],s=t[c];u(s,r[l])||(o.set(c,s),r[l]=s)}else for(var d=a;d--;)r[d]=t[e[d]]}})};if(0===n.length)return i;var l=function(e,o){for(var a=function(a){var i=n[a],l=o[i];r(function(){var n=e.current;if(n&&l){var o=t[i],r=n.addListener(_[i],o?function(){l.apply(void 0,[this.get(o)].concat([].slice.call(arguments),[this]))}:function(){l.apply(void 0,[].slice.call(arguments).concat([this]))});return function(){return r.remove()}}},[l])},i=n.length;i--;)a(i)};if(0===a)return l;for(var c=[],s=n.length;s--;){var d=n[s],g=t[d];g&&e.includes(g)&&(c.push(d),n.splice(s,1))}var f=c.length;return 0===f?function(n,e){l(n,e),i(n,e)}:(0===n.length&&(l=D),function(n,i){var s=o({isTriggeredBySetStateMap:new Map,prevStateArr:[]});l(n,i);for(var d=s.current.isTriggeredBySetStateMap,g=function(e){var o=c[e],a=i[o];r(function(){var e=n.current;if(e&&a){var r=t[o],i=e.addListener(_[o],function(){d.has(r)?d.delete(r):a.apply(void 0,[this.get(r)].concat([].slice.call(arguments),[this]))});return function(){return i.remove()}}},[a])},C=f;C--;)g(C);r(function(){var t=n.current;if(t){var o=s.current.prevStateArr;if(o.length)for(var r=a;r--;){var l=e[r],c=i[l];u(c,o[r])||(d.set(l,!0),t.set(l,c),o[r]=c)}else for(var g=a;g--;)o[g]=i[e[g]]}})})}(t,a,e))}}var m,N=["children","className","style","defaultOptions","onMount","onUnmount"],O=A(function(e){return function(t){var i=t.children,l=t.className,u=t.style,c=t.defaultOptions,s=t.onMount,d=t.onUnmount,g=h(t,N),C=o(null),v=o(),p=a(),_=p[0],A=p[1];return r(function(){var n=C.current;if(n){var e=new google.maps.Map(n,f({},c,g));v.current=e,google.maps.event.addListenerOnce(e,"idle",function(){A(e),(s||D)(e)})}return d},[]),e(v,g),n.createElement("div",{ref:C,className:l,style:u},i&&_&&n.createElement(E.Provider,{value:_},"function"==typeof i?i(_):i))}},{onCenterChanged:"center",onHeadingChanged:"heading",onMapTypeIdChanged:"mapTypeId",onTiltChanged:"tilt",onZoomChanged:"zoom",onBoundsChanged:"bounds"}),I=["defaultOptions","onMount","onUnmount"],G=A(function(n){return function(e){var t=e.defaultOptions,a=e.onMount,i=e.onUnmount,l=h(e,I),u=p(),c=o();return r(function(){var n=new google.maps.Marker(f({map:u},t,l));return c.current=n,(a||D)(n),function(){n.setMap(null),(i||D)()}},[]),n(c,l),null}},{onAnimationChanged:"animation",onCursorChanged:"cursor",onDraggableChanged:"draggable",onIconChanged:"icon",onPositionChanged:"position",onShapeChanged:"shape",onTitleChanged:"title",onVisibleChanged:"visible",onZIndexChanged:"zIndex"}),L=function(n){void 0===n&&(n={});var e=a(c.status),t=e[0],o=e[1];return r(function(){t!==s.LOADED&&c.load().then(function(){o(s.LOADED),(n.onLoaded||D)()},function(e){o(s.ERROR),(n.onError||D)(e)})},[]),t},y=["children"],T=e(c.status),H=function(){return t(T)},M=function(e){var t=e.children,o=h(e,y),r=L(o);return t?n.createElement(T.Provider,{value:r},t):null},S=["lat","lng","onAdd","onDraw","onRemove","component","mapPaneLayer"];c.completion.then(function(){m=/*#__PURE__*/function(n){var e,t;function o(e,t,o){var r;return(r=n.call(this)||this)._style=void 0,r._latLng=void 0,r._onDraw=void 0,r._style=e,r._latLng=new google.maps.LatLng(t[0],t[1]),r.setCallbacks(o),r}t=n,(e=o).prototype=Object.create(t.prototype),e.prototype.constructor=e,C(e,t);var r=o.prototype;return r.setCallbacks=function(n){this.onAdd=n[0]||D,this._onDraw=n[1]||D,this.onRemove=n[2]||D},r.setCoords=function(n){this._latLng=new google.maps.LatLng(n[0],n[1]),this.draw()},r.draw=function(){var n=this.getProjection().fromLatLngToDivPixel(this._latLng);if(n){var e=n.x,t=n.y,o=this._style;o.left=e+"px",o.top=t+"px",this._onDraw(e,t)}},o}(google.maps.OverlayView)});var R=i(function(e,t){var a=e.lat,i=e.lng,u=e.onAdd,c=e.onDraw,s=e.onRemove,g=e.component,C=void 0===g?"div":g,v=e.mapPaneLayer,E=void 0===v?"overlayMouseTarget":v,_=h(e,S),D=p(),A=o({}),N=[a,i],O=[u,c,s],I=l(function(n){var e=A.current;if(n){if(e.el!==n){var o;null==(o=e.overlay)||o.setMap(null),e.el=n;var r=n.style;r.position="absolute";var a=new m(r,N,O);e.overlay=a,a.setMap(D)}}else e.overlay&&(e.overlay.setMap(null),delete e.el,delete e.overlay);!function(n,e){n&&("object"==typeof n?n.current=e:n(e))}(t,n)},[t]);return r(function(){var n=A.current,e=n.overlay;n.isNotFirstRender&&e&&e.setCallbacks(O)},O),r(function(){var n,e=A.current;e.isNotFirstRender?null==(n=e.overlay)||n.setCoords(N):e.isNotFirstRender=!0},N),d(n.createElement(C,f({ref:I},_)),D.__gm.panes[E])}),U=function(n,e,t){var i,l,u=(i=function(){return new g(e,t)},(l=o()).current||(l.current=i())),c=a([]),s=c[0][0],d=c[1],f=o();return r(function(){return function(){return u.cleanUp()}},[]),r(function(){var e=function(){var n=f.current;n&&d([function(){return u.getPoints.apply(u,n.concat([].slice.call(arguments)))}])};if(null!=t&&t.asyncMode)return u.loadAsync(n).then(e),function(){var e;n!==u.points&&(null==(e=u.worker)||e.terminate(),u.worker=void 0)};u.load(n),e()},[n]),{handleBoundsChange:function(n,e){var t=n.getSouthWest(),o=n.getNorthEast(),r=[e.getZoom(),t.lng(),t.lat(),o.lng(),o.lat()];f.current=r,u.points&&d([function(){return u.getPoints.apply(u,r.concat([].slice.call(arguments)))}])},getPoints:s,markerCluster:u}},b=function(){var n;if(null!=(n=c.options.libraries)&&n.includes("places"))return new google.maps.places.AutocompleteService;throw Error("Places library not loaded")},P=function(){var n=a(function(){return c.status===s.LOADED?b():void 0}),e=n[0],t=n[1];return r(function(){e||c.completion.then(function(){return t(b())})},[]),e};export{M as GoogleMapLoader,R as OverlayView,O as createGoogleMapComponent,G as createMarkerComponent,P as useAutocompleteService,p as useGoogleMap,L as useGoogleMapLoader,H as useGoogleMapStatus,U as useMarkerCluster};
import n,{createContext as e,useContext as t,useRef as o,useEffect as r,useState as a,forwardRef as i,useCallback as l}from"react";import u from"fast-deep-equal";import c,{LoaderStatus as s}from"google-maps-js-api-loader";export{default as Loader,LoaderStatus}from"google-maps-js-api-loader";import{createPortal as d}from"react-dom";import g from"marker-cluster";function f(){return f=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n},f.apply(this,arguments)}function C(n,e){return C=Object.setPrototypeOf||function(n,e){return n.__proto__=e,n},C(n,e)}function v(n,e){if(null==n)return{};var t,o,r={},a=Object.keys(n);for(o=0;o<a.length;o++)e.indexOf(t=a[o])>=0||(r[t]=n[t]);return r}var h,p=e(null),E=function(){return t(p)};!function(n){n.CLICK="click",n.CONTEXT_MENU="contextmenu",n.DOUBLE_CLICK="dblclick",n.DRAG="drag",n.DRAG_END="dragend",n.DRAG_START="dragstart",n.MOUSE_MOVE="mousemove",n.MOUSE_OUT="mouseout",n.MOUSE_OVER="mouseover",n.RIGHT_CLICK="rightclick",n.BOUNDS_CHANGED="bounds_changed",n.CENTER_CHANGED="center_changed",n.HEADING_CHANGED="heading_changed",n.IDLE="idle",n.MAP_TYPE_ID_CHANGED="maptypeid_changed",n.PROJECTION_CHANGED="projection_changed",n.RESIZE="resize",n.TILES_LOADED="tilesloaded",n.TILT_CHANGED="tilt_changed",n.ZOOM_CHANGED="zoom_changed",n.ANIMATION_CHANGED="animation_changed",n.CLICKABLE_CHANGED="clickable_changed",n.CURSOR_CHANGED="cursor_changed",n.DRAGGABLE_CHANGED="draggable_changed",n.FLAT_CHANGED="flat_changed",n.ICON_CHANGED="icon_changed",n.MOUSE_DOWN="mousedown",n.MOUSE_UP="mouseup",n.POSITION_CHANGED="position_changed",n.SHAPE_CHANGED="shape_changed",n.TITLE_CHANGED="title_changed",n.VISIBLE_CHANGED="visible_changed",n.Z_INDEX_CHANGED="zindex_changed"}(h||(h={}));var _=Object.freeze({onClick:h.CLICK,onDoubleClick:h.DOUBLE_CLICK,onDrag:h.DRAG,onDragEnd:h.DRAG_END,onDragStart:h.DRAG_START,onContextMenu:h.CONTEXT_MENU,onMouseMove:h.MOUSE_MOVE,onMouseOut:h.MOUSE_OUT,onMouseOver:h.MOUSE_OVER,onRightClick:h.RIGHT_CLICK,onBoundsChanged:h.BOUNDS_CHANGED,onCenterChanged:h.CENTER_CHANGED,onHeadingChanged:h.HEADING_CHANGED,onIdle:h.IDLE,onMapTypeIdChanged:h.MAP_TYPE_ID_CHANGED,onProjectionChanged:h.PROJECTION_CHANGED,onResize:h.RESIZE,onTilesLoaded:h.TILES_LOADED,onTiltChanged:h.TILT_CHANGED,onZoomChanged:h.ZOOM_CHANGED,onAnimationChanged:h.ANIMATION_CHANGED,onClickableChanged:h.CLICKABLE_CHANGED,onCursorChanged:h.CURSOR_CHANGED,onDraggableChanged:h.DRAGGABLE_CHANGED,onFlatChanged:h.FLAT_CHANGED,onIconChanged:h.ICON_CHANGED,onMouseDown:h.MOUSE_DOWN,onMouseUp:h.MOUSE_UP,onPositionChanged:h.POSITION_CHANGED,onShapeChanged:h.SHAPE_CHANGED,onTitleChanged:h.TITLE_CHANGED,onVisibleChanged:h.VISIBLE_CHANGED,onZIndexChanged:h.Z_INDEX_CHANGED}),D=function(){};function A(n,e){return void 0===e&&(e={}),function(t,a){return n(function(n,e,t){if(0===e.length&&0===n.length)return D;n=Array.from(new Set(n)).reverse();var a=(e=Array.from(new Set(e)).reverse()).length,i=function(n,t){var i=o([]);r(function(){var o=n.current;if(o){var r=i.current;if(r.length)for(var l=a;l--;){var c=e[l],s=t[c];u(s,r[l])||(o.set(c,s),r[l]=s)}else for(var d=a;d--;)r[d]=t[e[d]]}})};if(0===n.length)return i;var l=function(e,o){for(var a=function(a){var i=n[a],l=o[i];r(function(){var n=e.current;if(n&&l){var o=t[i],r=n.addListener(_[i],o?function(){l.apply(void 0,[this.get(o)].concat([].slice.call(arguments),[this]))}:function(){l.apply(void 0,[].slice.call(arguments).concat([this]))});return function(){return r.remove()}}},[l])},i=n.length;i--;)a(i)};if(0===a)return l;for(var c=[],s=n.length;s--;){var d=n[s],g=t[d];g&&e.includes(g)&&(c.push(d),n.splice(s,1))}var f=c.length;return 0===f?function(n,e){l(n,e),i(n,e)}:(0===n.length&&(l=D),function(n,i){var s=o({isTriggeredBySetStateMap:new Map,prevStateArr:[]});l(n,i);for(var d=s.current.isTriggeredBySetStateMap,g=function(e){var o=c[e],a=i[o];r(function(){var e=n.current;if(e&&a){var r=t[o],i=e.addListener(_[o],function(){d.has(r)?d.delete(r):a.apply(void 0,[this.get(r)].concat([].slice.call(arguments),[this]))});return function(){return i.remove()}}},[a])},C=f;C--;)g(C);r(function(){var t=n.current;if(t){var o=s.current.prevStateArr;if(o.length)for(var r=a;r--;){var l=e[r],c=i[l];u(c,o[r])||(d.set(l,!0),t.set(l,c),o[r]=c)}else for(var g=a;g--;)o[g]=i[e[g]]}})})}(t,a,e))}}var m,N=["children","className","style","defaultOptions","onMount","onUnmount"],O=A(function(e){return function(t){var i=t.children,l=t.className,u=t.style,c=t.defaultOptions,s=t.onMount,d=t.onUnmount,g=v(t,N),C=o(null),h=o(),E=a(),_=E[0],A=E[1];return r(function(){var n=C.current;if(n){var e=new google.maps.Map(n,f({},c,g));h.current=e,google.maps.event.addListenerOnce(e,"idle",function(){A(e),(s||D)(e)})}return d},[]),e(h,g),n.createElement("div",{ref:C,className:l,style:u},i&&_&&n.createElement(p.Provider,{value:_},"function"==typeof i?i(_):i))}},{onCenterChanged:"center",onHeadingChanged:"heading",onMapTypeIdChanged:"mapTypeId",onTiltChanged:"tilt",onZoomChanged:"zoom",onBoundsChanged:"bounds"}),I=["defaultOptions","onMount","onUnmount"],L=A(function(n){return function(e){var t=e.defaultOptions,a=e.onMount,i=e.onUnmount,l=v(e,I),u=E(),c=o();return r(function(){var n=new google.maps.Marker(f({map:u},t,l));return c.current=n,(a||D)(n),function(){n.setMap(null),(i||D)()}},[]),n(c,l),null}},{onAnimationChanged:"animation",onCursorChanged:"cursor",onDraggableChanged:"draggable",onIconChanged:"icon",onPositionChanged:"position",onShapeChanged:"shape",onTitleChanged:"title",onVisibleChanged:"visible",onZIndexChanged:"zIndex"}),G=function(n){void 0===n&&(n={});var e=a(c.status),t=e[0],o=e[1];return r(function(){t!==s.LOADED&&c.load().then(function(){o(s.LOADED),(n.onLoaded||D)()},function(e){o(s.ERROR),(n.onError||D)(e)})},[]),t},y=["children"],T=e(c.status),H=function(){return t(T)},M=function(e){var t=e.children,o=v(e,y),r=G(o);return t?n.createElement(T.Provider,{value:r},t):null},S=["lat","lng","onAdd","onDraw","onRemove","component","mapPaneLayer"];c.completion.then(function(){m=/*#__PURE__*/function(n){var e,t;function o(e,t,o){var r;return(r=n.call(this)||this)._style=void 0,r._latLng=void 0,r._onDraw=void 0,r._style=e,r._latLng=new google.maps.LatLng(t[0],t[1]),r.setCallbacks(o),r}t=n,(e=o).prototype=Object.create(t.prototype),e.prototype.constructor=e,C(e,t);var r=o.prototype;return r.setCallbacks=function(n){this.onAdd=n[0]||D,this._onDraw=n[1]||D,this.onRemove=n[2]||D},r.setCoords=function(n){this._latLng=new google.maps.LatLng(n[0],n[1]),this.draw()},r.draw=function(){var n=this.getProjection().fromLatLngToDivPixel(this._latLng);if(n){var e=n.x,t=n.y,o=this._style;o.left=e+"px",o.top=t+"px",this._onDraw(e,t)}},o}(google.maps.OverlayView)});var R=i(function(e,t){var a=e.lat,i=e.lng,u=e.onAdd,c=e.onDraw,s=e.onRemove,g=e.component,C=void 0===g?"div":g,h=e.mapPaneLayer,p=void 0===h?"overlayMouseTarget":h,_=v(e,S),D=E(),A=o({}),N=[a,i],O=[u,c,s],I=l(function(n){var e=A.current;if(n){if(e.el!==n){var o;null==(o=e.overlay)||o.setMap(null),e.el=n;var r=n.style;r.position="absolute";var a=new m(r,N,O);e.overlay=a,a.setMap(D)}}else e.overlay&&(e.overlay.setMap(null),delete e.el,delete e.overlay);!function(n,e){n&&("object"==typeof n?n.current=e:n(e))}(t,n)},[t]);return r(function(){var n=A.current,e=n.overlay;n.isNotFirstRender&&e&&e.setCallbacks(O)},O),r(function(){var n,e=A.current;e.isNotFirstRender?null==(n=e.overlay)||n.setCoords(N):e.isNotFirstRender=!0},N),d(n.createElement(C,f({ref:I},_)),D.__gm.panes[p])}),b=function(n,e,t){var i,l,u=(i=function(){return new g(e,t)},(l=o()).current||(l.current=i())),c=a([]),s=c[0][0],d=c[1],f=o();return r(function(){return function(){return u.cleanUp()}},[]),r(function(){var e=function(){var n=f.current;n&&d([function(){return u.getPoints.apply(u,n.concat([].slice.call(arguments)))}])};if(null!=t&&t.asyncMode)return u.loadAsync(n).then(e),function(){var e;n!==u.points&&(null==(e=u.worker)||e.terminate(),u.worker=void 0)};u.load(n),e()},[n]),{handleBoundsChange:function(n,e){var t=n.getSouthWest(),o=n.getNorthEast(),r=[e.getZoom(),t.lng(),t.lat(),o.lng(),o.lat()];f.current=r,u.points&&d([function(){return u.getPoints.apply(u,r.concat([].slice.call(arguments)))}])},getPoints:s,markerCluster:u}},P=function(){var n;if(null!=(n=c.options.libraries)&&n.includes("places"))return new google.maps.places.AutocompleteService;throw Error("Places library not loaded")},U=function(n){var e=a(function(){return c.status===s.LOADED?P():void 0}),t=e[0],o=e[1];return r(function(){t||(n?c.load():c.completion).then(function(){return o(P())})},[]),t},w=function(n){var e;if(void 0===n&&(n=null),null!=(e=c.options.libraries)&&e.includes("places"))return new google.maps.places.PlacesService(n);throw Error("Places library not loaded")},k=function(n,e){void 0===e&&(e=null);var t=a(function(){return"function"!=typeof e&&c.status===s.LOADED?w(e):void 0}),o=t[0],i=t[1];return r(function(){o||(n?c.load():c.completion).then(function(){return i(w("function"!=typeof e?e:e()))})},[]),o};export{M as GoogleMapLoader,R as OverlayView,O as createGoogleMapComponent,L as createMarkerComponent,U as useAutocompleteService,E as useGoogleMap,G as useGoogleMapLoader,H as useGoogleMapStatus,b as useMarkerCluster,k as usePlacesService};
//# sourceMappingURL=index.modern.js.map

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("fast-deep-equal"),require("google-maps-js-api-loader"),require("react-dom"),require("marker-cluster")):"function"==typeof define&&define.amd?define(["exports","react","fast-deep-equal","google-maps-js-api-loader","react-dom","marker-cluster"],n):n((e||self).googleMapsJsApiReact={},e.react,e.fastDeepEqual,e.googleMapsJsApiLoader,e.reactDom,e.markerCluster)}(this,function(e,n,t,o,r,a){function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=/*#__PURE__*/u(n),l=/*#__PURE__*/u(t),c=/*#__PURE__*/u(o),s=/*#__PURE__*/u(a);function d(){return d=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},d.apply(this,arguments)}function f(e,n){return f=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e},f(e,n)}function g(e,n){if(null==e)return{};var t,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n.indexOf(t=a[o])>=0||(r[t]=e[t]);return r}var C,p=n.createContext(null),E=function(){return n.useContext(p)};!function(e){e.CLICK="click",e.CONTEXT_MENU="contextmenu",e.DOUBLE_CLICK="dblclick",e.DRAG="drag",e.DRAG_END="dragend",e.DRAG_START="dragstart",e.MOUSE_MOVE="mousemove",e.MOUSE_OUT="mouseout",e.MOUSE_OVER="mouseover",e.RIGHT_CLICK="rightclick",e.BOUNDS_CHANGED="bounds_changed",e.CENTER_CHANGED="center_changed",e.HEADING_CHANGED="heading_changed",e.IDLE="idle",e.MAP_TYPE_ID_CHANGED="maptypeid_changed",e.PROJECTION_CHANGED="projection_changed",e.RESIZE="resize",e.TILES_LOADED="tilesloaded",e.TILT_CHANGED="tilt_changed",e.ZOOM_CHANGED="zoom_changed",e.ANIMATION_CHANGED="animation_changed",e.CLICKABLE_CHANGED="clickable_changed",e.CURSOR_CHANGED="cursor_changed",e.DRAGGABLE_CHANGED="draggable_changed",e.FLAT_CHANGED="flat_changed",e.ICON_CHANGED="icon_changed",e.MOUSE_DOWN="mousedown",e.MOUSE_UP="mouseup",e.POSITION_CHANGED="position_changed",e.SHAPE_CHANGED="shape_changed",e.TITLE_CHANGED="title_changed",e.VISIBLE_CHANGED="visible_changed",e.Z_INDEX_CHANGED="zindex_changed"}(C||(C={}));var h=Object.freeze({onClick:C.CLICK,onDoubleClick:C.DOUBLE_CLICK,onDrag:C.DRAG,onDragEnd:C.DRAG_END,onDragStart:C.DRAG_START,onContextMenu:C.CONTEXT_MENU,onMouseMove:C.MOUSE_MOVE,onMouseOut:C.MOUSE_OUT,onMouseOver:C.MOUSE_OVER,onRightClick:C.RIGHT_CLICK,onBoundsChanged:C.BOUNDS_CHANGED,onCenterChanged:C.CENTER_CHANGED,onHeadingChanged:C.HEADING_CHANGED,onIdle:C.IDLE,onMapTypeIdChanged:C.MAP_TYPE_ID_CHANGED,onProjectionChanged:C.PROJECTION_CHANGED,onResize:C.RESIZE,onTilesLoaded:C.TILES_LOADED,onTiltChanged:C.TILT_CHANGED,onZoomChanged:C.ZOOM_CHANGED,onAnimationChanged:C.ANIMATION_CHANGED,onClickableChanged:C.CLICKABLE_CHANGED,onCursorChanged:C.CURSOR_CHANGED,onDraggableChanged:C.DRAGGABLE_CHANGED,onFlatChanged:C.FLAT_CHANGED,onIconChanged:C.ICON_CHANGED,onMouseDown:C.MOUSE_DOWN,onMouseUp:C.MOUSE_UP,onPositionChanged:C.POSITION_CHANGED,onShapeChanged:C.SHAPE_CHANGED,onTitleChanged:C.TITLE_CHANGED,onVisibleChanged:C.VISIBLE_CHANGED,onZIndexChanged:C.Z_INDEX_CHANGED}),v=function(){};function _(e,t){return void 0===t&&(t={}),function(o,r){return e(function(e,t,o){if(0===t.length&&0===e.length)return v;e=Array.from(new Set(e)).reverse();var r=(t=Array.from(new Set(t)).reverse()).length,a=function(e,o){var a=n.useRef([]);n.useEffect(function(){var n=e.current;if(n){var u=a.current;if(u.length)for(var i=r;i--;){var c=t[i],s=o[c];l.default(s,u[i])||(n.set(c,s),u[i]=s)}else for(var d=r;d--;)u[d]=o[t[d]]}})};if(0===e.length)return a;var u=function(t,r){for(var a=function(a){var u=e[a],i=r[u];n.useEffect(function(){var e=t.current;if(e&&i){var n=o[u],r=e.addListener(h[u],n?function(){i.apply(void 0,[this.get(n)].concat([].slice.call(arguments),[this]))}:function(){i.apply(void 0,[].slice.call(arguments).concat([this]))});return function(){return r.remove()}}},[i])},u=e.length;u--;)a(u)};if(0===r)return u;for(var i=[],c=e.length;c--;){var s=e[c],d=o[s];d&&t.includes(d)&&(i.push(s),e.splice(c,1))}var f=i.length;return 0===f?function(e,n){u(e,n),a(e,n)}:(0===e.length&&(u=v),function(e,a){var c=n.useRef({isTriggeredBySetStateMap:new Map,prevStateArr:[]});u(e,a);for(var s=c.current.isTriggeredBySetStateMap,d=function(t){var r=i[t],u=a[r];n.useEffect(function(){var n=e.current;if(n&&u){var t=o[r],a=n.addListener(h[r],function(){s.has(t)?s.delete(t):u.apply(void 0,[this.get(t)].concat([].slice.call(arguments),[this]))});return function(){return a.remove()}}},[u])},g=f;g--;)d(g);n.useEffect(function(){var n=e.current;if(n){var o=c.current.prevStateArr;if(o.length)for(var u=r;u--;){var i=t[u],d=a[i];l.default(d,o[u])||(s.set(i,!0),n.set(i,d),o[u]=d)}else for(var f=r;f--;)o[f]=a[t[f]]}})})}(o,r,t))}}var D,A=["children","className","style","defaultOptions","onMount","onUnmount"],m=_(function(e){return function(t){var o=t.children,r=t.className,a=t.style,u=t.defaultOptions,l=t.onMount,c=t.onUnmount,s=g(t,A),f=n.useRef(null),C=n.useRef(),E=n.useState(),h=E[0],_=E[1];return n.useEffect(function(){var e=f.current;if(e){var n=new google.maps.Map(e,d({},u,s));C.current=n,google.maps.event.addListenerOnce(n,"idle",function(){_(n),(l||v)(n)})}return c},[]),e(C,s),i.default.createElement("div",{ref:f,className:r,style:a},o&&h&&i.default.createElement(p.Provider,{value:h},"function"==typeof o?o(h):o))}},{onCenterChanged:"center",onHeadingChanged:"heading",onMapTypeIdChanged:"mapTypeId",onTiltChanged:"tilt",onZoomChanged:"zoom",onBoundsChanged:"bounds"}),N=["defaultOptions","onMount","onUnmount"],O=_(function(e){return function(t){var o=t.defaultOptions,r=t.onMount,a=t.onUnmount,u=g(t,N),i=E(),l=n.useRef();return n.useEffect(function(){var e=new google.maps.Marker(d({map:i},o,u));return l.current=e,(r||v)(e),function(){e.setMap(null),(a||v)()}},[]),e(l,u),null}},{onAnimationChanged:"animation",onCursorChanged:"cursor",onDraggableChanged:"draggable",onIconChanged:"icon",onPositionChanged:"position",onShapeChanged:"shape",onTitleChanged:"title",onVisibleChanged:"visible",onZIndexChanged:"zIndex"}),L=function(e){void 0===e&&(e={});var t=n.useState(c.default.status),r=t[0],a=t[1];return n.useEffect(function(){r!==o.LoaderStatus.LOADED&&c.default.load().then(function(){a(o.LoaderStatus.LOADED),(e.onLoaded||v)()},function(n){a(o.LoaderStatus.ERROR),(e.onError||v)(n)})},[]),r},G=["children"],y=n.createContext(c.default.status),M=["lat","lng","onAdd","onDraw","onRemove","component","mapPaneLayer"];c.default.completion.then(function(){D=/*#__PURE__*/function(e){var n,t;function o(n,t,o){var r;return(r=e.call(this)||this)._style=void 0,r._latLng=void 0,r._onDraw=void 0,r._style=n,r._latLng=new google.maps.LatLng(t[0],t[1]),r.setCallbacks(o),r}t=e,(n=o).prototype=Object.create(t.prototype),n.prototype.constructor=n,f(n,t);var r=o.prototype;return r.setCallbacks=function(e){this.onAdd=e[0]||v,this._onDraw=e[1]||v,this.onRemove=e[2]||v},r.setCoords=function(e){this._latLng=new google.maps.LatLng(e[0],e[1]),this.draw()},r.draw=function(){var e=this.getProjection().fromLatLngToDivPixel(this._latLng);if(e){var n=e.x,t=e.y,o=this._style;o.left=n+"px",o.top=t+"px",this._onDraw(n,t)}},o}(google.maps.OverlayView)});var I=n.forwardRef(function(e,t){var o=e.lat,a=e.lng,u=e.onAdd,l=e.onDraw,c=e.onRemove,s=e.component,f=void 0===s?"div":s,C=e.mapPaneLayer,p=void 0===C?"overlayMouseTarget":C,h=g(e,M),v=E(),_=n.useRef({}),A=[o,a],m=[u,l,c],N=n.useCallback(function(e){var n=_.current;if(e){if(n.el!==e){var o;null==(o=n.overlay)||o.setMap(null),n.el=e;var r=e.style;r.position="absolute";var a=new D(r,A,m);n.overlay=a,a.setMap(v)}}else n.overlay&&(n.overlay.setMap(null),delete n.el,delete n.overlay);!function(e,n){e&&("object"==typeof e?e.current=n:e(n))}(t,e)},[t]);return n.useEffect(function(){var e=_.current,n=e.overlay;e.isNotFirstRender&&n&&n.setCallbacks(m)},m),n.useEffect(function(){var e,n=_.current;n.isNotFirstRender?null==(e=n.overlay)||e.setCoords(A):n.isNotFirstRender=!0},A),r.createPortal(i.default.createElement(f,d({ref:N},h)),v.__gm.panes[p])}),S=function(){var e;if(null!=(e=c.default.options.libraries)&&e.includes("places"))return new google.maps.places.AutocompleteService;throw Error("Places library not loaded")};Object.defineProperty(e,"Loader",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"LoaderStatus",{enumerable:!0,get:function(){return o.LoaderStatus}}),e.GoogleMapLoader=function(e){var n=e.children,t=g(e,G),o=L(t);return n?i.default.createElement(y.Provider,{value:o},n):null},e.OverlayView=I,e.createGoogleMapComponent=m,e.createMarkerComponent=O,e.useAutocompleteService=function(){var e=n.useState(function(){return c.default.status===o.LoaderStatus.LOADED?S():void 0}),t=e[0],r=e[1];return n.useEffect(function(){t||c.default.completion.then(function(){return r(S())})},[]),t},e.useGoogleMap=E,e.useGoogleMapLoader=L,e.useGoogleMapStatus=function(){return n.useContext(y)},e.useMarkerCluster=function(e,t,o){var r,a,u=(r=function(){return new s.default(t,o)},(a=n.useRef()).current||(a.current=r())),i=n.useState([]),l=i[0][0],c=i[1],d=n.useRef();return n.useEffect(function(){return function(){return u.cleanUp()}},[]),n.useEffect(function(){var n=function(){var e=d.current;e&&c([function(){return u.getPoints.apply(u,e.concat([].slice.call(arguments)))}])};if(null!=o&&o.asyncMode)return u.loadAsync(e).then(n),function(){var n;e!==u.points&&(null==(n=u.worker)||n.terminate(),u.worker=void 0)};u.load(e),n()},[e]),{handleBoundsChange:function(e,n){var t=e.getSouthWest(),o=e.getNorthEast(),r=[n.getZoom(),t.lng(),t.lat(),o.lng(),o.lat()];d.current=r,u.points&&c([function(){return u.getPoints.apply(u,r.concat([].slice.call(arguments)))}])},getPoints:l,markerCluster:u}}});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("fast-deep-equal"),require("google-maps-js-api-loader"),require("react-dom"),require("marker-cluster")):"function"==typeof define&&define.amd?define(["exports","react","fast-deep-equal","google-maps-js-api-loader","react-dom","marker-cluster"],n):n((e||self).googleMapsJsApiReact={},e.react,e.fastDeepEqual,e.googleMapsJsApiLoader,e.reactDom,e.markerCluster)}(this,function(e,n,t,o,r,a){function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=/*#__PURE__*/u(n),l=/*#__PURE__*/u(t),c=/*#__PURE__*/u(o),s=/*#__PURE__*/u(a);function d(){return d=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},d.apply(this,arguments)}function f(e,n){return f=Object.setPrototypeOf||function(e,n){return e.__proto__=n,e},f(e,n)}function g(e,n){if(null==e)return{};var t,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n.indexOf(t=a[o])>=0||(r[t]=e[t]);return r}var p,C=n.createContext(null),E=function(){return n.useContext(C)};!function(e){e.CLICK="click",e.CONTEXT_MENU="contextmenu",e.DOUBLE_CLICK="dblclick",e.DRAG="drag",e.DRAG_END="dragend",e.DRAG_START="dragstart",e.MOUSE_MOVE="mousemove",e.MOUSE_OUT="mouseout",e.MOUSE_OVER="mouseover",e.RIGHT_CLICK="rightclick",e.BOUNDS_CHANGED="bounds_changed",e.CENTER_CHANGED="center_changed",e.HEADING_CHANGED="heading_changed",e.IDLE="idle",e.MAP_TYPE_ID_CHANGED="maptypeid_changed",e.PROJECTION_CHANGED="projection_changed",e.RESIZE="resize",e.TILES_LOADED="tilesloaded",e.TILT_CHANGED="tilt_changed",e.ZOOM_CHANGED="zoom_changed",e.ANIMATION_CHANGED="animation_changed",e.CLICKABLE_CHANGED="clickable_changed",e.CURSOR_CHANGED="cursor_changed",e.DRAGGABLE_CHANGED="draggable_changed",e.FLAT_CHANGED="flat_changed",e.ICON_CHANGED="icon_changed",e.MOUSE_DOWN="mousedown",e.MOUSE_UP="mouseup",e.POSITION_CHANGED="position_changed",e.SHAPE_CHANGED="shape_changed",e.TITLE_CHANGED="title_changed",e.VISIBLE_CHANGED="visible_changed",e.Z_INDEX_CHANGED="zindex_changed"}(p||(p={}));var v=Object.freeze({onClick:p.CLICK,onDoubleClick:p.DOUBLE_CLICK,onDrag:p.DRAG,onDragEnd:p.DRAG_END,onDragStart:p.DRAG_START,onContextMenu:p.CONTEXT_MENU,onMouseMove:p.MOUSE_MOVE,onMouseOut:p.MOUSE_OUT,onMouseOver:p.MOUSE_OVER,onRightClick:p.RIGHT_CLICK,onBoundsChanged:p.BOUNDS_CHANGED,onCenterChanged:p.CENTER_CHANGED,onHeadingChanged:p.HEADING_CHANGED,onIdle:p.IDLE,onMapTypeIdChanged:p.MAP_TYPE_ID_CHANGED,onProjectionChanged:p.PROJECTION_CHANGED,onResize:p.RESIZE,onTilesLoaded:p.TILES_LOADED,onTiltChanged:p.TILT_CHANGED,onZoomChanged:p.ZOOM_CHANGED,onAnimationChanged:p.ANIMATION_CHANGED,onClickableChanged:p.CLICKABLE_CHANGED,onCursorChanged:p.CURSOR_CHANGED,onDraggableChanged:p.DRAGGABLE_CHANGED,onFlatChanged:p.FLAT_CHANGED,onIconChanged:p.ICON_CHANGED,onMouseDown:p.MOUSE_DOWN,onMouseUp:p.MOUSE_UP,onPositionChanged:p.POSITION_CHANGED,onShapeChanged:p.SHAPE_CHANGED,onTitleChanged:p.TITLE_CHANGED,onVisibleChanged:p.VISIBLE_CHANGED,onZIndexChanged:p.Z_INDEX_CHANGED}),h=function(){};function _(e,t){return void 0===t&&(t={}),function(o,r){return e(function(e,t,o){if(0===t.length&&0===e.length)return h;e=Array.from(new Set(e)).reverse();var r=(t=Array.from(new Set(t)).reverse()).length,a=function(e,o){var a=n.useRef([]);n.useEffect(function(){var n=e.current;if(n){var u=a.current;if(u.length)for(var i=r;i--;){var c=t[i],s=o[c];l.default(s,u[i])||(n.set(c,s),u[i]=s)}else for(var d=r;d--;)u[d]=o[t[d]]}})};if(0===e.length)return a;var u=function(t,r){for(var a=function(a){var u=e[a],i=r[u];n.useEffect(function(){var e=t.current;if(e&&i){var n=o[u],r=e.addListener(v[u],n?function(){i.apply(void 0,[this.get(n)].concat([].slice.call(arguments),[this]))}:function(){i.apply(void 0,[].slice.call(arguments).concat([this]))});return function(){return r.remove()}}},[i])},u=e.length;u--;)a(u)};if(0===r)return u;for(var i=[],c=e.length;c--;){var s=e[c],d=o[s];d&&t.includes(d)&&(i.push(s),e.splice(c,1))}var f=i.length;return 0===f?function(e,n){u(e,n),a(e,n)}:(0===e.length&&(u=h),function(e,a){var c=n.useRef({isTriggeredBySetStateMap:new Map,prevStateArr:[]});u(e,a);for(var s=c.current.isTriggeredBySetStateMap,d=function(t){var r=i[t],u=a[r];n.useEffect(function(){var n=e.current;if(n&&u){var t=o[r],a=n.addListener(v[r],function(){s.has(t)?s.delete(t):u.apply(void 0,[this.get(t)].concat([].slice.call(arguments),[this]))});return function(){return a.remove()}}},[u])},g=f;g--;)d(g);n.useEffect(function(){var n=e.current;if(n){var o=c.current.prevStateArr;if(o.length)for(var u=r;u--;){var i=t[u],d=a[i];l.default(d,o[u])||(s.set(i,!0),n.set(i,d),o[u]=d)}else for(var f=r;f--;)o[f]=a[t[f]]}})})}(o,r,t))}}var D,A=["children","className","style","defaultOptions","onMount","onUnmount"],m=_(function(e){return function(t){var o=t.children,r=t.className,a=t.style,u=t.defaultOptions,l=t.onMount,c=t.onUnmount,s=g(t,A),f=n.useRef(null),p=n.useRef(),E=n.useState(),v=E[0],_=E[1];return n.useEffect(function(){var e=f.current;if(e){var n=new google.maps.Map(e,d({},u,s));p.current=n,google.maps.event.addListenerOnce(n,"idle",function(){_(n),(l||h)(n)})}return c},[]),e(p,s),i.default.createElement("div",{ref:f,className:r,style:a},o&&v&&i.default.createElement(C.Provider,{value:v},"function"==typeof o?o(v):o))}},{onCenterChanged:"center",onHeadingChanged:"heading",onMapTypeIdChanged:"mapTypeId",onTiltChanged:"tilt",onZoomChanged:"zoom",onBoundsChanged:"bounds"}),N=["defaultOptions","onMount","onUnmount"],O=_(function(e){return function(t){var o=t.defaultOptions,r=t.onMount,a=t.onUnmount,u=g(t,N),i=E(),l=n.useRef();return n.useEffect(function(){var e=new google.maps.Marker(d({map:i},o,u));return l.current=e,(r||h)(e),function(){e.setMap(null),(a||h)()}},[]),e(l,u),null}},{onAnimationChanged:"animation",onCursorChanged:"cursor",onDraggableChanged:"draggable",onIconChanged:"icon",onPositionChanged:"position",onShapeChanged:"shape",onTitleChanged:"title",onVisibleChanged:"visible",onZIndexChanged:"zIndex"}),L=function(e){void 0===e&&(e={});var t=n.useState(c.default.status),r=t[0],a=t[1];return n.useEffect(function(){r!==o.LoaderStatus.LOADED&&c.default.load().then(function(){a(o.LoaderStatus.LOADED),(e.onLoaded||h)()},function(n){a(o.LoaderStatus.ERROR),(e.onError||h)(n)})},[]),r},y=["children"],G=n.createContext(c.default.status),S=["lat","lng","onAdd","onDraw","onRemove","component","mapPaneLayer"];c.default.completion.then(function(){D=/*#__PURE__*/function(e){var n,t;function o(n,t,o){var r;return(r=e.call(this)||this)._style=void 0,r._latLng=void 0,r._onDraw=void 0,r._style=n,r._latLng=new google.maps.LatLng(t[0],t[1]),r.setCallbacks(o),r}t=e,(n=o).prototype=Object.create(t.prototype),n.prototype.constructor=n,f(n,t);var r=o.prototype;return r.setCallbacks=function(e){this.onAdd=e[0]||h,this._onDraw=e[1]||h,this.onRemove=e[2]||h},r.setCoords=function(e){this._latLng=new google.maps.LatLng(e[0],e[1]),this.draw()},r.draw=function(){var e=this.getProjection().fromLatLngToDivPixel(this._latLng);if(e){var n=e.x,t=e.y,o=this._style;o.left=n+"px",o.top=t+"px",this._onDraw(n,t)}},o}(google.maps.OverlayView)});var M=n.forwardRef(function(e,t){var o=e.lat,a=e.lng,u=e.onAdd,l=e.onDraw,c=e.onRemove,s=e.component,f=void 0===s?"div":s,p=e.mapPaneLayer,C=void 0===p?"overlayMouseTarget":p,v=g(e,S),h=E(),_=n.useRef({}),A=[o,a],m=[u,l,c],N=n.useCallback(function(e){var n=_.current;if(e){if(n.el!==e){var o;null==(o=n.overlay)||o.setMap(null),n.el=e;var r=e.style;r.position="absolute";var a=new D(r,A,m);n.overlay=a,a.setMap(h)}}else n.overlay&&(n.overlay.setMap(null),delete n.el,delete n.overlay);!function(e,n){e&&("object"==typeof e?e.current=n:e(n))}(t,e)},[t]);return n.useEffect(function(){var e=_.current,n=e.overlay;e.isNotFirstRender&&n&&n.setCallbacks(m)},m),n.useEffect(function(){var e,n=_.current;n.isNotFirstRender?null==(e=n.overlay)||e.setCoords(A):n.isNotFirstRender=!0},A),r.createPortal(i.default.createElement(f,d({ref:N},v)),h.__gm.panes[C])}),I=function(){var e;if(null!=(e=c.default.options.libraries)&&e.includes("places"))return new google.maps.places.AutocompleteService;throw Error("Places library not loaded")},T=function(e){var n;if(void 0===e&&(e=null),null!=(n=c.default.options.libraries)&&n.includes("places"))return new google.maps.places.PlacesService(e);throw Error("Places library not loaded")};Object.defineProperty(e,"Loader",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"LoaderStatus",{enumerable:!0,get:function(){return o.LoaderStatus}}),e.GoogleMapLoader=function(e){var n=e.children,t=g(e,y),o=L(t);return n?i.default.createElement(G.Provider,{value:o},n):null},e.OverlayView=M,e.createGoogleMapComponent=m,e.createMarkerComponent=O,e.useAutocompleteService=function(e){var t=n.useState(function(){return c.default.status===o.LoaderStatus.LOADED?I():void 0}),r=t[0],a=t[1];return n.useEffect(function(){r||(e?c.default.load():c.default.completion).then(function(){return a(I())})},[]),r},e.useGoogleMap=E,e.useGoogleMapLoader=L,e.useGoogleMapStatus=function(){return n.useContext(G)},e.useMarkerCluster=function(e,t,o){var r,a,u=(r=function(){return new s.default(t,o)},(a=n.useRef()).current||(a.current=r())),i=n.useState([]),l=i[0][0],c=i[1],d=n.useRef();return n.useEffect(function(){return function(){return u.cleanUp()}},[]),n.useEffect(function(){var n=function(){var e=d.current;e&&c([function(){return u.getPoints.apply(u,e.concat([].slice.call(arguments)))}])};if(null!=o&&o.asyncMode)return u.loadAsync(e).then(n),function(){var n;e!==u.points&&(null==(n=u.worker)||n.terminate(),u.worker=void 0)};u.load(e),n()},[e]),{handleBoundsChange:function(e,n){var t=e.getSouthWest(),o=e.getNorthEast(),r=[n.getZoom(),t.lng(),t.lat(),o.lng(),o.lat()];d.current=r,u.points&&c([function(){return u.getPoints.apply(u,r.concat([].slice.call(arguments)))}])},getPoints:l,markerCluster:u}},e.usePlacesService=function(e,t){void 0===t&&(t=null);var r=n.useState(function(){return"function"!=typeof t&&c.default.status===o.LoaderStatus.LOADED?T(t):void 0}),a=r[0],u=r[1];return n.useEffect(function(){a||(e?c.default.load():c.default.completion).then(function(){return u(T("function"!=typeof t?t:t()))})},[]),a}});
//# sourceMappingURL=index.umd.js.map
{
"name": "google-maps-js-api-react",
"version": "1.2.0",
"version": "1.2.1",
"description": "Library for convenient work of Google Maps JavaScript API with React",

@@ -31,4 +31,4 @@ "author": "Krombik",

"devDependencies": {
"@types/google.maps": "^3.48.7",
"@types/react": "^18.0.8",
"@types/google.maps": "^3.48.8",
"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.3",

@@ -35,0 +35,0 @@ "@typescript-eslint/eslint-plugin": "^5.22.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc