google-maps-react-markers 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/google-map.d.ts.map +1 -1
- package/dist/hooks/useGoogleMaps.d.ts +5 -1
- package/dist/hooks/useGoogleMaps.d.ts.map +1 -1
- package/dist/hooks/useScript.d.ts +1 -1
- package/dist/hooks/useScript.d.ts.map +1 -1
- package/dist/index.js +51 -51
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +51 -51
- package/dist/index.modern.js.map +1 -1
- package/dist/map/map.d.ts +20 -22
- package/dist/map/map.d.ts.map +1 -1
- package/dist/map/markers.d.ts +2 -2
- package/dist/map/markers.d.ts.map +1 -1
- package/dist/map/overlay-view.d.ts +16 -10
- package/dist/map/overlay-view.d.ts.map +1 -1
- package/dist/map/overlay.d.ts +15 -9
- package/dist/map/overlay.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/google-map.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-map.d.ts","sourceRoot":"","sources":["../src/google-map.js"],"names":[],"mappings":";AAKA,
|
|
1
|
+
{"version":3,"file":"google-map.d.ts","sourceRoot":"","sources":["../src/google-map.js"],"names":[],"mappings":";AAKA,6BA2CE"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
export function useGoogleMaps({ apiKey, libraries }: {
|
|
1
|
+
export function useGoogleMaps({ apiKey, libraries, loadScriptExternally, status, externalApiParams, callback, }: {
|
|
2
2
|
apiKey: any;
|
|
3
3
|
libraries?: any[];
|
|
4
|
+
loadScriptExternally?: boolean;
|
|
5
|
+
status?: string;
|
|
6
|
+
externalApiParams: any;
|
|
7
|
+
callback: any;
|
|
4
8
|
}): "idle" | "loading" | "ready" | "error";
|
|
5
9
|
//# sourceMappingURL=useGoogleMaps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGoogleMaps.d.ts","sourceRoot":"","sources":["../../src/hooks/useGoogleMaps.js"],"names":[],"mappings":"AAKO
|
|
1
|
+
{"version":3,"file":"useGoogleMaps.d.ts","sourceRoot":"","sources":["../../src/hooks/useGoogleMaps.js"],"names":[],"mappings":"AAKO;;;;;;;IAFM,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CA0BlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScript.d.ts","sourceRoot":"","sources":["../../src/hooks/useScript.js"],"names":[],"mappings":"AA0BO;IApBmB,GAAG,EAAlB,MAAM;IACU,UAAU;IACV,SAAS;QACG,cAAc;QACd,eAAe;;IAC3B,iBAAiB,GAAjC,MAAM;
|
|
1
|
+
{"version":3,"file":"useScript.d.ts","sourceRoot":"","sources":["../../src/hooks/useScript.js"],"names":[],"mappings":"AA0BO;IApBmB,GAAG,EAAlB,MAAM;IACU,UAAU;IACV,SAAS;QACG,cAAc;QACd,eAAe;;IAC3B,iBAAiB,GAAjC,MAAM;wBACJ,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAiHlD"}
|
package/dist/index.js
CHANGED
|
@@ -247,6 +247,8 @@ var createOverlay = function createOverlay(_ref) {
|
|
|
247
247
|
var point = projection.fromLatLngToDivPixel(_this.position);
|
|
248
248
|
if (point === null) return;
|
|
249
249
|
_this.container.style.transform = "translate(" + point.x + "px, " + point.y + "px)";
|
|
250
|
+
_this.container.style.width = '0px';
|
|
251
|
+
_this.container.style.height = '0px';
|
|
250
252
|
};
|
|
251
253
|
_this.onRemove = function () {
|
|
252
254
|
if (_this.container.parentNode !== null) {
|
|
@@ -280,11 +282,13 @@ createOverlay.propTypes = {
|
|
|
280
282
|
};
|
|
281
283
|
|
|
282
284
|
var OverlayView = function OverlayView(_ref) {
|
|
283
|
-
var pane = _ref.pane,
|
|
285
|
+
var _ref$pane = _ref.pane,
|
|
286
|
+
pane = _ref$pane === void 0 ? 'floatPane' : _ref$pane,
|
|
284
287
|
position = _ref.position,
|
|
285
288
|
map = _ref.map,
|
|
286
289
|
maps = _ref.maps,
|
|
287
|
-
zIndex = _ref.zIndex,
|
|
290
|
+
_ref$zIndex = _ref.zIndex,
|
|
291
|
+
zIndex = _ref$zIndex === void 0 ? 0 : _ref$zIndex,
|
|
288
292
|
children = _ref.children,
|
|
289
293
|
drag = _ref.drag;
|
|
290
294
|
var container = React.useMemo(function () {
|
|
@@ -300,7 +304,7 @@ var OverlayView = function OverlayView(_ref) {
|
|
|
300
304
|
maps: maps,
|
|
301
305
|
drag: drag
|
|
302
306
|
});
|
|
303
|
-
}, [container, maps, pane, position]);
|
|
307
|
+
}, [container, drag, maps, pane, position]);
|
|
304
308
|
var childrenProps = useMemoCompare(children === null || children === void 0 ? void 0 : children.props, function (prev, next) {
|
|
305
309
|
return prev && prev.lat === next.lat && prev.lng === next.lng;
|
|
306
310
|
});
|
|
@@ -317,10 +321,6 @@ var OverlayView = function OverlayView(_ref) {
|
|
|
317
321
|
}, [zIndex, container]);
|
|
318
322
|
return /*#__PURE__*/reactDom.createPortal(children, container);
|
|
319
323
|
};
|
|
320
|
-
OverlayView.defaultProps = {
|
|
321
|
-
pane: 'floatPane',
|
|
322
|
-
zIndex: 0
|
|
323
|
-
};
|
|
324
324
|
OverlayView.propTypes = {
|
|
325
325
|
pane: propTypes.string,
|
|
326
326
|
position: propTypes.shape({
|
|
@@ -393,14 +393,28 @@ MapMarkers.propTypes = {
|
|
|
393
393
|
|
|
394
394
|
var EPS = 0.00001;
|
|
395
395
|
var MapComponent = function MapComponent(_ref) {
|
|
396
|
-
var children = _ref.children,
|
|
397
|
-
|
|
396
|
+
var _ref$children = _ref.children,
|
|
397
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
398
|
+
_ref$style = _ref.style,
|
|
399
|
+
style = _ref$style === void 0 ? {
|
|
400
|
+
width: '100%',
|
|
401
|
+
height: '100%',
|
|
402
|
+
left: 0,
|
|
403
|
+
top: 0,
|
|
404
|
+
margin: 0,
|
|
405
|
+
padding: 0,
|
|
406
|
+
position: 'absolute'
|
|
407
|
+
} : _ref$style,
|
|
398
408
|
defaultCenter = _ref.defaultCenter,
|
|
399
409
|
defaultZoom = _ref.defaultZoom,
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
410
|
+
_ref$onGoogleApiLoade = _ref.onGoogleApiLoaded,
|
|
411
|
+
onGoogleApiLoaded = _ref$onGoogleApiLoade === void 0 ? function () {} : _ref$onGoogleApiLoade,
|
|
412
|
+
_ref$onChange = _ref.onChange,
|
|
413
|
+
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
414
|
+
_ref$options = _ref.options,
|
|
415
|
+
options = _ref$options === void 0 ? {} : _ref$options,
|
|
416
|
+
_ref$events = _ref.events,
|
|
417
|
+
events = _ref$events === void 0 ? [] : _ref$events;
|
|
404
418
|
var mapRef = React.useRef(null);
|
|
405
419
|
var prevBoundsRef = React.useRef(null);
|
|
406
420
|
var _useState = React.useState(null),
|
|
@@ -479,21 +493,6 @@ var MapComponent = function MapComponent(_ref) {
|
|
|
479
493
|
maps: maps
|
|
480
494
|
}, children));
|
|
481
495
|
};
|
|
482
|
-
MapComponent.defaultProps = {
|
|
483
|
-
style: {
|
|
484
|
-
width: '100%',
|
|
485
|
-
height: '100%',
|
|
486
|
-
left: 0,
|
|
487
|
-
top: 0,
|
|
488
|
-
margin: 0,
|
|
489
|
-
padding: 0,
|
|
490
|
-
position: 'absolute'
|
|
491
|
-
},
|
|
492
|
-
onGoogleApiLoaded: function onGoogleApiLoaded() {},
|
|
493
|
-
onChange: function onChange() {},
|
|
494
|
-
options: {},
|
|
495
|
-
events: []
|
|
496
|
-
};
|
|
497
496
|
MapComponent.propTypes = {
|
|
498
497
|
children: propTypes.oneOfType([propTypes.arrayOf(propTypes.node), propTypes.node]),
|
|
499
498
|
style: propTypes.object,
|
|
@@ -510,18 +509,30 @@ MapComponent.propTypes = {
|
|
|
510
509
|
|
|
511
510
|
var _excluded = ["apiKey", "libraries", "children", "loadingContent", "idleContent", "errorContent", "mapMinHeight", "containerProps", "loadScriptExternally", "status", "scriptCallback", "externalApiParams"];
|
|
512
511
|
var GoogleMap = /*#__PURE__*/React.forwardRef(function GoogleMap(_ref, ref) {
|
|
513
|
-
var apiKey = _ref.apiKey,
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
512
|
+
var _ref$apiKey = _ref.apiKey,
|
|
513
|
+
apiKey = _ref$apiKey === void 0 ? '' : _ref$apiKey,
|
|
514
|
+
_ref$libraries = _ref.libraries,
|
|
515
|
+
libraries = _ref$libraries === void 0 ? ['places', 'geometry'] : _ref$libraries,
|
|
516
|
+
_ref$children = _ref.children,
|
|
517
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
518
|
+
_ref$loadingContent = _ref.loadingContent,
|
|
519
|
+
loadingContent = _ref$loadingContent === void 0 ? 'Google Maps is loading' : _ref$loadingContent,
|
|
520
|
+
_ref$idleContent = _ref.idleContent,
|
|
521
|
+
idleContent = _ref$idleContent === void 0 ? 'Google Maps is on idle' : _ref$idleContent,
|
|
522
|
+
_ref$errorContent = _ref.errorContent,
|
|
523
|
+
errorContent = _ref$errorContent === void 0 ? 'Google Maps is on error' : _ref$errorContent,
|
|
524
|
+
_ref$mapMinHeight = _ref.mapMinHeight,
|
|
525
|
+
mapMinHeight = _ref$mapMinHeight === void 0 ? 'unset' : _ref$mapMinHeight,
|
|
526
|
+
_ref$containerProps = _ref.containerProps,
|
|
527
|
+
containerProps = _ref$containerProps === void 0 ? {} : _ref$containerProps,
|
|
528
|
+
_ref$loadScriptExtern = _ref.loadScriptExternally,
|
|
529
|
+
loadScriptExternally = _ref$loadScriptExtern === void 0 ? false : _ref$loadScriptExtern,
|
|
530
|
+
_ref$status = _ref.status,
|
|
531
|
+
status = _ref$status === void 0 ? 'idle' : _ref$status,
|
|
532
|
+
_ref$scriptCallback = _ref.scriptCallback,
|
|
533
|
+
scriptCallback = _ref$scriptCallback === void 0 ? function () {} : _ref$scriptCallback,
|
|
534
|
+
_ref$externalApiParam = _ref.externalApiParams,
|
|
535
|
+
externalApiParams = _ref$externalApiParam === void 0 ? {} : _ref$externalApiParam,
|
|
525
536
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
526
537
|
var renderers = {
|
|
527
538
|
ready: /*#__PURE__*/React__default.createElement(MapComponent, props, children),
|
|
@@ -548,17 +559,6 @@ var GoogleMap = /*#__PURE__*/React.forwardRef(function GoogleMap(_ref, ref) {
|
|
|
548
559
|
ref: ref
|
|
549
560
|
}, containerProps), renderers[_status] || null);
|
|
550
561
|
});
|
|
551
|
-
GoogleMap.defaultProps = _extends({}, MapComponent.defaultProps, {
|
|
552
|
-
loadingContent: 'Google Maps is loading',
|
|
553
|
-
idleContent: 'Google Maps is on idle',
|
|
554
|
-
errorContent: 'Google Maps is on error',
|
|
555
|
-
mapMinHeight: 'unset',
|
|
556
|
-
apiKey: '',
|
|
557
|
-
libraries: ['places', 'geometry'],
|
|
558
|
-
loadScriptExternally: false,
|
|
559
|
-
status: 'idle',
|
|
560
|
-
scriptCallback: function scriptCallback() {}
|
|
561
|
-
});
|
|
562
562
|
GoogleMap.propTypes = _extends({}, MapComponent.propTypes, {
|
|
563
563
|
children: propTypes.oneOfType([propTypes.node, propTypes.arrayOf(propTypes.node)]),
|
|
564
564
|
loadingContent: propTypes.node,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/hooks/useScript.js","../src/hooks/useGoogleMaps.js","../src/utils/utils.js","../src/hooks/useMemoCompare.js","../src/map/overlay.js","../src/map/overlay-view.js","../src/map/markers.js","../src/map/map.js","../src/google-map.js"],"sourcesContent":["/* eslint-disable no-unused-expressions */\nimport { useEffect, useState } from 'react'\n\n/**\n * @description Hook to load external script.\n * @param {Object} script - Script to load.\n * @param {string} script.src - Script source.\n * @param {Object} [script.attributes] - Attributes to add to the script tag.\n * @param {Object} [script.callbacks] - Callbacks executed on completion.\n * @param {Function} [script.callbacks.onLoadCallback] - Callback executed on completion in case of success.\n * @param {Function} [script.callbacks.onErrorCallback] - Callbacks executed on completion in case of error.\n * @param {string} [script.elementIdToAppend] - HTML element id to append the script to. Default is HTML HEAD.\n * @returns {\"idle\" | \"loading\" | \"ready\" | \"error\"} status\n *\n * @example\n * const status = useScript({\n * \t\tsrc: \"https://script-to-load.js\",\n * \t\tattributes: { id: \"scriptId\", class: \"script-class\" },\n * \t\tcallbacks: {\n * \t\t\tonLoadCallback: onLoadFunc,\n * \t\t\tonErrorCallback: onErrorFunc,\n * \t\t},\n * \t\telementIdToAppend: \"script-container\"\n * })\n */\n\nexport const useScript = (\n\tscript = {\n\t\tsrc: '',\n\t\tattributes: {},\n\t\tcallbacks: { onLoadCallback: null, onErrorCallback: null },\n\t\telementIdToAppend: null,\n\t},\n\tforcedStatus = undefined\n) => {\n\t// Keep track of script status (\"idle\", \"loading\", \"ready\", \"error\")\n\tconst [status, setStatus] = useState(script.src ? 'loading' : 'idle')\n\n\tuseEffect(\n\t\t() => {\n\t\t\tif (forcedStatus) {\n\t\t\t\tsetStatus(forcedStatus)\n\t\t\t\treturn () => {\n\t\t\t\t\t// do nothing\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Allow falsy src value if waiting on other data needed for\n\t\t\t// constructing the script URL passed to this hook.\n\t\t\tif (!script.src) {\n\t\t\t\tsetStatus('idle')\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Fetch existing script element by src\n\t\t\t// It may have been added by another instance of this hook\n\t\t\tlet scriptToAdd = document.querySelector(`script[src=\"${script.src}\"]`)\n\t\t\tif (!scriptToAdd) {\n\t\t\t\t// Create script\n\t\t\t\tscriptToAdd = document.createElement('script')\n\t\t\t\tscriptToAdd.src = script.src\n\t\t\t\tscriptToAdd.async = true\n\t\t\t\tscriptToAdd.setAttribute('data-status', 'loading')\n\t\t\t\t// Add other script attributes, if they exist\n\t\t\t\tscript.attributes && Object.entries(script.attributes).length > 0\n\t\t\t\t\t? Object.entries(script.attributes).map(([key, value]) => scriptToAdd.setAttribute(key, value))\n\t\t\t\t\t: null\n\t\t\t\t// Add script to document body\n\t\t\t\tif (script.elementIdToAppend && document.getElementById(script.elementIdToAppend)) {\n\t\t\t\t\tdocument.getElementById(script.elementIdToAppend).appendChild(scriptToAdd)\n\t\t\t\t} else {\n\t\t\t\t\tdocument.body.appendChild(scriptToAdd)\n\t\t\t\t}\n\t\t\t\t// Store status in attribute on script\n\t\t\t\t// This can be read by other instances of this hook\n\t\t\t\tconst setAttributeFromEvent = (event) => {\n\t\t\t\t\tscriptToAdd.setAttribute('data-status', event.type === 'load' ? 'ready' : 'error')\n\t\t\t\t}\n\t\t\t\tscriptToAdd.addEventListener('load', setAttributeFromEvent)\n\t\t\t\tscriptToAdd.addEventListener('error', setAttributeFromEvent)\n\t\t\t} else {\n\t\t\t\t// Grab existing script status from attribute and set to state.\n\t\t\t\tconst currentScriptStatus = scriptToAdd.getAttribute('data-status')\n\t\t\t\tswitch (currentScriptStatus) {\n\t\t\t\t\tcase 'load':\n\t\t\t\t\tcase 'ready':\n\t\t\t\t\t\tscript.callbacks?.onLoadCallback ? script.callbacks.onLoadCallback() : null\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\tscript.callbacks?.onErrorCallback ? script.callbacks.onErrorCallback() : null\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// loading: do nothing\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tsetStatus(currentScriptStatus)\n\t\t\t}\n\t\t\t// Script event handler to update status in state\n\t\t\t// Note: Even if the script already exists we still need to add\n\t\t\t// event handlers to update the state for this hook instance.\n\t\t\tconst setStateFromEvent = (event) => {\n\t\t\t\tevent.type === 'load'\n\t\t\t\t\t? script.callbacks?.onLoadCallback\n\t\t\t\t\t\t? script.callbacks.onLoadCallback()\n\t\t\t\t\t\t: null\n\t\t\t\t\t: script.callbacks?.onErrorCallback\n\t\t\t\t\t? script.callbacks.onErrorCallback()\n\t\t\t\t\t: null\n\t\t\t\tsetStatus(event.type === 'load' ? 'ready' : 'error')\n\t\t\t}\n\t\t\t// Add event listeners\n\t\t\tscriptToAdd.addEventListener('load', setStateFromEvent)\n\t\t\tscriptToAdd.addEventListener('error', setStateFromEvent)\n\t\t\t// Remove event listeners on cleanup\n\t\t\treturn () => {\n\t\t\t\tif (scriptToAdd) {\n\t\t\t\t\tscriptToAdd.removeEventListener('load', setStateFromEvent)\n\t\t\t\t\tscriptToAdd.removeEventListener('error', setStateFromEvent)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Re-run useEffect if script changes\n\t\t[script, forcedStatus, status]\n\t)\n\n\treturn status\n}\n","import { useScript } from './useScript'\n\n/**\n * @returns {\"idle\" | \"loading\" | \"ready\" | \"error\"} status\n */\nexport const useGoogleMaps = ({\n\tapiKey,\n\tlibraries = [],\n\tloadScriptExternally = false,\n\tstatus = 'idle',\n\texternalApiParams,\n\tcallback,\n}) => {\n\t// eslint-disable-next-line no-undef\n\tif (typeof window !== 'undefined') window.googleMapsCallback = callback\n\tconst apiParams = new URLSearchParams(externalApiParams)?.toString()\n\tconst script = apiKey\n\t\t? {\n\t\t\t\tsrc: `https://maps.googleapis.com/maps/api/js?key=${apiKey}&callback=googleMapsCallback&libraries=${libraries?.join(\n\t\t\t\t\t','\n\t\t\t\t)}${apiParams ? '&' + apiParams : ''}`,\n\t\t\t\tattributes: { id: 'googleMapsApi' },\n\t\t }\n\t\t: {\n\t\t\t\tsrc: `https://maps.googleapis.com/maps/api/js?callback=googleMapsCallback&libraries=${libraries?.join(',')}`,\n\t\t\t\tattributes: { id: 'googleMapsApi' },\n\t\t }\n\n\treturn useScript(script, loadScriptExternally ? status : undefined)\n}\n","export const isArraysEqualEps = (arrayA, arrayB, eps) => {\n\tif (arrayA && arrayB) {\n\t\tfor (let i = 0; i !== arrayA.length; ++i) {\n\t\t\tif (Math.abs(arrayA[i] - arrayB[i]) > eps) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n","import { useEffect, useRef } from 'react'\n\n/**\n * A hook that compares the previous and current values of a reference.\n * @param {any} value - the current value of the reference\n * @param {function} compare - a function that compares the previous and current values\n * @returns {any} the previous value of the reference\n * @ref https://usehooks.com/useMemoCompare/\n */\nconst useMemoCompare = (next, compare) => {\n\t// Ref for storing previous value\n\tconst previousRef = useRef()\n\tconst previous = previousRef.current\n\t// Pass previous and next value to compare function\n\t// to determine whether to consider them equal.\n\tconst isEqual = compare(previous, next)\n\t// If not equal update previousRef to next value.\n\t// We only update if not equal so that this hook continues to return\n\t// the same old value if compare keeps returning true.\n\tuseEffect(() => {\n\t\tif (!isEqual) {\n\t\t\tpreviousRef.current = next\n\t\t}\n\t})\n\t// Finally, if equal then return the previous value\n\treturn isEqual ? previous : next\n}\n\nexport default useMemoCompare\n","import { bool, element, func, number, object, shape, string } from 'prop-types'\n\n// return lat, lng from LatLngLiteral\nconst getLatLng = (LatLng) => {\n\ttry {\n\t\tconst latLng = { lat: LatLng.lat(), lng: LatLng.lng() }\n\t\treturn latLng\n\t} catch (e) {\n\t\treturn LatLng\n\t}\n}\n\n/**\n * @param {HTMLElement} container - The HTML container element for the overlay.\n * @param {google.maps.MapPanes} pane - The HTML container element for the overlay.\n * @param {google.maps.LatLng | google.maps.LatLngLiteral} position - The geographical location of the overlay.\n * @param {google.maps} maps - The Google Maps API.\n * @param {object} drag - The drag configuration of the overlay.\n * @param {boolean} drag.draggable - If true, the marker can be dragged. Default value is false.\n * @param {function} drag.onDragStart - This event is fired when the user starts dragging the marker.\n * @param {function} drag.onDrag - This event is repeatedly fired while the user drags the marker.\n * @param {function} drag.onDragEnd - This event is fired when the user stops dragging the marker.\n * @returns {void}\n */\nconst createOverlay = ({ container, pane, position, maps, drag }) => {\n\tclass Overlay extends maps.OverlayView {\n\t\tconstructor(container, pane, position) {\n\t\t\tsuper()\n\t\t\tthis.container = container\n\t\t\tthis.pane = pane\n\t\t\tthis.position = position\n\t\t}\n\n\t\t/**\n\t\t * onAdd is called when the map's panes are ready and the overlay has been\n\t\t * added to the map.\n\t\t */\n\t\tonAdd = () => {\n\t\t\tlet that = this\n\t\t\t// manage draggable\n\t\t\tif (drag?.draggable) {\n\t\t\t\tmaps.event.addDomListener(this.get('map').getDiv(), 'mouseleave', () => {\n\t\t\t\t\tmaps.event.trigger(container, 'mouseup')\n\t\t\t\t})\n\t\t\t\tmaps.event.addDomListener(this.container, 'mousedown', (e) => {\n\t\t\t\t\tthis.container.style.cursor = 'grabbing'\n\t\t\t\t\tthat.map.set('draggable', false)\n\t\t\t\t\tthat.set('origin', e)\n\n\t\t\t\t\tdrag.onDragStart(e, { latLng: getLatLng(this.position) })\n\n\t\t\t\t\tthat.moveHandler = maps.event.addDomListener(this.get('map').getDiv(), 'mousemove', (e) => {\n\t\t\t\t\t\tlet origin = that.get('origin'),\n\t\t\t\t\t\t\tleft = origin.clientX - e.clientX,\n\t\t\t\t\t\t\ttop = origin.clientY - e.clientY,\n\t\t\t\t\t\t\tpos = that.getProjection().fromLatLngToDivPixel(that.position),\n\t\t\t\t\t\t\tlatLng = that.getProjection().fromDivPixelToLatLng(new maps.Point(pos.x - left, pos.y - top))\n\t\t\t\t\t\tthat.set('position', latLng)\n\t\t\t\t\t\tthat.set('origin', e)\n\t\t\t\t\t\tthat.draw()\n\t\t\t\t\t\tdrag.onDrag(e, { latLng: getLatLng(latLng) })\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tmaps.event.addDomListener(container, 'mouseup', (e) => {\n\t\t\t\t\tthat.map.set('draggable', true)\n\t\t\t\t\tthis.container.style.cursor = 'default'\n\t\t\t\t\tmaps.event.removeListener(that.moveHandler)\n\t\t\t\t\tdrag.onDragEnd(e, { latLng: getLatLng(that.position) })\n\t\t\t\t})\n\t\t\t}\n\t\t\t// Add the element to the pane.\n\t\t\tconst pane = this.getPanes()[this.pane]\n\t\t\tpane?.classList.add('google-map-markers-overlay')\n\t\t\tpane?.appendChild(this.container)\n\t\t}\n\n\t\tdraw = () => {\n\t\t\tconst projection = this.getProjection()\n\t\t\t// Computes the pixel coordinates of the given geographical location in the DOM element that holds the draggable map.\n\t\t\tconst point = projection.fromLatLngToDivPixel(this.position)\n\t\t\tif (point === null) return\n\t\t\tthis.container.style.transform = `translate(${point.x}px, ${point.y}px)`\n\t\t}\n\n\t\t/**\n\t\t * The onRemove() method will be called automatically from the API if\n\t\t * we ever set the overlay's map property to 'null'.\n\t\t */\n\t\tonRemove = () => {\n\t\t\tif (this.container.parentNode !== null) {\n\t\t\t\t// remove DOM listeners\n\t\t\t\tmaps.event.clearInstanceListeners(this.container)\n\t\t\t\tthis.container.parentNode.removeChild(this.container)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn new Overlay(container, pane, position)\n}\n\ncreateOverlay.propTypes = {\n\t/**\n\t * The HTML container element for the overlay.\n\t */\n\tcontainer: element.isRequired,\n\t/**\n\t * The HTML container element for the overlay.\n\t * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n\t * @default 'floatPane'\n\t * @type {google.maps.MapPanes}\n\t * @required\n\t */\n\tpane: string.isRequired,\n\t/**\n\t * The geographical location of the overlay.\n\t * @type {google.maps.LatLng | google.maps.LatLngLiteral}\n\t * @required\n\t * @ref [LatLng](https://developers.google.com/maps/documentation/javascript/reference/coordinates#LatLng)\n\t */\n\tposition: shape({\n\t\tlat: number.isRequired,\n\t\tlng: number.isRequired,\n\t}).isRequired,\n\t/**\n\t * The Google Maps API.\n\t */\n\tmaps: object.isRequired,\n\t/**\n\t * The draggable options of the overlay.\n\t * @type {object}\n\t * @default { draggable: false, onDragStart: noop, onDrag: noop, onDragEnd: noop }\n\t */\n\tdrag: shape({\n\t\tdraggable: bool,\n\t\tonDragStart: func,\n\t\tonDrag: func,\n\t\tonDragEnd: func,\n\t}),\n}\n\nexport default createOverlay\n","import { bool, func, node, number, object, shape, string } from 'prop-types'\nimport { useEffect, useMemo } from 'react'\nimport { createPortal } from 'react-dom'\nimport useMemoCompare from '../hooks/useMemoCompare'\nimport createOverlay from './overlay'\n\nconst noop = () => {}\n\n/**\n * @param {google.maps.MapPanes} pane - The pane on which to display the overlay. This is the Pane name, not the Pane itself. Defaults to floatPane.\n * @param {google.maps.LatLng | google.maps.LatLngLiteral} position - The geographical location of the overlay.\n * @param {google.maps.Map} map - The map on which to display the overlay.\n * @param {google.maps} maps - The Google Maps API.\n * @param {number} zIndex - The z-index of the overlay.\n * @param {ReactNode} children - The children of the OverlayView - the Marker component.\n * @param {object} drag - The drag configuration of the overlay.\n * @param {boolean} drag.draggable - If true, the marker can be dragged. Default value is false.\n * @param {function} drag.onDragStart - This event is fired when the user starts dragging the marker.\n * @param {function} drag.onDrag - This event is repeatedly fired while the user drags the marker.\n * @param {function} drag.onDragEnd - This event is fired when the user stops dragging the marker.\n * @returns {void}\n * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n */\nconst OverlayView = ({ pane, position, map, maps, zIndex, children, drag }) => {\n\tconst container = useMemo(() => {\n\t\t// eslint-disable-next-line no-undef\n\t\tconst div = document.createElement('div')\n\t\tdiv.style.position = 'absolute'\n\t\treturn div\n\t}, [])\n\n\tconst overlay = useMemo(() => {\n\t\treturn createOverlay({ container, pane, position, maps, drag })\n\t}, [container, maps, pane, position])\n\n\t// Because React does not do deep comparisons, a custom hook is used.\n\t// This fixes the issue where the overlay is not updated when the position changes.\n\tconst childrenProps = useMemoCompare(children?.props, (prev, next) => {\n\t\treturn prev && prev.lat === next.lat && prev.lng === next.lng\n\t})\n\n\tuseEffect(() => {\n\t\tif (!overlay.map) {\n\t\t\toverlay?.setMap(map)\n\t\t\treturn () => {\n\t\t\t\toverlay?.setMap(null)\n\t\t\t}\n\t\t}\n\t\t// overlay depends on map, so we don't need to add it to the dependency array\n\t\t// otherwise, it will re-render the overlay every time the map changes\n\t\t//? added childrenProps to the dependency array to re-render the overlay when the children props change.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [map, childrenProps])\n\n\t// to move the container to the foreground and background\n\tuseEffect(() => {\n\t\tcontainer.style.zIndex = `${zIndex}`\n\t}, [zIndex, container])\n\n\treturn createPortal(children, container)\n}\n\nOverlayView.defaultProps = {\n\tpane: 'floatPane',\n\tzIndex: 0,\n}\n\nOverlayView.propTypes = {\n\t/**\n\t * The HTML container element for the overlay.\n\t * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n\t * @default 'floatPane'\n\t * @type {google.maps.MapPanes}\n\t */\n\tpane: string,\n\t/**\n\t * The geographical location of the overlay.\n\t * @type {google.maps.LatLng | google.maps.LatLngLiteral}\n\t * @required\n\t * @ref [LatLng](https://developers.google.com/maps/documentation/javascript/reference/coordinates#LatLng)\n\t */\n\tposition: shape({\n\t\tlat: number.isRequired,\n\t\tlng: number.isRequired,\n\t}).isRequired,\n\t/**\n\t * The map on which to display the overlay.\n\t * @type {google.maps.Map}\n\t * @required\n\t * @ref [Map](https://developers.google.com/maps/documentation/javascript/reference/map#Map)\n\t */\n\tmap: object.isRequired,\n\t/**\n\t * The Google Maps API.\n\t * @type {object}\n\t * @required\n\t * @ref [Google Maps API](https://developers.google.com/maps/documentation/javascript/reference)\n\t */\n\tmaps: object.isRequired,\n\t/**\n\t * The z-index of the overlay.\n\t * @type {number}\n\t * @default 0\n\t */\n\tzIndex: number,\n\t/**\n\t * The children of the OverlayView.\n\t * @type {ReactNode}\n\t * @required\n\t * @ref [ReactNode](https://reactjs.org/docs/react-api.html#reactnode)\n\t */\n\tchildren: node.isRequired,\n\t/**\n\t * The drag configuration of the overlay.\n\t * @type {object}\n\t * @default { draggable: false, onDragStart: noop, onDrag: noop, onDragEnd: noop }\n\t */\n\tdrag: shape({\n\t\tdraggable: bool,\n\t\tonDragStart: func,\n\t\tonDrag: func,\n\t\tonDragEnd: func,\n\t}),\n}\n\nexport default OverlayView\n","import { node, object } from 'prop-types'\nimport React, { Children, cloneElement, isValidElement, useMemo } from 'react'\nimport OverlayView from './overlay-view'\n\nconst noop = () => {}\n\nconst MapMarkers = ({ children, map, maps }) => {\n\tconst markers = useMemo(() => {\n\t\tif (!map || !maps) return []\n\n\t\treturn Children.map(children, (child) => {\n\t\t\tif (isValidElement(child)) {\n\t\t\t\tconst latLng = { lat: child.props.lat, lng: child.props.lng }\n\t\t\t\tconst { zIndex, draggable = false, onDragStart = noop, onDrag = noop, onDragEnd = noop } = child.props || {}\n\n\t\t\t\t// clone child without draggable props\n\t\t\t\tchild = cloneElement(child, {\n\t\t\t\t\t...child.props,\n\t\t\t\t\tdraggable: undefined,\n\t\t\t\t\tonDragStart: undefined,\n\t\t\t\t\tonDrag: undefined,\n\t\t\t\t\tonDragEnd: undefined,\n\t\t\t\t})\n\n\t\t\t\treturn (\n\t\t\t\t\t<OverlayView\n\t\t\t\t\t\tposition={latLng}\n\t\t\t\t\t\tmap={map}\n\t\t\t\t\t\tmaps={maps}\n\t\t\t\t\t\tzIndex={zIndex}\n\t\t\t\t\t\tdrag={{\n\t\t\t\t\t\t\tdraggable,\n\t\t\t\t\t\t\tonDragStart,\n\t\t\t\t\t\t\tonDrag,\n\t\t\t\t\t\t\tonDragEnd,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{child}\n\t\t\t\t\t</OverlayView>\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t}, [children, map, maps])\n\n\treturn <div>{markers}</div>\n}\n\nMapMarkers.propTypes = {\n\t/**\n\t * The Markers on the Map.\n\t * @type {ReactNode}\n\t * @required\n\t */\n\tchildren: node.isRequired,\n\t/**\n\t * The Google Maps instance.\n\t * @type {object}\n\t * @required\n\t */\n\tmap: object,\n\t/**\n\t * The Google Maps API.\n\t * @type {object}\n\t * @required\n\t */\n\tmaps: object.isRequired,\n}\n\nexport default MapMarkers\n","import { arrayOf, func, node, number, object, oneOfType, shape, string } from 'prop-types'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { isArraysEqualEps } from '../utils/utils'\nimport MapMarkers from './markers'\n\nconst EPS = 0.00001\n\nconst MapComponent = ({\n\tchildren,\n\tstyle,\n\tdefaultCenter,\n\tdefaultZoom,\n\tonGoogleApiLoaded,\n\tonChange,\n\toptions,\n\tevents,\n}) => {\n\tconst mapRef = useRef(null)\n\tconst prevBoundsRef = useRef(null)\n\tconst [map, setMap] = useState(null)\n\tconst [maps, setMaps] = useState(null)\n\tconst [googleApiCalled, setGoogleApiCalled] = useState(false)\n\n\tconst onIdle = useCallback(() => {\n\t\ttry {\n\t\t\tconst zoom = map.getZoom()\n\t\t\tconst bounds = map.getBounds()\n\t\t\tconst centerLatLng = map.getCenter()\n\n\t\t\tconst ne = bounds.getNorthEast()\n\t\t\tconst sw = bounds.getSouthWest()\n\t\t\tconst boundsArray = [sw.lng(), sw.lat(), ne.lng(), ne.lat()]\n\n\t\t\tif (!isArraysEqualEps(boundsArray, prevBoundsRef.current, EPS)) {\n\t\t\t\tif (onChange) {\n\t\t\t\t\tonChange({\n\t\t\t\t\t\tzoom,\n\t\t\t\t\t\tcenter: [centerLatLng.lng(), centerLatLng.lat()],\n\t\t\t\t\t\tbounds,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tprevBoundsRef.current = boundsArray\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}, [map, onChange])\n\n\tuseEffect(() => {\n\t\tif (mapRef.current && !map) {\n\t\t\tsetMap(\n\t\t\t\tnew window.google.maps.Map(mapRef.current, {\n\t\t\t\t\tcenter: defaultCenter,\n\t\t\t\t\tzoom: defaultZoom,\n\t\t\t\t\t...options,\n\t\t\t\t})\n\t\t\t)\n\t\t\tsetMaps(window.google.maps)\n\t\t}\n\t}, [defaultCenter, defaultZoom, map, mapRef, options])\n\n\tuseEffect(() => {\n\t\tif (map) {\n\t\t\tif (!googleApiCalled) {\n\t\t\t\tonGoogleApiLoaded({ map, maps, ref: mapRef.current })\n\t\t\t\tsetGoogleApiCalled(true)\n\t\t\t}\n\n\t\t\twindow.google.maps.event.clearListeners(map, 'idle')\n\t\t\t// Idle event is fired when the map becomes idle after panning or zooming.\n\t\t\twindow.google.maps.event.addListener(map, 'idle', onIdle)\n\t\t}\n\t}, [googleApiCalled, map, maps, onChange, onGoogleApiLoaded, onIdle])\n\n\tuseEffect(() => {\n\t\t// clear listeners on unmount\n\t\treturn () => {\n\t\t\tif (map) {\n\t\t\t\twindow.google.maps.event.clearListeners(map, 'idle')\n\t\t\t}\n\t\t}\n\t}, [map])\n\n\treturn (\n\t\t<React.Fragment>\n\t\t\t<div\n\t\t\t\tref={mapRef}\n\t\t\t\tstyle={style}\n\t\t\t\tclassName=\"google-map\"\n\t\t\t\t// spread the events as props\n\t\t\t\t{...events?.reduce((acc, { name, handler } = {}) => {\n\t\t\t\t\tacc[name] = handler\n\t\t\t\t\treturn acc\n\t\t\t\t}, {})}\n\t\t\t/>\n\t\t\t{children && map && maps && (\n\t\t\t\t<MapMarkers map={map} maps={maps}>\n\t\t\t\t\t{children}\n\t\t\t\t</MapMarkers>\n\t\t\t)}\n\t\t</React.Fragment>\n\t)\n}\n\nMapComponent.defaultProps = {\n\tstyle: {\n\t\twidth: '100%',\n\t\theight: '100%',\n\t\tleft: 0,\n\t\ttop: 0,\n\t\tmargin: 0,\n\t\tpadding: 0,\n\t\tposition: 'absolute',\n\t},\n\tonGoogleApiLoaded: () => {},\n\tonChange: () => {},\n\toptions: {},\n\tevents: [],\n}\n\nMapComponent.propTypes = {\n\t/**\n\t * The Markers on the Map.\n\t */\n\tchildren: oneOfType([arrayOf(node), node]),\n\tstyle: object,\n\tdefaultCenter: object.isRequired,\n\tdefaultZoom: number.isRequired,\n\tonGoogleApiLoaded: func,\n\tonChange: func,\n\toptions: object,\n\t/**\n\t * The events to pass to the Google Maps instance (`div`).\n\t * @type {Array}\n\t * @example\n\t * [\n\t * {\n\t * name: 'onClick',\n\t * handler: (event) => { ... }\n\t * }\n\t * ]\n\t */\n\tevents: arrayOf(\n\t\tshape({\n\t\t\tname: string.isRequired,\n\t\t\thandler: func.isRequired,\n\t\t})\n\t),\n}\n\nexport default MapComponent\n","import { arrayOf, bool, func, node, number, object, oneOf, oneOfType, string } from 'prop-types'\nimport React, { forwardRef } from 'react'\nimport { useGoogleMaps } from './hooks/useGoogleMaps'\nimport MapComponent from './map/map'\n\nconst GoogleMap = forwardRef(function GoogleMap(\n\t{\n\t\tapiKey,\n\t\tlibraries,\n\t\tchildren,\n\t\tloadingContent,\n\t\tidleContent,\n\t\terrorContent,\n\t\tmapMinHeight,\n\t\tcontainerProps,\n\t\tloadScriptExternally,\n\t\tstatus,\n\t\tscriptCallback,\n\t\texternalApiParams,\n\t\t...props\n\t},\n\tref\n) {\n\tconst renderers = {\n\t\tready: <MapComponent {...props}>{children}</MapComponent>,\n\t\tloading: loadingContent,\n\t\tidle: idleContent,\n\t\terror: errorContent,\n\t}\n\n\tconst _status = useGoogleMaps({\n\t\tapiKey,\n\t\tlibraries,\n\t\tloadScriptExternally,\n\t\tstatus,\n\t\texternalApiParams,\n\t\tcallback: scriptCallback,\n\t})\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{ height: '100%', width: '100%', overflow: 'hidden', position: 'relative', minHeight: mapMinHeight }}\n\t\t\tref={ref}\n\t\t\t{...containerProps}\n\t\t>\n\t\t\t{renderers[_status] || null}\n\t\t</div>\n\t)\n})\n\nGoogleMap.defaultProps = {\n\t...MapComponent.defaultProps,\n\tloadingContent: 'Google Maps is loading',\n\tidleContent: 'Google Maps is on idle',\n\terrorContent: 'Google Maps is on error',\n\tmapMinHeight: 'unset',\n\tapiKey: '',\n\tlibraries: ['places', 'geometry'],\n\tloadScriptExternally: false,\n\tstatus: 'idle',\n\tscriptCallback: () => {},\n}\n\nGoogleMap.propTypes = {\n\t...MapComponent.propTypes,\n\t/**\n\t * The Markers on the Map.\n\t */\n\tchildren: oneOfType([node, arrayOf(node)]),\n\t/**\n\t * Content to be displayed while the map is loading.\n\t */\n\tloadingContent: node,\n\t/**\n\t * Content to be displayed while the map is idle.\n\t */\n\tidleContent: node,\n\t/**\n\t * Content to be displayed when there is an error loading the map.\n\t */\n\terrorContent: node,\n\t/**\n\t * The minimum height of the map.\n\t */\n\tmapMinHeight: oneOfType([number, string]),\n\t/**\n\t * Props to be passed to the container div.\n\t */\n\tcontainerProps: object,\n\t/**\n\t * Whether to load the Google Maps script externally.\n\t * If true, the status prop will be used to control the loading of the script.\n\t * If false, the script will be loaded automatically.\n\t * @default false\n\t */\n\tloadScriptExternally: bool,\n\t/**\n\t * The forced status of the Google Maps script.\n\t * @default 'idle'\n\t */\n\tstatus: oneOf(['idle', 'loading', 'ready', 'error']),\n\t/**\n\t * The callback function to pass to the Google Maps script.\n\t * @default () => {}\n\t */\n\tscriptCallback: func,\n\t/**\n\t * Prop to be passed on to google map api while loading the script such as region & language\n\t * e.g. {region: 'JP', language: 'ja'} can be used to localize map in japanese\n\t */\n\texternalApiParams: object,\n}\n\nexport default GoogleMap\n"],"names":["useScript","script","forcedStatus","src","attributes","callbacks","onLoadCallback","onErrorCallback","elementIdToAppend","undefined","_useState","useState","status","setStatus","useEffect","_script$callbacks","_script$callbacks2","scriptToAdd","document","querySelector","createElement","async","setAttribute","Object","entries","length","map","_ref","key","value","getElementById","appendChild","body","setAttributeFromEvent","event","type","addEventListener","currentScriptStatus","getAttribute","setStateFromEvent","_script$callbacks3","_script$callbacks4","removeEventListener","useGoogleMaps","_URLSearchParams","apiKey","_ref$libraries","libraries","_ref$loadScriptExtern","loadScriptExternally","_ref$status","externalApiParams","callback","window","googleMapsCallback","apiParams","URLSearchParams","toString","join","id","isArraysEqualEps","arrayA","arrayB","eps","i","Math","abs","useMemoCompare","next","compare","previousRef","useRef","previous","current","isEqual","getLatLng","LatLng","latLng","lat","lng","e","createOverlay","container","pane","position","maps","drag","Overlay","_maps$OverlayView","_inheritsLoose","_this","call","onAdd","that","_assertThisInitialized","draggable","addDomListener","get","getDiv","trigger","style","cursor","set","onDragStart","moveHandler","origin","left","clientX","top","clientY","pos","getProjection","fromLatLngToDivPixel","fromDivPixelToLatLng","Point","x","y","draw","onDrag","removeListener","onDragEnd","getPanes","classList","add","projection","point","transform","onRemove","parentNode","clearInstanceListeners","removeChild","OverlayView","propTypes","element","isRequired","string","shape","number","object","bool","func","zIndex","children","useMemo","div","overlay","childrenProps","props","prev","setMap","createPortal","defaultProps","node","noop","MapMarkers","markers","Children","child","isValidElement","_ref2","_ref2$draggable","_ref2$onDragStart","_ref2$onDrag","_ref2$onDragEnd","cloneElement","_extends","React","EPS","MapComponent","defaultCenter","defaultZoom","onGoogleApiLoaded","onChange","options","events","mapRef","prevBoundsRef","_useState2","setMaps","_useState3","googleApiCalled","setGoogleApiCalled","onIdle","useCallback","zoom","getZoom","bounds","getBounds","centerLatLng","getCenter","ne","getNorthEast","sw","getSouthWest","boundsArray","center","console","error","google","Map","ref","clearListeners","addListener","Fragment","className","reduce","acc","_temp","name","handler","width","height","margin","padding","oneOfType","arrayOf","GoogleMap","forwardRef","loadingContent","idleContent","errorContent","mapMinHeight","containerProps","scriptCallback","_objectWithoutPropertiesLoose","_excluded","renderers","ready","loading","idle","_status","overflow","minHeight","oneOf"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,IAAMA,SAAS,GAAG,SAAZA,SAASA,CACrBC,MAAM,EAMNC,YAAY,EACR;EAAA,IAPJD,MAAM;IAANA,MAAM,GAAG;MACRE,GAAG,EAAE,EAAE;MACPC,UAAU,EAAE,EAAE;MACdC,SAAS,EAAE;QAAEC,cAAc,EAAE,IAAI;QAAEC,eAAe,EAAE;OAAM;MAC1DC,iBAAiB,EAAE;KACnB;;EAAA,IACDN,YAA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IAAI,IACnB,CAAC;AAER,CAAC,CAAC;AAEFd,SAAS,CAACjE,YAAY,GAAAc,QAAA,KAClBG,YAAY,CAACjB,YAAY;EAC5BmE,cAAc,EAAE,wBAAwB;EACxCC,WAAW,EAAE,wBAAwB;EACrCC,YAAY,EAAE,yBAAyB;EACvCC,YAAY,EAAE,OAAO;EACrBhL,MAAM,EAAE,EAAE;EACVE,SAAS,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;EACjCE,oBAAoB,EAAE,KAAK;EAC3BrC,MAAM,EAAE,MAAM;EACdmN,cAAc,EAAE,SAAAA,iBAAM;AAAE,EACxB;AAEDP,SAAS,CAACpF,SAAS,GAAAiC,QAAA,KACfG,YAAY,CAACpC,SAAS;EAIzBU,QAAQ,EAAEwE,mBAAS,CAAC,CAAC9D,cAAI,EAAE+D,iBAAO,CAAC/D,cAAI,CAAC,CAAC,CAAC;EAI1CkE,cAAc,EAAElE,cAAI;EAIpBmE,WAAW,EAAEnE,cAAI;EAIjBoE,YAAY,EAAEpE,cAAI;EAIlBqE,YAAY,EAAEP,mBAAS,CAAC,CAAC7E,gBAAM,EAAEF,gBAAM,CAAC,CAAC;EAIzCuF,cAAc,EAAEpF,gBAAM;EAOtBzF,oBAAoB,EAAE0F,cAAI;EAK1B/H,MAAM,EAAE6N,eAAK,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;EAKpDV,cAAc,EAAEnF,cAAI;EAKpBzF,iBAAiB,EAAEuF;AAAM,EACzB;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/hooks/useScript.js","../src/hooks/useGoogleMaps.js","../src/utils/utils.js","../src/hooks/useMemoCompare.js","../src/map/overlay.js","../src/map/overlay-view.js","../src/map/markers.js","../src/map/map.js","../src/google-map.js"],"sourcesContent":["/* eslint-disable no-unused-expressions */\nimport { useEffect, useState } from 'react'\n\n/**\n * @description Hook to load external script.\n * @param {Object} script - Script to load.\n * @param {string} script.src - Script source.\n * @param {Object} [script.attributes] - Attributes to add to the script tag.\n * @param {Object} [script.callbacks] - Callbacks executed on completion.\n * @param {Function} [script.callbacks.onLoadCallback] - Callback executed on completion in case of success.\n * @param {Function} [script.callbacks.onErrorCallback] - Callbacks executed on completion in case of error.\n * @param {string} [script.elementIdToAppend] - HTML element id to append the script to. Default is HTML HEAD.\n * @returns {\"idle\" | \"loading\" | \"ready\" | \"error\"} status\n *\n * @example\n * const status = useScript({\n * \t\tsrc: \"https://script-to-load.js\",\n * \t\tattributes: { id: \"scriptId\", class: \"script-class\" },\n * \t\tcallbacks: {\n * \t\t\tonLoadCallback: onLoadFunc,\n * \t\t\tonErrorCallback: onErrorFunc,\n * \t\t},\n * \t\telementIdToAppend: \"script-container\"\n * })\n */\n\nexport const useScript = (\n\tscript = {\n\t\tsrc: '',\n\t\tattributes: {},\n\t\tcallbacks: { onLoadCallback: null, onErrorCallback: null },\n\t\telementIdToAppend: null,\n\t},\n\tforcedStatus = undefined,\n) => {\n\t// Keep track of script status (\"idle\", \"loading\", \"ready\", \"error\")\n\tconst [status, setStatus] = useState(script.src ? 'loading' : 'idle')\n\n\tuseEffect(\n\t\t() => {\n\t\t\tif (forcedStatus) {\n\t\t\t\tsetStatus(forcedStatus)\n\t\t\t\treturn () => {\n\t\t\t\t\t// do nothing\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Allow falsy src value if waiting on other data needed for\n\t\t\t// constructing the script URL passed to this hook.\n\t\t\tif (!script.src) {\n\t\t\t\tsetStatus('idle')\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Fetch existing script element by src\n\t\t\t// It may have been added by another instance of this hook\n\t\t\tlet scriptToAdd = document.querySelector(`script[src=\"${script.src}\"]`)\n\t\t\tif (!scriptToAdd) {\n\t\t\t\t// Create script\n\t\t\t\tscriptToAdd = document.createElement('script')\n\t\t\t\tscriptToAdd.src = script.src\n\t\t\t\tscriptToAdd.async = true\n\t\t\t\tscriptToAdd.setAttribute('data-status', 'loading')\n\t\t\t\t// Add other script attributes, if they exist\n\t\t\t\tscript.attributes && Object.entries(script.attributes).length > 0\n\t\t\t\t\t? Object.entries(script.attributes).map(([key, value]) => scriptToAdd.setAttribute(key, value))\n\t\t\t\t\t: null\n\t\t\t\t// Add script to document body\n\t\t\t\tif (script.elementIdToAppend && document.getElementById(script.elementIdToAppend)) {\n\t\t\t\t\tdocument.getElementById(script.elementIdToAppend).appendChild(scriptToAdd)\n\t\t\t\t} else {\n\t\t\t\t\tdocument.body.appendChild(scriptToAdd)\n\t\t\t\t}\n\t\t\t\t// Store status in attribute on script\n\t\t\t\t// This can be read by other instances of this hook\n\t\t\t\tconst setAttributeFromEvent = (event) => {\n\t\t\t\t\tscriptToAdd.setAttribute('data-status', event.type === 'load' ? 'ready' : 'error')\n\t\t\t\t}\n\t\t\t\tscriptToAdd.addEventListener('load', setAttributeFromEvent)\n\t\t\t\tscriptToAdd.addEventListener('error', setAttributeFromEvent)\n\t\t\t} else {\n\t\t\t\t// Grab existing script status from attribute and set to state.\n\t\t\t\tconst currentScriptStatus = scriptToAdd.getAttribute('data-status')\n\t\t\t\tswitch (currentScriptStatus) {\n\t\t\t\t\tcase 'load':\n\t\t\t\t\tcase 'ready':\n\t\t\t\t\t\tscript.callbacks?.onLoadCallback ? script.callbacks.onLoadCallback() : null\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\tscript.callbacks?.onErrorCallback ? script.callbacks.onErrorCallback() : null\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// loading: do nothing\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tsetStatus(currentScriptStatus)\n\t\t\t}\n\t\t\t// Script event handler to update status in state\n\t\t\t// Note: Even if the script already exists we still need to add\n\t\t\t// event handlers to update the state for this hook instance.\n\t\t\tconst setStateFromEvent = (event) => {\n\t\t\t\tevent.type === 'load'\n\t\t\t\t\t? script.callbacks?.onLoadCallback\n\t\t\t\t\t\t? script.callbacks.onLoadCallback()\n\t\t\t\t\t\t: null\n\t\t\t\t\t: script.callbacks?.onErrorCallback\n\t\t\t\t\t? script.callbacks.onErrorCallback()\n\t\t\t\t\t: null\n\t\t\t\tsetStatus(event.type === 'load' ? 'ready' : 'error')\n\t\t\t}\n\t\t\t// Add event listeners\n\t\t\tscriptToAdd.addEventListener('load', setStateFromEvent)\n\t\t\tscriptToAdd.addEventListener('error', setStateFromEvent)\n\t\t\t// Remove event listeners on cleanup\n\t\t\treturn () => {\n\t\t\t\tif (scriptToAdd) {\n\t\t\t\t\tscriptToAdd.removeEventListener('load', setStateFromEvent)\n\t\t\t\t\tscriptToAdd.removeEventListener('error', setStateFromEvent)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Re-run useEffect if script changes\n\t\t[script, forcedStatus, status],\n\t)\n\n\treturn status\n}\n","import { useScript } from './useScript'\n\n/**\n * @returns {\"idle\" | \"loading\" | \"ready\" | \"error\"} status\n */\nexport const useGoogleMaps = ({\n\tapiKey,\n\tlibraries = [],\n\tloadScriptExternally = false,\n\tstatus = 'idle',\n\texternalApiParams,\n\tcallback,\n}) => {\n\t// eslint-disable-next-line no-undef\n\tif (typeof window !== 'undefined') window.googleMapsCallback = callback\n\tconst apiParams = new URLSearchParams(externalApiParams)?.toString()\n\tconst script = apiKey\n\t\t? {\n\t\t\t\tsrc: `https://maps.googleapis.com/maps/api/js?key=${apiKey}&callback=googleMapsCallback&libraries=${libraries?.join(\n\t\t\t\t\t',',\n\t\t\t\t)}${apiParams ? '&' + apiParams : ''}`,\n\t\t\t\tattributes: { id: 'googleMapsApi' },\n\t\t }\n\t\t: {\n\t\t\t\tsrc: `https://maps.googleapis.com/maps/api/js?callback=googleMapsCallback&libraries=${libraries?.join(',')}`,\n\t\t\t\tattributes: { id: 'googleMapsApi' },\n\t\t }\n\n\treturn useScript(script, loadScriptExternally ? status : undefined)\n}\n","export const isArraysEqualEps = (arrayA, arrayB, eps) => {\n\tif (arrayA && arrayB) {\n\t\tfor (let i = 0; i !== arrayA.length; ++i) {\n\t\t\tif (Math.abs(arrayA[i] - arrayB[i]) > eps) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n","import { useEffect, useRef } from 'react'\n\n/**\n * A hook that compares the previous and current values of a reference.\n * @param {any} value - the current value of the reference\n * @param {function} compare - a function that compares the previous and current values\n * @returns {any} the previous value of the reference\n * @ref https://usehooks.com/useMemoCompare/\n */\nconst useMemoCompare = (next, compare) => {\n\t// Ref for storing previous value\n\tconst previousRef = useRef()\n\tconst previous = previousRef.current\n\t// Pass previous and next value to compare function\n\t// to determine whether to consider them equal.\n\tconst isEqual = compare(previous, next)\n\t// If not equal update previousRef to next value.\n\t// We only update if not equal so that this hook continues to return\n\t// the same old value if compare keeps returning true.\n\tuseEffect(() => {\n\t\tif (!isEqual) {\n\t\t\tpreviousRef.current = next\n\t\t}\n\t})\n\t// Finally, if equal then return the previous value\n\treturn isEqual ? previous : next\n}\n\nexport default useMemoCompare\n","import { bool, element, func, number, object, shape, string } from 'prop-types'\n\n// return lat, lng from LatLngLiteral\nconst getLatLng = (LatLng) => {\n\ttry {\n\t\tconst latLng = { lat: LatLng.lat(), lng: LatLng.lng() }\n\t\treturn latLng\n\t} catch (e) {\n\t\treturn LatLng\n\t}\n}\n\n/**\n * @param {HTMLElement} container - The HTML container element for the overlay.\n * @param {google.maps.MapPanes} pane - The HTML container element for the overlay.\n * @param {google.maps.LatLng | google.maps.LatLngLiteral} position - The geographical location of the overlay.\n * @param {google.maps} maps - The Google Maps API.\n * @param {object} drag - The drag configuration of the overlay.\n * @param {boolean} drag.draggable - If true, the marker can be dragged. Default value is false.\n * @param {function} drag.onDragStart - This event is fired when the user starts dragging the marker.\n * @param {function} drag.onDrag - This event is repeatedly fired while the user drags the marker.\n * @param {function} drag.onDragEnd - This event is fired when the user stops dragging the marker.\n * @returns {void}\n */\nconst createOverlay = ({ container, pane, position, maps, drag }) => {\n\tclass Overlay extends maps.OverlayView {\n\t\tconstructor(container, pane, position) {\n\t\t\tsuper()\n\t\t\tthis.container = container\n\t\t\tthis.pane = pane\n\t\t\tthis.position = position\n\t\t}\n\n\t\t/**\n\t\t * onAdd is called when the map's panes are ready and the overlay has been\n\t\t * added to the map.\n\t\t */\n\t\tonAdd = () => {\n\t\t\tlet that = this\n\t\t\t// manage draggable\n\t\t\tif (drag?.draggable) {\n\t\t\t\tmaps.event.addDomListener(this.get('map').getDiv(), 'mouseleave', () => {\n\t\t\t\t\tmaps.event.trigger(container, 'mouseup')\n\t\t\t\t})\n\t\t\t\tmaps.event.addDomListener(this.container, 'mousedown', (e) => {\n\t\t\t\t\tthis.container.style.cursor = 'grabbing'\n\t\t\t\t\tthat.map.set('draggable', false)\n\t\t\t\t\tthat.set('origin', e)\n\n\t\t\t\t\tdrag.onDragStart(e, { latLng: getLatLng(this.position) })\n\n\t\t\t\t\tthat.moveHandler = maps.event.addDomListener(this.get('map').getDiv(), 'mousemove', (e) => {\n\t\t\t\t\t\tlet origin = that.get('origin'),\n\t\t\t\t\t\t\tleft = origin.clientX - e.clientX,\n\t\t\t\t\t\t\ttop = origin.clientY - e.clientY,\n\t\t\t\t\t\t\tpos = that.getProjection().fromLatLngToDivPixel(that.position),\n\t\t\t\t\t\t\tlatLng = that.getProjection().fromDivPixelToLatLng(new maps.Point(pos.x - left, pos.y - top))\n\t\t\t\t\t\tthat.set('position', latLng)\n\t\t\t\t\t\tthat.set('origin', e)\n\t\t\t\t\t\tthat.draw()\n\t\t\t\t\t\tdrag.onDrag(e, { latLng: getLatLng(latLng) })\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tmaps.event.addDomListener(container, 'mouseup', (e) => {\n\t\t\t\t\tthat.map.set('draggable', true)\n\t\t\t\t\tthis.container.style.cursor = 'default'\n\t\t\t\t\tmaps.event.removeListener(that.moveHandler)\n\t\t\t\t\tdrag.onDragEnd(e, { latLng: getLatLng(that.position) })\n\t\t\t\t})\n\t\t\t}\n\t\t\t// Add the element to the pane.\n\t\t\tconst pane = this.getPanes()[this.pane]\n\t\t\tpane?.classList.add('google-map-markers-overlay')\n\t\t\tpane?.appendChild(this.container)\n\t\t}\n\n\t\tdraw = () => {\n\t\t\tconst projection = this.getProjection()\n\t\t\t// Computes the pixel coordinates of the given geographical location in the DOM element that holds the draggable map.\n\t\t\tconst point = projection.fromLatLngToDivPixel(this.position)\n\t\t\tif (point === null) return\n\t\t\tthis.container.style.transform = `translate(${point.x}px, ${point.y}px)`\n\t\t\tthis.container.style.width = '0px'\n\t\t\tthis.container.style.height = '0px'\n\t\t}\n\n\t\t/**\n\t\t * The onRemove() method will be called automatically from the API if\n\t\t * we ever set the overlay's map property to 'null'.\n\t\t */\n\t\tonRemove = () => {\n\t\t\tif (this.container.parentNode !== null) {\n\t\t\t\t// remove DOM listeners\n\t\t\t\tmaps.event.clearInstanceListeners(this.container)\n\t\t\t\tthis.container.parentNode.removeChild(this.container)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn new Overlay(container, pane, position)\n}\n\ncreateOverlay.propTypes = {\n\t/**\n\t * The HTML container element for the overlay.\n\t */\n\tcontainer: element.isRequired,\n\t/**\n\t * The HTML container element for the overlay.\n\t * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n\t * @default 'floatPane'\n\t * @type {google.maps.MapPanes}\n\t * @required\n\t */\n\tpane: string.isRequired,\n\t/**\n\t * The geographical location of the overlay.\n\t * @type {google.maps.LatLng | google.maps.LatLngLiteral}\n\t * @required\n\t * @ref [LatLng](https://developers.google.com/maps/documentation/javascript/reference/coordinates#LatLng)\n\t */\n\tposition: shape({\n\t\tlat: number.isRequired,\n\t\tlng: number.isRequired,\n\t}).isRequired,\n\t/**\n\t * The Google Maps API.\n\t */\n\tmaps: object.isRequired,\n\t/**\n\t * The draggable options of the overlay.\n\t * @type {object}\n\t * @default { draggable: false, onDragStart: noop, onDrag: noop, onDragEnd: noop }\n\t */\n\tdrag: shape({\n\t\tdraggable: bool,\n\t\tonDragStart: func,\n\t\tonDrag: func,\n\t\tonDragEnd: func,\n\t}),\n}\n\nexport default createOverlay\n","import { bool, func, node, number, object, shape, string } from 'prop-types'\nimport { useEffect, useMemo } from 'react'\nimport { createPortal } from 'react-dom'\nimport useMemoCompare from '../hooks/useMemoCompare'\nimport createOverlay from './overlay'\n\n/**\n * @param {google.maps.MapPanes} pane - The pane on which to display the overlay. This is the Pane name, not the Pane itself. Defaults to floatPane.\n * @param {google.maps.LatLng | google.maps.LatLngLiteral} position - The geographical location of the overlay.\n * @param {google.maps.Map} map - The map on which to display the overlay.\n * @param {google.maps} maps - The Google Maps API.\n * @param {number} zIndex - The z-index of the overlay.\n * @param {ReactNode} children - The children of the OverlayView - the Marker component.\n * @param {object} drag - The drag configuration of the overlay.\n * @param {boolean} drag.draggable - If true, the marker can be dragged. Default value is false.\n * @param {function} drag.onDragStart - This event is fired when the user starts dragging the marker.\n * @param {function} drag.onDrag - This event is repeatedly fired while the user drags the marker.\n * @param {function} drag.onDragEnd - This event is fired when the user stops dragging the marker.\n * @returns {void}\n * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n */\nconst OverlayView = ({ pane = 'floatPane', position, map, maps, zIndex = 0, children, drag }) => {\n\tconst container = useMemo(() => {\n\t\t// eslint-disable-next-line no-undef\n\t\tconst div = document.createElement('div')\n\t\tdiv.style.position = 'absolute'\n\t\treturn div\n\t}, [])\n\n\tconst overlay = useMemo(() => {\n\t\treturn createOverlay({ container, pane, position, maps, drag })\n\t}, [container, drag, maps, pane, position])\n\n\t// Because React does not do deep comparisons, a custom hook is used.\n\t// This fixes the issue where the overlay is not updated when the position changes.\n\tconst childrenProps = useMemoCompare(children?.props, (prev, next) => {\n\t\treturn prev && prev.lat === next.lat && prev.lng === next.lng\n\t})\n\n\tuseEffect(() => {\n\t\tif (!overlay.map) {\n\t\t\toverlay?.setMap(map)\n\t\t\treturn () => {\n\t\t\t\toverlay?.setMap(null)\n\t\t\t}\n\t\t}\n\t\t// overlay depends on map, so we don't need to add it to the dependency array\n\t\t// otherwise, it will re-render the overlay every time the map changes\n\t\t//? added childrenProps to the dependency array to re-render the overlay when the children props change.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [map, childrenProps])\n\n\t// to move the container to the foreground and background\n\tuseEffect(() => {\n\t\tcontainer.style.zIndex = `${zIndex}`\n\t}, [zIndex, container])\n\n\treturn createPortal(children, container)\n}\n\nOverlayView.propTypes = {\n\t/**\n\t * The HTML container element for the overlay.\n\t * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n\t * @default 'floatPane'\n\t * @type {google.maps.MapPanes}\n\t */\n\tpane: string,\n\t/**\n\t * The geographical location of the overlay.\n\t * @type {google.maps.LatLng | google.maps.LatLngLiteral}\n\t * @required\n\t * @ref [LatLng](https://developers.google.com/maps/documentation/javascript/reference/coordinates#LatLng)\n\t */\n\tposition: shape({\n\t\tlat: number.isRequired,\n\t\tlng: number.isRequired,\n\t}).isRequired,\n\t/**\n\t * The map on which to display the overlay.\n\t * @type {google.maps.Map}\n\t * @required\n\t * @ref [Map](https://developers.google.com/maps/documentation/javascript/reference/map#Map)\n\t */\n\tmap: object.isRequired,\n\t/**\n\t * The Google Maps API.\n\t * @type {object}\n\t * @required\n\t * @ref [Google Maps API](https://developers.google.com/maps/documentation/javascript/reference)\n\t */\n\tmaps: object.isRequired,\n\t/**\n\t * The z-index of the overlay.\n\t * @type {number}\n\t * @default 0\n\t */\n\tzIndex: number,\n\t/**\n\t * The children of the OverlayView.\n\t * @type {ReactNode}\n\t * @required\n\t * @ref [ReactNode](https://reactjs.org/docs/react-api.html#reactnode)\n\t */\n\tchildren: node.isRequired,\n\t/**\n\t * The drag configuration of the overlay.\n\t * @type {object}\n\t * @default { draggable: false, onDragStart: noop, onDrag: noop, onDragEnd: noop }\n\t */\n\tdrag: shape({\n\t\tdraggable: bool,\n\t\tonDragStart: func,\n\t\tonDrag: func,\n\t\tonDragEnd: func,\n\t}),\n}\n\nexport default OverlayView\n","import { node, object } from 'prop-types'\nimport React, { Children, cloneElement, isValidElement, useMemo } from 'react'\nimport OverlayView from './overlay-view'\n\nconst noop = () => {}\n\nconst MapMarkers = ({ children, map, maps }) => {\n\tconst markers = useMemo(() => {\n\t\tif (!map || !maps) return []\n\n\t\treturn Children.map(children, (child) => {\n\t\t\tif (isValidElement(child)) {\n\t\t\t\tconst latLng = { lat: child.props.lat, lng: child.props.lng }\n\t\t\t\tconst { zIndex, draggable = false, onDragStart = noop, onDrag = noop, onDragEnd = noop } = child.props || {}\n\n\t\t\t\t// clone child without draggable props\n\t\t\t\tchild = cloneElement(child, {\n\t\t\t\t\t...child.props,\n\t\t\t\t\tdraggable: undefined,\n\t\t\t\t\tonDragStart: undefined,\n\t\t\t\t\tonDrag: undefined,\n\t\t\t\t\tonDragEnd: undefined,\n\t\t\t\t})\n\n\t\t\t\treturn (\n\t\t\t\t\t<OverlayView\n\t\t\t\t\t\tposition={latLng}\n\t\t\t\t\t\tmap={map}\n\t\t\t\t\t\tmaps={maps}\n\t\t\t\t\t\tzIndex={zIndex}\n\t\t\t\t\t\tdrag={{\n\t\t\t\t\t\t\tdraggable,\n\t\t\t\t\t\t\tonDragStart,\n\t\t\t\t\t\t\tonDrag,\n\t\t\t\t\t\t\tonDragEnd,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{child}\n\t\t\t\t\t</OverlayView>\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t}, [children, map, maps])\n\n\treturn <div>{markers}</div>\n}\n\nMapMarkers.propTypes = {\n\t/**\n\t * The Markers on the Map.\n\t * @type {ReactNode}\n\t * @required\n\t */\n\tchildren: node.isRequired,\n\t/**\n\t * The Google Maps instance.\n\t * @type {object}\n\t * @required\n\t */\n\tmap: object,\n\t/**\n\t * The Google Maps API.\n\t * @type {object}\n\t * @required\n\t */\n\tmaps: object.isRequired,\n}\n\nexport default MapMarkers\n","import { arrayOf, func, node, number, object, oneOfType, shape, string } from 'prop-types'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { isArraysEqualEps } from '../utils/utils'\nimport MapMarkers from './markers'\n\nconst EPS = 0.00001\n\nconst MapComponent = ({\n\tchildren = null,\n\tstyle = {\n\t\twidth: '100%',\n\t\theight: '100%',\n\t\tleft: 0,\n\t\ttop: 0,\n\t\tmargin: 0,\n\t\tpadding: 0,\n\t\tposition: 'absolute',\n\t},\n\tdefaultCenter,\n\tdefaultZoom,\n\tonGoogleApiLoaded = () => {},\n\tonChange = () => {},\n\toptions = {},\n\tevents = [],\n}) => {\n\tconst mapRef = useRef(null)\n\tconst prevBoundsRef = useRef(null)\n\tconst [map, setMap] = useState(null)\n\tconst [maps, setMaps] = useState(null)\n\tconst [googleApiCalled, setGoogleApiCalled] = useState(false)\n\n\tconst onIdle = useCallback(() => {\n\t\ttry {\n\t\t\tconst zoom = map.getZoom()\n\t\t\tconst bounds = map.getBounds()\n\t\t\tconst centerLatLng = map.getCenter()\n\n\t\t\tconst ne = bounds.getNorthEast()\n\t\t\tconst sw = bounds.getSouthWest()\n\t\t\tconst boundsArray = [sw.lng(), sw.lat(), ne.lng(), ne.lat()]\n\n\t\t\tif (!isArraysEqualEps(boundsArray, prevBoundsRef.current, EPS)) {\n\t\t\t\tif (onChange) {\n\t\t\t\t\tonChange({\n\t\t\t\t\t\tzoom,\n\t\t\t\t\t\tcenter: [centerLatLng.lng(), centerLatLng.lat()],\n\t\t\t\t\t\tbounds,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tprevBoundsRef.current = boundsArray\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}, [map, onChange])\n\n\tuseEffect(() => {\n\t\tif (mapRef.current && !map) {\n\t\t\tsetMap(\n\t\t\t\tnew window.google.maps.Map(mapRef.current, {\n\t\t\t\t\tcenter: defaultCenter,\n\t\t\t\t\tzoom: defaultZoom,\n\t\t\t\t\t...options,\n\t\t\t\t}),\n\t\t\t)\n\t\t\tsetMaps(window.google.maps)\n\t\t}\n\t}, [defaultCenter, defaultZoom, map, mapRef, options])\n\n\tuseEffect(() => {\n\t\tif (map) {\n\t\t\tif (!googleApiCalled) {\n\t\t\t\tonGoogleApiLoaded({ map, maps, ref: mapRef.current })\n\t\t\t\tsetGoogleApiCalled(true)\n\t\t\t}\n\n\t\t\twindow.google.maps.event.clearListeners(map, 'idle')\n\t\t\t// Idle event is fired when the map becomes idle after panning or zooming.\n\t\t\twindow.google.maps.event.addListener(map, 'idle', onIdle)\n\t\t}\n\t}, [googleApiCalled, map, maps, onChange, onGoogleApiLoaded, onIdle])\n\n\tuseEffect(() => {\n\t\t// clear listeners on unmount\n\t\treturn () => {\n\t\t\tif (map) {\n\t\t\t\twindow.google.maps.event.clearListeners(map, 'idle')\n\t\t\t}\n\t\t}\n\t}, [map])\n\n\treturn (\n\t\t<React.Fragment>\n\t\t\t<div\n\t\t\t\tref={mapRef}\n\t\t\t\tstyle={style}\n\t\t\t\tclassName=\"google-map\"\n\t\t\t\t// spread the events as props\n\t\t\t\t{...events?.reduce((acc, { name, handler } = {}) => {\n\t\t\t\t\tacc[name] = handler\n\t\t\t\t\treturn acc\n\t\t\t\t}, {})}\n\t\t\t/>\n\t\t\t{children && map && maps && (\n\t\t\t\t<MapMarkers map={map} maps={maps}>\n\t\t\t\t\t{children}\n\t\t\t\t</MapMarkers>\n\t\t\t)}\n\t\t</React.Fragment>\n\t)\n}\n\nMapComponent.propTypes = {\n\t/**\n\t * The Markers on the Map.\n\t */\n\tchildren: oneOfType([arrayOf(node), node]),\n\tstyle: object,\n\tdefaultCenter: object.isRequired,\n\tdefaultZoom: number.isRequired,\n\tonGoogleApiLoaded: func,\n\tonChange: func,\n\toptions: object,\n\t/**\n\t * The events to pass to the Google Maps instance (`div`).\n\t * @type {Array}\n\t * @example\n\t * [\n\t * {\n\t * name: 'onClick',\n\t * handler: (event) => { ... }\n\t * }\n\t * ]\n\t */\n\tevents: arrayOf(\n\t\tshape({\n\t\t\tname: string.isRequired,\n\t\t\thandler: func.isRequired,\n\t\t}),\n\t),\n}\n\nexport default MapComponent\n","import { arrayOf, bool, func, node, number, object, oneOf, oneOfType, string } from 'prop-types'\nimport React, { forwardRef } from 'react'\nimport { useGoogleMaps } from './hooks/useGoogleMaps'\nimport MapComponent from './map/map'\n\nconst GoogleMap = forwardRef(function GoogleMap(\n\t{\n\t\tapiKey = '',\n\t\tlibraries = ['places', 'geometry'],\n\t\tchildren = null,\n\t\tloadingContent = 'Google Maps is loading',\n\t\tidleContent = 'Google Maps is on idle',\n\t\terrorContent = 'Google Maps is on error',\n\t\tmapMinHeight = 'unset',\n\t\tcontainerProps = {},\n\t\tloadScriptExternally = false,\n\t\tstatus = 'idle',\n\t\tscriptCallback = () => {},\n\t\texternalApiParams = {},\n\t\t...props\n\t},\n\tref,\n) {\n\tconst renderers = {\n\t\tready: <MapComponent {...props}>{children}</MapComponent>,\n\t\tloading: loadingContent,\n\t\tidle: idleContent,\n\t\terror: errorContent,\n\t}\n\n\tconst _status = useGoogleMaps({\n\t\tapiKey,\n\t\tlibraries,\n\t\tloadScriptExternally,\n\t\tstatus,\n\t\texternalApiParams,\n\t\tcallback: scriptCallback,\n\t})\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{ height: '100%', width: '100%', overflow: 'hidden', position: 'relative', minHeight: mapMinHeight }}\n\t\t\tref={ref}\n\t\t\t{...containerProps}\n\t\t>\n\t\t\t{renderers[_status] || null}\n\t\t</div>\n\t)\n})\n\nGoogleMap.propTypes = {\n\t...MapComponent.propTypes,\n\t/**\n\t * The Markers on the Map.\n\t */\n\tchildren: oneOfType([node, arrayOf(node)]),\n\t/**\n\t * Content to be displayed while the map is loading.\n\t */\n\tloadingContent: node,\n\t/**\n\t * Content to be displayed while the map is idle.\n\t */\n\tidleContent: node,\n\t/**\n\t * Content to be displayed when there is an error loading the map.\n\t */\n\terrorContent: node,\n\t/**\n\t * The minimum height of the map.\n\t */\n\tmapMinHeight: oneOfType([number, string]),\n\t/**\n\t * Props to be passed to the container div.\n\t */\n\tcontainerProps: object,\n\t/**\n\t * Whether to load the Google Maps script externally.\n\t * If true, the status prop will be used to control the loading of the script.\n\t * If false, the script will be loaded automatically.\n\t * @default false\n\t */\n\tloadScriptExternally: bool,\n\t/**\n\t * The forced status of the Google Maps script.\n\t * @default 'idle'\n\t */\n\tstatus: oneOf(['idle', 'loading', 'ready', 'error']),\n\t/**\n\t * The callback function to pass to the Google Maps script.\n\t * @default () => {}\n\t */\n\tscriptCallback: func,\n\t/**\n\t * Prop to be passed on to google map api while loading the script such as region & language\n\t * e.g. {region: 'JP', language: 'ja'} can be used to localize map in japanese\n\t */\n\texternalApiParams: object,\n}\n\nexport default GoogleMap\n"],"names":["useScript","script","forcedStatus","src","attributes","callbacks","onLoadCallback","onErrorCallback","elementIdToAppend","undefined","_useState","useState","status","setStatus","useEffect","_script$callbacks","_script$callbacks2","scriptToAdd","document","querySelector","createElement","async","setAttribute","Object","entries","length","map","_ref","key","value","getElementById","appendChild","body","setAttributeFromEvent","event","type","addEventListener","currentScriptStatus","getAttribute","setStateFromEvent","_script$callbacks3","_script$callbacks4","removeEventListener","useGoogleMaps","_URLSearchParams","apiKey","_ref$libraries","libraries","_ref$loadScriptExtern","loadScriptExternally","_ref$status","externalApiParams","callback","window","googleMapsCallback","apiParams","URLSearchParams","toString","join","id","isArraysEqualEps","arrayA","arrayB","eps","i","Math","abs","useMemoCompare","next","compare","previousRef","useRef","previous","current","isEqual","getLatLng","LatLng","latLng","lat","lng","e","createOverlay","container","pane","position","maps","drag","Overlay","_maps$OverlayView","_inheritsLoose","_this","call","onAdd","that","_assertThisInitialized","draggable","addDomListener","get","getDiv","trigger","style","cursor","set","onDragStart","moveHandler","origin","left","clientX","top","clientY","pos","getProjection","fromLatLngToDivPixel","fromDivPixelToLatLng","Point","x","y","draw","onDrag","removeListener","onDragEnd","getPanes","classList","add","projection","point","transform","width","height","onRemove","parentNode","clearInstanceListeners","removeChild","OverlayView","propTypes","element","isRequired","string","shape","number","object","bool","func","_ref$pane","_ref$zIndex","zIndex","children","useMemo","div","overlay","childrenProps","props","prev","setMap","createPortal","node","noop","MapMarkers","markers","Children","child","isValidElement","_ref2","_ref2$draggable","_ref2$onDragStart","_ref2$onDrag","_ref2$onDragEnd","cloneElement","_extends","React","EPS","MapComponent","_ref$children","_ref$style","margin","padding","defaultCenter","defaultZoom","_ref$onGoogleApiLoade","onGoogleApiLoaded","_ref$onChange","onChange","_ref$options","options","_ref$events","events","mapRef","prevBoundsRef","_useState2","setMaps","_useState3","googleApiCalled","setGoogleApiCalled","onIdle","useCallback","zoom","getZoom","bounds","getBounds","centerLatLng","getCenter","ne","getNorthEast","sw","getSouthWest","boundsArray","center","console","error","google","Map","ref","clearListeners","addListener","Fragment","className","reduce","acc","_temp","name","handler","oneOfType","arrayOf","GoogleMap","forwardRef","_ref$apiKey","_ref$loadingContent","loadingContent","_ref$idleContent","idleContent","_ref$errorContent","errorContent","_ref$mapMinHeight","mapMinHeight","_ref$containerProps","containerProps","_ref$scriptCallback","scriptCallback","_ref$externalApiParam","_objectWithoutPropertiesLoose","_excluded","renderers","ready","loading","idle","_status","overflow","minHeight","oneOf"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,IAAMA,SAAS,GAAG,SAAZA,SAASA,CACrBC,MAAM,EAMNC,YAAY,EACR;EAAA,IAPJD,MAAM;IAANA,MAAM,GAAG;MACRE,GAAG,EAAE,EAAE;MACPC,UAAU,EAAE,EAAE;MACdC,SAAS,EAAE;QAAEC,cAAc,EAAE,IAAI;QAAEC,eAAe,EAAE;OAAM;MAC1DC,iBAAiB,EAAE;KACnB;;EAAA,IACDN,YAAY;IAAZA,YAAY,GAAGO,SAAS;;EAGxB,IAAAC,SAAA,GAA4BC,cAAQ,CAACV,MAAM,CAACE,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AC,CAAClF,gBAAM,EAAEF,gBAAM,CAAC,CAAC;EAIzCkG,cAAc,EAAE/F,gBAAM;EAOtB3F,oBAAoB,EAAE4F,cAAI;EAK1BjI,MAAM,EAAE4O,eAAK,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;EAKpDX,cAAc,EAAE/F,cAAI;EAKpB3F,iBAAiB,EAAEyF;AAAM,EACzB;;;;"}
|
package/dist/index.modern.js
CHANGED
|
@@ -244,6 +244,8 @@ var createOverlay = function createOverlay(_ref) {
|
|
|
244
244
|
var point = projection.fromLatLngToDivPixel(_this.position);
|
|
245
245
|
if (point === null) return;
|
|
246
246
|
_this.container.style.transform = "translate(" + point.x + "px, " + point.y + "px)";
|
|
247
|
+
_this.container.style.width = '0px';
|
|
248
|
+
_this.container.style.height = '0px';
|
|
247
249
|
};
|
|
248
250
|
_this.onRemove = function () {
|
|
249
251
|
if (_this.container.parentNode !== null) {
|
|
@@ -277,11 +279,13 @@ createOverlay.propTypes = {
|
|
|
277
279
|
};
|
|
278
280
|
|
|
279
281
|
var OverlayView = function OverlayView(_ref) {
|
|
280
|
-
var pane = _ref.pane,
|
|
282
|
+
var _ref$pane = _ref.pane,
|
|
283
|
+
pane = _ref$pane === void 0 ? 'floatPane' : _ref$pane,
|
|
281
284
|
position = _ref.position,
|
|
282
285
|
map = _ref.map,
|
|
283
286
|
maps = _ref.maps,
|
|
284
|
-
zIndex = _ref.zIndex,
|
|
287
|
+
_ref$zIndex = _ref.zIndex,
|
|
288
|
+
zIndex = _ref$zIndex === void 0 ? 0 : _ref$zIndex,
|
|
285
289
|
children = _ref.children,
|
|
286
290
|
drag = _ref.drag;
|
|
287
291
|
var container = useMemo(function () {
|
|
@@ -297,7 +301,7 @@ var OverlayView = function OverlayView(_ref) {
|
|
|
297
301
|
maps: maps,
|
|
298
302
|
drag: drag
|
|
299
303
|
});
|
|
300
|
-
}, [container, maps, pane, position]);
|
|
304
|
+
}, [container, drag, maps, pane, position]);
|
|
301
305
|
var childrenProps = useMemoCompare(children === null || children === void 0 ? void 0 : children.props, function (prev, next) {
|
|
302
306
|
return prev && prev.lat === next.lat && prev.lng === next.lng;
|
|
303
307
|
});
|
|
@@ -314,10 +318,6 @@ var OverlayView = function OverlayView(_ref) {
|
|
|
314
318
|
}, [zIndex, container]);
|
|
315
319
|
return /*#__PURE__*/createPortal(children, container);
|
|
316
320
|
};
|
|
317
|
-
OverlayView.defaultProps = {
|
|
318
|
-
pane: 'floatPane',
|
|
319
|
-
zIndex: 0
|
|
320
|
-
};
|
|
321
321
|
OverlayView.propTypes = {
|
|
322
322
|
pane: string,
|
|
323
323
|
position: shape({
|
|
@@ -390,14 +390,28 @@ MapMarkers.propTypes = {
|
|
|
390
390
|
|
|
391
391
|
var EPS = 0.00001;
|
|
392
392
|
var MapComponent = function MapComponent(_ref) {
|
|
393
|
-
var children = _ref.children,
|
|
394
|
-
|
|
393
|
+
var _ref$children = _ref.children,
|
|
394
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
395
|
+
_ref$style = _ref.style,
|
|
396
|
+
style = _ref$style === void 0 ? {
|
|
397
|
+
width: '100%',
|
|
398
|
+
height: '100%',
|
|
399
|
+
left: 0,
|
|
400
|
+
top: 0,
|
|
401
|
+
margin: 0,
|
|
402
|
+
padding: 0,
|
|
403
|
+
position: 'absolute'
|
|
404
|
+
} : _ref$style,
|
|
395
405
|
defaultCenter = _ref.defaultCenter,
|
|
396
406
|
defaultZoom = _ref.defaultZoom,
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
407
|
+
_ref$onGoogleApiLoade = _ref.onGoogleApiLoaded,
|
|
408
|
+
onGoogleApiLoaded = _ref$onGoogleApiLoade === void 0 ? function () {} : _ref$onGoogleApiLoade,
|
|
409
|
+
_ref$onChange = _ref.onChange,
|
|
410
|
+
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
411
|
+
_ref$options = _ref.options,
|
|
412
|
+
options = _ref$options === void 0 ? {} : _ref$options,
|
|
413
|
+
_ref$events = _ref.events,
|
|
414
|
+
events = _ref$events === void 0 ? [] : _ref$events;
|
|
401
415
|
var mapRef = useRef(null);
|
|
402
416
|
var prevBoundsRef = useRef(null);
|
|
403
417
|
var _useState = useState(null),
|
|
@@ -476,21 +490,6 @@ var MapComponent = function MapComponent(_ref) {
|
|
|
476
490
|
maps: maps
|
|
477
491
|
}, children));
|
|
478
492
|
};
|
|
479
|
-
MapComponent.defaultProps = {
|
|
480
|
-
style: {
|
|
481
|
-
width: '100%',
|
|
482
|
-
height: '100%',
|
|
483
|
-
left: 0,
|
|
484
|
-
top: 0,
|
|
485
|
-
margin: 0,
|
|
486
|
-
padding: 0,
|
|
487
|
-
position: 'absolute'
|
|
488
|
-
},
|
|
489
|
-
onGoogleApiLoaded: function onGoogleApiLoaded() {},
|
|
490
|
-
onChange: function onChange() {},
|
|
491
|
-
options: {},
|
|
492
|
-
events: []
|
|
493
|
-
};
|
|
494
493
|
MapComponent.propTypes = {
|
|
495
494
|
children: oneOfType([arrayOf(node), node]),
|
|
496
495
|
style: object,
|
|
@@ -507,18 +506,30 @@ MapComponent.propTypes = {
|
|
|
507
506
|
|
|
508
507
|
var _excluded = ["apiKey", "libraries", "children", "loadingContent", "idleContent", "errorContent", "mapMinHeight", "containerProps", "loadScriptExternally", "status", "scriptCallback", "externalApiParams"];
|
|
509
508
|
var GoogleMap = /*#__PURE__*/forwardRef(function GoogleMap(_ref, ref) {
|
|
510
|
-
var apiKey = _ref.apiKey,
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
509
|
+
var _ref$apiKey = _ref.apiKey,
|
|
510
|
+
apiKey = _ref$apiKey === void 0 ? '' : _ref$apiKey,
|
|
511
|
+
_ref$libraries = _ref.libraries,
|
|
512
|
+
libraries = _ref$libraries === void 0 ? ['places', 'geometry'] : _ref$libraries,
|
|
513
|
+
_ref$children = _ref.children,
|
|
514
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
515
|
+
_ref$loadingContent = _ref.loadingContent,
|
|
516
|
+
loadingContent = _ref$loadingContent === void 0 ? 'Google Maps is loading' : _ref$loadingContent,
|
|
517
|
+
_ref$idleContent = _ref.idleContent,
|
|
518
|
+
idleContent = _ref$idleContent === void 0 ? 'Google Maps is on idle' : _ref$idleContent,
|
|
519
|
+
_ref$errorContent = _ref.errorContent,
|
|
520
|
+
errorContent = _ref$errorContent === void 0 ? 'Google Maps is on error' : _ref$errorContent,
|
|
521
|
+
_ref$mapMinHeight = _ref.mapMinHeight,
|
|
522
|
+
mapMinHeight = _ref$mapMinHeight === void 0 ? 'unset' : _ref$mapMinHeight,
|
|
523
|
+
_ref$containerProps = _ref.containerProps,
|
|
524
|
+
containerProps = _ref$containerProps === void 0 ? {} : _ref$containerProps,
|
|
525
|
+
_ref$loadScriptExtern = _ref.loadScriptExternally,
|
|
526
|
+
loadScriptExternally = _ref$loadScriptExtern === void 0 ? false : _ref$loadScriptExtern,
|
|
527
|
+
_ref$status = _ref.status,
|
|
528
|
+
status = _ref$status === void 0 ? 'idle' : _ref$status,
|
|
529
|
+
_ref$scriptCallback = _ref.scriptCallback,
|
|
530
|
+
scriptCallback = _ref$scriptCallback === void 0 ? function () {} : _ref$scriptCallback,
|
|
531
|
+
_ref$externalApiParam = _ref.externalApiParams,
|
|
532
|
+
externalApiParams = _ref$externalApiParam === void 0 ? {} : _ref$externalApiParam,
|
|
522
533
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
523
534
|
var renderers = {
|
|
524
535
|
ready: /*#__PURE__*/React.createElement(MapComponent, props, children),
|
|
@@ -545,17 +556,6 @@ var GoogleMap = /*#__PURE__*/forwardRef(function GoogleMap(_ref, ref) {
|
|
|
545
556
|
ref: ref
|
|
546
557
|
}, containerProps), renderers[_status] || null);
|
|
547
558
|
});
|
|
548
|
-
GoogleMap.defaultProps = _extends({}, MapComponent.defaultProps, {
|
|
549
|
-
loadingContent: 'Google Maps is loading',
|
|
550
|
-
idleContent: 'Google Maps is on idle',
|
|
551
|
-
errorContent: 'Google Maps is on error',
|
|
552
|
-
mapMinHeight: 'unset',
|
|
553
|
-
apiKey: '',
|
|
554
|
-
libraries: ['places', 'geometry'],
|
|
555
|
-
loadScriptExternally: false,
|
|
556
|
-
status: 'idle',
|
|
557
|
-
scriptCallback: function scriptCallback() {}
|
|
558
|
-
});
|
|
559
559
|
GoogleMap.propTypes = _extends({}, MapComponent.propTypes, {
|
|
560
560
|
children: oneOfType([node, arrayOf(node)]),
|
|
561
561
|
loadingContent: node,
|
package/dist/index.modern.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.modern.js","sources":["../src/hooks/useScript.js","../src/hooks/useGoogleMaps.js","../src/utils/utils.js","../src/hooks/useMemoCompare.js","../src/map/overlay.js","../src/map/overlay-view.js","../src/map/markers.js","../src/map/map.js","../src/google-map.js"],"sourcesContent":["/* eslint-disable no-unused-expressions */\nimport { useEffect, useState } from 'react'\n\n/**\n * @description Hook to load external script.\n * @param {Object} script - Script to load.\n * @param {string} script.src - Script source.\n * @param {Object} [script.attributes] - Attributes to add to the script tag.\n * @param {Object} [script.callbacks] - Callbacks executed on completion.\n * @param {Function} [script.callbacks.onLoadCallback] - Callback executed on completion in case of success.\n * @param {Function} [script.callbacks.onErrorCallback] - Callbacks executed on completion in case of error.\n * @param {string} [script.elementIdToAppend] - HTML element id to append the script to. Default is HTML HEAD.\n * @returns {\"idle\" | \"loading\" | \"ready\" | \"error\"} status\n *\n * @example\n * const status = useScript({\n * \t\tsrc: \"https://script-to-load.js\",\n * \t\tattributes: { id: \"scriptId\", class: \"script-class\" },\n * \t\tcallbacks: {\n * \t\t\tonLoadCallback: onLoadFunc,\n * \t\t\tonErrorCallback: onErrorFunc,\n * \t\t},\n * \t\telementIdToAppend: \"script-container\"\n * })\n */\n\nexport const useScript = (\n\tscript = {\n\t\tsrc: '',\n\t\tattributes: {},\n\t\tcallbacks: { onLoadCallback: null, onErrorCallback: null },\n\t\telementIdToAppend: null,\n\t},\n\tforcedStatus = undefined\n) => {\n\t// Keep track of script status (\"idle\", \"loading\", \"ready\", \"error\")\n\tconst [status, setStatus] = useState(script.src ? 'loading' : 'idle')\n\n\tuseEffect(\n\t\t() => {\n\t\t\tif (forcedStatus) {\n\t\t\t\tsetStatus(forcedStatus)\n\t\t\t\treturn () => {\n\t\t\t\t\t// do nothing\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Allow falsy src value if waiting on other data needed for\n\t\t\t// constructing the script URL passed to this hook.\n\t\t\tif (!script.src) {\n\t\t\t\tsetStatus('idle')\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Fetch existing script element by src\n\t\t\t// It may have been added by another instance of this hook\n\t\t\tlet scriptToAdd = document.querySelector(`script[src=\"${script.src}\"]`)\n\t\t\tif (!scriptToAdd) {\n\t\t\t\t// Create script\n\t\t\t\tscriptToAdd = document.createElement('script')\n\t\t\t\tscriptToAdd.src = script.src\n\t\t\t\tscriptToAdd.async = true\n\t\t\t\tscriptToAdd.setAttribute('data-status', 'loading')\n\t\t\t\t// Add other script attributes, if they exist\n\t\t\t\tscript.attributes && Object.entries(script.attributes).length > 0\n\t\t\t\t\t? Object.entries(script.attributes).map(([key, value]) => scriptToAdd.setAttribute(key, value))\n\t\t\t\t\t: null\n\t\t\t\t// Add script to document body\n\t\t\t\tif (script.elementIdToAppend && document.getElementById(script.elementIdToAppend)) {\n\t\t\t\t\tdocument.getElementById(script.elementIdToAppend).appendChild(scriptToAdd)\n\t\t\t\t} else {\n\t\t\t\t\tdocument.body.appendChild(scriptToAdd)\n\t\t\t\t}\n\t\t\t\t// Store status in attribute on script\n\t\t\t\t// This can be read by other instances of this hook\n\t\t\t\tconst setAttributeFromEvent = (event) => {\n\t\t\t\t\tscriptToAdd.setAttribute('data-status', event.type === 'load' ? 'ready' : 'error')\n\t\t\t\t}\n\t\t\t\tscriptToAdd.addEventListener('load', setAttributeFromEvent)\n\t\t\t\tscriptToAdd.addEventListener('error', setAttributeFromEvent)\n\t\t\t} else {\n\t\t\t\t// Grab existing script status from attribute and set to state.\n\t\t\t\tconst currentScriptStatus = scriptToAdd.getAttribute('data-status')\n\t\t\t\tswitch (currentScriptStatus) {\n\t\t\t\t\tcase 'load':\n\t\t\t\t\tcase 'ready':\n\t\t\t\t\t\tscript.callbacks?.onLoadCallback ? script.callbacks.onLoadCallback() : null\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\tscript.callbacks?.onErrorCallback ? script.callbacks.onErrorCallback() : null\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// loading: do nothing\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tsetStatus(currentScriptStatus)\n\t\t\t}\n\t\t\t// Script event handler to update status in state\n\t\t\t// Note: Even if the script already exists we still need to add\n\t\t\t// event handlers to update the state for this hook instance.\n\t\t\tconst setStateFromEvent = (event) => {\n\t\t\t\tevent.type === 'load'\n\t\t\t\t\t? script.callbacks?.onLoadCallback\n\t\t\t\t\t\t? script.callbacks.onLoadCallback()\n\t\t\t\t\t\t: null\n\t\t\t\t\t: script.callbacks?.onErrorCallback\n\t\t\t\t\t? script.callbacks.onErrorCallback()\n\t\t\t\t\t: null\n\t\t\t\tsetStatus(event.type === 'load' ? 'ready' : 'error')\n\t\t\t}\n\t\t\t// Add event listeners\n\t\t\tscriptToAdd.addEventListener('load', setStateFromEvent)\n\t\t\tscriptToAdd.addEventListener('error', setStateFromEvent)\n\t\t\t// Remove event listeners on cleanup\n\t\t\treturn () => {\n\t\t\t\tif (scriptToAdd) {\n\t\t\t\t\tscriptToAdd.removeEventListener('load', setStateFromEvent)\n\t\t\t\t\tscriptToAdd.removeEventListener('error', setStateFromEvent)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Re-run useEffect if script changes\n\t\t[script, forcedStatus, status]\n\t)\n\n\treturn status\n}\n","import { useScript } from './useScript'\n\n/**\n * @returns {\"idle\" | \"loading\" | \"ready\" | \"error\"} status\n */\nexport const useGoogleMaps = ({\n\tapiKey,\n\tlibraries = [],\n\tloadScriptExternally = false,\n\tstatus = 'idle',\n\texternalApiParams,\n\tcallback,\n}) => {\n\t// eslint-disable-next-line no-undef\n\tif (typeof window !== 'undefined') window.googleMapsCallback = callback\n\tconst apiParams = new URLSearchParams(externalApiParams)?.toString()\n\tconst script = apiKey\n\t\t? {\n\t\t\t\tsrc: `https://maps.googleapis.com/maps/api/js?key=${apiKey}&callback=googleMapsCallback&libraries=${libraries?.join(\n\t\t\t\t\t','\n\t\t\t\t)}${apiParams ? '&' + apiParams : ''}`,\n\t\t\t\tattributes: { id: 'googleMapsApi' },\n\t\t }\n\t\t: {\n\t\t\t\tsrc: `https://maps.googleapis.com/maps/api/js?callback=googleMapsCallback&libraries=${libraries?.join(',')}`,\n\t\t\t\tattributes: { id: 'googleMapsApi' },\n\t\t }\n\n\treturn useScript(script, loadScriptExternally ? status : undefined)\n}\n","export const isArraysEqualEps = (arrayA, arrayB, eps) => {\n\tif (arrayA && arrayB) {\n\t\tfor (let i = 0; i !== arrayA.length; ++i) {\n\t\t\tif (Math.abs(arrayA[i] - arrayB[i]) > eps) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n","import { useEffect, useRef } from 'react'\n\n/**\n * A hook that compares the previous and current values of a reference.\n * @param {any} value - the current value of the reference\n * @param {function} compare - a function that compares the previous and current values\n * @returns {any} the previous value of the reference\n * @ref https://usehooks.com/useMemoCompare/\n */\nconst useMemoCompare = (next, compare) => {\n\t// Ref for storing previous value\n\tconst previousRef = useRef()\n\tconst previous = previousRef.current\n\t// Pass previous and next value to compare function\n\t// to determine whether to consider them equal.\n\tconst isEqual = compare(previous, next)\n\t// If not equal update previousRef to next value.\n\t// We only update if not equal so that this hook continues to return\n\t// the same old value if compare keeps returning true.\n\tuseEffect(() => {\n\t\tif (!isEqual) {\n\t\t\tpreviousRef.current = next\n\t\t}\n\t})\n\t// Finally, if equal then return the previous value\n\treturn isEqual ? previous : next\n}\n\nexport default useMemoCompare\n","import { bool, element, func, number, object, shape, string } from 'prop-types'\n\n// return lat, lng from LatLngLiteral\nconst getLatLng = (LatLng) => {\n\ttry {\n\t\tconst latLng = { lat: LatLng.lat(), lng: LatLng.lng() }\n\t\treturn latLng\n\t} catch (e) {\n\t\treturn LatLng\n\t}\n}\n\n/**\n * @param {HTMLElement} container - The HTML container element for the overlay.\n * @param {google.maps.MapPanes} pane - The HTML container element for the overlay.\n * @param {google.maps.LatLng | google.maps.LatLngLiteral} position - The geographical location of the overlay.\n * @param {google.maps} maps - The Google Maps API.\n * @param {object} drag - The drag configuration of the overlay.\n * @param {boolean} drag.draggable - If true, the marker can be dragged. Default value is false.\n * @param {function} drag.onDragStart - This event is fired when the user starts dragging the marker.\n * @param {function} drag.onDrag - This event is repeatedly fired while the user drags the marker.\n * @param {function} drag.onDragEnd - This event is fired when the user stops dragging the marker.\n * @returns {void}\n */\nconst createOverlay = ({ container, pane, position, maps, drag }) => {\n\tclass Overlay extends maps.OverlayView {\n\t\tconstructor(container, pane, position) {\n\t\t\tsuper()\n\t\t\tthis.container = container\n\t\t\tthis.pane = pane\n\t\t\tthis.position = position\n\t\t}\n\n\t\t/**\n\t\t * onAdd is called when the map's panes are ready and the overlay has been\n\t\t * added to the map.\n\t\t */\n\t\tonAdd = () => {\n\t\t\tlet that = this\n\t\t\t// manage draggable\n\t\t\tif (drag?.draggable) {\n\t\t\t\tmaps.event.addDomListener(this.get('map').getDiv(), 'mouseleave', () => {\n\t\t\t\t\tmaps.event.trigger(container, 'mouseup')\n\t\t\t\t})\n\t\t\t\tmaps.event.addDomListener(this.container, 'mousedown', (e) => {\n\t\t\t\t\tthis.container.style.cursor = 'grabbing'\n\t\t\t\t\tthat.map.set('draggable', false)\n\t\t\t\t\tthat.set('origin', e)\n\n\t\t\t\t\tdrag.onDragStart(e, { latLng: getLatLng(this.position) })\n\n\t\t\t\t\tthat.moveHandler = maps.event.addDomListener(this.get('map').getDiv(), 'mousemove', (e) => {\n\t\t\t\t\t\tlet origin = that.get('origin'),\n\t\t\t\t\t\t\tleft = origin.clientX - e.clientX,\n\t\t\t\t\t\t\ttop = origin.clientY - e.clientY,\n\t\t\t\t\t\t\tpos = that.getProjection().fromLatLngToDivPixel(that.position),\n\t\t\t\t\t\t\tlatLng = that.getProjection().fromDivPixelToLatLng(new maps.Point(pos.x - left, pos.y - top))\n\t\t\t\t\t\tthat.set('position', latLng)\n\t\t\t\t\t\tthat.set('origin', e)\n\t\t\t\t\t\tthat.draw()\n\t\t\t\t\t\tdrag.onDrag(e, { latLng: getLatLng(latLng) })\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tmaps.event.addDomListener(container, 'mouseup', (e) => {\n\t\t\t\t\tthat.map.set('draggable', true)\n\t\t\t\t\tthis.container.style.cursor = 'default'\n\t\t\t\t\tmaps.event.removeListener(that.moveHandler)\n\t\t\t\t\tdrag.onDragEnd(e, { latLng: getLatLng(that.position) })\n\t\t\t\t})\n\t\t\t}\n\t\t\t// Add the element to the pane.\n\t\t\tconst pane = this.getPanes()[this.pane]\n\t\t\tpane?.classList.add('google-map-markers-overlay')\n\t\t\tpane?.appendChild(this.container)\n\t\t}\n\n\t\tdraw = () => {\n\t\t\tconst projection = this.getProjection()\n\t\t\t// Computes the pixel coordinates of the given geographical location in the DOM element that holds the draggable map.\n\t\t\tconst point = projection.fromLatLngToDivPixel(this.position)\n\t\t\tif (point === null) return\n\t\t\tthis.container.style.transform = `translate(${point.x}px, ${point.y}px)`\n\t\t}\n\n\t\t/**\n\t\t * The onRemove() method will be called automatically from the API if\n\t\t * we ever set the overlay's map property to 'null'.\n\t\t */\n\t\tonRemove = () => {\n\t\t\tif (this.container.parentNode !== null) {\n\t\t\t\t// remove DOM listeners\n\t\t\t\tmaps.event.clearInstanceListeners(this.container)\n\t\t\t\tthis.container.parentNode.removeChild(this.container)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn new Overlay(container, pane, position)\n}\n\ncreateOverlay.propTypes = {\n\t/**\n\t * The HTML container element for the overlay.\n\t */\n\tcontainer: element.isRequired,\n\t/**\n\t * The HTML container element for the overlay.\n\t * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n\t * @default 'floatPane'\n\t * @type {google.maps.MapPanes}\n\t * @required\n\t */\n\tpane: string.isRequired,\n\t/**\n\t * The geographical location of the overlay.\n\t * @type {google.maps.LatLng | google.maps.LatLngLiteral}\n\t * @required\n\t * @ref [LatLng](https://developers.google.com/maps/documentation/javascript/reference/coordinates#LatLng)\n\t */\n\tposition: shape({\n\t\tlat: number.isRequired,\n\t\tlng: number.isRequired,\n\t}).isRequired,\n\t/**\n\t * The Google Maps API.\n\t */\n\tmaps: object.isRequired,\n\t/**\n\t * The draggable options of the overlay.\n\t * @type {object}\n\t * @default { draggable: false, onDragStart: noop, onDrag: noop, onDragEnd: noop }\n\t */\n\tdrag: shape({\n\t\tdraggable: bool,\n\t\tonDragStart: func,\n\t\tonDrag: func,\n\t\tonDragEnd: func,\n\t}),\n}\n\nexport default createOverlay\n","import { bool, func, node, number, object, shape, string } from 'prop-types'\nimport { useEffect, useMemo } from 'react'\nimport { createPortal } from 'react-dom'\nimport useMemoCompare from '../hooks/useMemoCompare'\nimport createOverlay from './overlay'\n\nconst noop = () => {}\n\n/**\n * @param {google.maps.MapPanes} pane - The pane on which to display the overlay. This is the Pane name, not the Pane itself. Defaults to floatPane.\n * @param {google.maps.LatLng | google.maps.LatLngLiteral} position - The geographical location of the overlay.\n * @param {google.maps.Map} map - The map on which to display the overlay.\n * @param {google.maps} maps - The Google Maps API.\n * @param {number} zIndex - The z-index of the overlay.\n * @param {ReactNode} children - The children of the OverlayView - the Marker component.\n * @param {object} drag - The drag configuration of the overlay.\n * @param {boolean} drag.draggable - If true, the marker can be dragged. Default value is false.\n * @param {function} drag.onDragStart - This event is fired when the user starts dragging the marker.\n * @param {function} drag.onDrag - This event is repeatedly fired while the user drags the marker.\n * @param {function} drag.onDragEnd - This event is fired when the user stops dragging the marker.\n * @returns {void}\n * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n */\nconst OverlayView = ({ pane, position, map, maps, zIndex, children, drag }) => {\n\tconst container = useMemo(() => {\n\t\t// eslint-disable-next-line no-undef\n\t\tconst div = document.createElement('div')\n\t\tdiv.style.position = 'absolute'\n\t\treturn div\n\t}, [])\n\n\tconst overlay = useMemo(() => {\n\t\treturn createOverlay({ container, pane, position, maps, drag })\n\t}, [container, maps, pane, position])\n\n\t// Because React does not do deep comparisons, a custom hook is used.\n\t// This fixes the issue where the overlay is not updated when the position changes.\n\tconst childrenProps = useMemoCompare(children?.props, (prev, next) => {\n\t\treturn prev && prev.lat === next.lat && prev.lng === next.lng\n\t})\n\n\tuseEffect(() => {\n\t\tif (!overlay.map) {\n\t\t\toverlay?.setMap(map)\n\t\t\treturn () => {\n\t\t\t\toverlay?.setMap(null)\n\t\t\t}\n\t\t}\n\t\t// overlay depends on map, so we don't need to add it to the dependency array\n\t\t// otherwise, it will re-render the overlay every time the map changes\n\t\t//? added childrenProps to the dependency array to re-render the overlay when the children props change.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [map, childrenProps])\n\n\t// to move the container to the foreground and background\n\tuseEffect(() => {\n\t\tcontainer.style.zIndex = `${zIndex}`\n\t}, [zIndex, container])\n\n\treturn createPortal(children, container)\n}\n\nOverlayView.defaultProps = {\n\tpane: 'floatPane',\n\tzIndex: 0,\n}\n\nOverlayView.propTypes = {\n\t/**\n\t * The HTML container element for the overlay.\n\t * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n\t * @default 'floatPane'\n\t * @type {google.maps.MapPanes}\n\t */\n\tpane: string,\n\t/**\n\t * The geographical location of the overlay.\n\t * @type {google.maps.LatLng | google.maps.LatLngLiteral}\n\t * @required\n\t * @ref [LatLng](https://developers.google.com/maps/documentation/javascript/reference/coordinates#LatLng)\n\t */\n\tposition: shape({\n\t\tlat: number.isRequired,\n\t\tlng: number.isRequired,\n\t}).isRequired,\n\t/**\n\t * The map on which to display the overlay.\n\t * @type {google.maps.Map}\n\t * @required\n\t * @ref [Map](https://developers.google.com/maps/documentation/javascript/reference/map#Map)\n\t */\n\tmap: object.isRequired,\n\t/**\n\t * The Google Maps API.\n\t * @type {object}\n\t * @required\n\t * @ref [Google Maps API](https://developers.google.com/maps/documentation/javascript/reference)\n\t */\n\tmaps: object.isRequired,\n\t/**\n\t * The z-index of the overlay.\n\t * @type {number}\n\t * @default 0\n\t */\n\tzIndex: number,\n\t/**\n\t * The children of the OverlayView.\n\t * @type {ReactNode}\n\t * @required\n\t * @ref [ReactNode](https://reactjs.org/docs/react-api.html#reactnode)\n\t */\n\tchildren: node.isRequired,\n\t/**\n\t * The drag configuration of the overlay.\n\t * @type {object}\n\t * @default { draggable: false, onDragStart: noop, onDrag: noop, onDragEnd: noop }\n\t */\n\tdrag: shape({\n\t\tdraggable: bool,\n\t\tonDragStart: func,\n\t\tonDrag: func,\n\t\tonDragEnd: func,\n\t}),\n}\n\nexport default OverlayView\n","import { node, object } from 'prop-types'\nimport React, { Children, cloneElement, isValidElement, useMemo } from 'react'\nimport OverlayView from './overlay-view'\n\nconst noop = () => {}\n\nconst MapMarkers = ({ children, map, maps }) => {\n\tconst markers = useMemo(() => {\n\t\tif (!map || !maps) return []\n\n\t\treturn Children.map(children, (child) => {\n\t\t\tif (isValidElement(child)) {\n\t\t\t\tconst latLng = { lat: child.props.lat, lng: child.props.lng }\n\t\t\t\tconst { zIndex, draggable = false, onDragStart = noop, onDrag = noop, onDragEnd = noop } = child.props || {}\n\n\t\t\t\t// clone child without draggable props\n\t\t\t\tchild = cloneElement(child, {\n\t\t\t\t\t...child.props,\n\t\t\t\t\tdraggable: undefined,\n\t\t\t\t\tonDragStart: undefined,\n\t\t\t\t\tonDrag: undefined,\n\t\t\t\t\tonDragEnd: undefined,\n\t\t\t\t})\n\n\t\t\t\treturn (\n\t\t\t\t\t<OverlayView\n\t\t\t\t\t\tposition={latLng}\n\t\t\t\t\t\tmap={map}\n\t\t\t\t\t\tmaps={maps}\n\t\t\t\t\t\tzIndex={zIndex}\n\t\t\t\t\t\tdrag={{\n\t\t\t\t\t\t\tdraggable,\n\t\t\t\t\t\t\tonDragStart,\n\t\t\t\t\t\t\tonDrag,\n\t\t\t\t\t\t\tonDragEnd,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{child}\n\t\t\t\t\t</OverlayView>\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t}, [children, map, maps])\n\n\treturn <div>{markers}</div>\n}\n\nMapMarkers.propTypes = {\n\t/**\n\t * The Markers on the Map.\n\t * @type {ReactNode}\n\t * @required\n\t */\n\tchildren: node.isRequired,\n\t/**\n\t * The Google Maps instance.\n\t * @type {object}\n\t * @required\n\t */\n\tmap: object,\n\t/**\n\t * The Google Maps API.\n\t * @type {object}\n\t * @required\n\t */\n\tmaps: object.isRequired,\n}\n\nexport default MapMarkers\n","import { arrayOf, func, node, number, object, oneOfType, shape, string } from 'prop-types'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { isArraysEqualEps } from '../utils/utils'\nimport MapMarkers from './markers'\n\nconst EPS = 0.00001\n\nconst MapComponent = ({\n\tchildren,\n\tstyle,\n\tdefaultCenter,\n\tdefaultZoom,\n\tonGoogleApiLoaded,\n\tonChange,\n\toptions,\n\tevents,\n}) => {\n\tconst mapRef = useRef(null)\n\tconst prevBoundsRef = useRef(null)\n\tconst [map, setMap] = useState(null)\n\tconst [maps, setMaps] = useState(null)\n\tconst [googleApiCalled, setGoogleApiCalled] = useState(false)\n\n\tconst onIdle = useCallback(() => {\n\t\ttry {\n\t\t\tconst zoom = map.getZoom()\n\t\t\tconst bounds = map.getBounds()\n\t\t\tconst centerLatLng = map.getCenter()\n\n\t\t\tconst ne = bounds.getNorthEast()\n\t\t\tconst sw = bounds.getSouthWest()\n\t\t\tconst boundsArray = [sw.lng(), sw.lat(), ne.lng(), ne.lat()]\n\n\t\t\tif (!isArraysEqualEps(boundsArray, prevBoundsRef.current, EPS)) {\n\t\t\t\tif (onChange) {\n\t\t\t\t\tonChange({\n\t\t\t\t\t\tzoom,\n\t\t\t\t\t\tcenter: [centerLatLng.lng(), centerLatLng.lat()],\n\t\t\t\t\t\tbounds,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tprevBoundsRef.current = boundsArray\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}, [map, onChange])\n\n\tuseEffect(() => {\n\t\tif (mapRef.current && !map) {\n\t\t\tsetMap(\n\t\t\t\tnew window.google.maps.Map(mapRef.current, {\n\t\t\t\t\tcenter: defaultCenter,\n\t\t\t\t\tzoom: defaultZoom,\n\t\t\t\t\t...options,\n\t\t\t\t})\n\t\t\t)\n\t\t\tsetMaps(window.google.maps)\n\t\t}\n\t}, [defaultCenter, defaultZoom, map, mapRef, options])\n\n\tuseEffect(() => {\n\t\tif (map) {\n\t\t\tif (!googleApiCalled) {\n\t\t\t\tonGoogleApiLoaded({ map, maps, ref: mapRef.current })\n\t\t\t\tsetGoogleApiCalled(true)\n\t\t\t}\n\n\t\t\twindow.google.maps.event.clearListeners(map, 'idle')\n\t\t\t// Idle event is fired when the map becomes idle after panning or zooming.\n\t\t\twindow.google.maps.event.addListener(map, 'idle', onIdle)\n\t\t}\n\t}, [googleApiCalled, map, maps, onChange, onGoogleApiLoaded, onIdle])\n\n\tuseEffect(() => {\n\t\t// clear listeners on unmount\n\t\treturn () => {\n\t\t\tif (map) {\n\t\t\t\twindow.google.maps.event.clearListeners(map, 'idle')\n\t\t\t}\n\t\t}\n\t}, [map])\n\n\treturn (\n\t\t<React.Fragment>\n\t\t\t<div\n\t\t\t\tref={mapRef}\n\t\t\t\tstyle={style}\n\t\t\t\tclassName=\"google-map\"\n\t\t\t\t// spread the events as props\n\t\t\t\t{...events?.reduce((acc, { name, handler } = {}) => {\n\t\t\t\t\tacc[name] = handler\n\t\t\t\t\treturn acc\n\t\t\t\t}, {})}\n\t\t\t/>\n\t\t\t{children && map && maps && (\n\t\t\t\t<MapMarkers map={map} maps={maps}>\n\t\t\t\t\t{children}\n\t\t\t\t</MapMarkers>\n\t\t\t)}\n\t\t</React.Fragment>\n\t)\n}\n\nMapComponent.defaultProps = {\n\tstyle: {\n\t\twidth: '100%',\n\t\theight: '100%',\n\t\tleft: 0,\n\t\ttop: 0,\n\t\tmargin: 0,\n\t\tpadding: 0,\n\t\tposition: 'absolute',\n\t},\n\tonGoogleApiLoaded: () => {},\n\tonChange: () => {},\n\toptions: {},\n\tevents: [],\n}\n\nMapComponent.propTypes = {\n\t/**\n\t * The Markers on the Map.\n\t */\n\tchildren: oneOfType([arrayOf(node), node]),\n\tstyle: object,\n\tdefaultCenter: object.isRequired,\n\tdefaultZoom: number.isRequired,\n\tonGoogleApiLoaded: func,\n\tonChange: func,\n\toptions: object,\n\t/**\n\t * The events to pass to the Google Maps instance (`div`).\n\t * @type {Array}\n\t * @example\n\t * [\n\t * {\n\t * name: 'onClick',\n\t * handler: (event) => { ... }\n\t * }\n\t * ]\n\t */\n\tevents: arrayOf(\n\t\tshape({\n\t\t\tname: string.isRequired,\n\t\t\thandler: func.isRequired,\n\t\t})\n\t),\n}\n\nexport default MapComponent\n","import { arrayOf, bool, func, node, number, object, oneOf, oneOfType, string } from 'prop-types'\nimport React, { forwardRef } from 'react'\nimport { useGoogleMaps } from './hooks/useGoogleMaps'\nimport MapComponent from './map/map'\n\nconst GoogleMap = forwardRef(function GoogleMap(\n\t{\n\t\tapiKey,\n\t\tlibraries,\n\t\tchildren,\n\t\tloadingContent,\n\t\tidleContent,\n\t\terrorContent,\n\t\tmapMinHeight,\n\t\tcontainerProps,\n\t\tloadScriptExternally,\n\t\tstatus,\n\t\tscriptCallback,\n\t\texternalApiParams,\n\t\t...props\n\t},\n\tref\n) {\n\tconst renderers = {\n\t\tready: <MapComponent {...props}>{children}</MapComponent>,\n\t\tloading: loadingContent,\n\t\tidle: idleContent,\n\t\terror: errorContent,\n\t}\n\n\tconst _status = useGoogleMaps({\n\t\tapiKey,\n\t\tlibraries,\n\t\tloadScriptExternally,\n\t\tstatus,\n\t\texternalApiParams,\n\t\tcallback: scriptCallback,\n\t})\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{ height: '100%', width: '100%', overflow: 'hidden', position: 'relative', minHeight: mapMinHeight }}\n\t\t\tref={ref}\n\t\t\t{...containerProps}\n\t\t>\n\t\t\t{renderers[_status] || null}\n\t\t</div>\n\t)\n})\n\nGoogleMap.defaultProps = {\n\t...MapComponent.defaultProps,\n\tloadingContent: 'Google Maps is loading',\n\tidleContent: 'Google Maps is on idle',\n\terrorContent: 'Google Maps is on error',\n\tmapMinHeight: 'unset',\n\tapiKey: '',\n\tlibraries: ['places', 'geometry'],\n\tloadScriptExternally: false,\n\tstatus: 'idle',\n\tscriptCallback: () => {},\n}\n\nGoogleMap.propTypes = {\n\t...MapComponent.propTypes,\n\t/**\n\t * The Markers on the Map.\n\t */\n\tchildren: oneOfType([node, arrayOf(node)]),\n\t/**\n\t * Content to be displayed while the map is loading.\n\t */\n\tloadingContent: node,\n\t/**\n\t * Content to be displayed while the map is idle.\n\t */\n\tidleContent: node,\n\t/**\n\t * Content to be displayed when there is an error loading the map.\n\t */\n\terrorContent: node,\n\t/**\n\t * The minimum height of the map.\n\t */\n\tmapMinHeight: oneOfType([number, string]),\n\t/**\n\t * Props to be passed to the container div.\n\t */\n\tcontainerProps: object,\n\t/**\n\t * Whether to load the Google Maps script externally.\n\t * If true, the status prop will be used to control the loading of the script.\n\t * If false, the script will be loaded automatically.\n\t * @default false\n\t */\n\tloadScriptExternally: bool,\n\t/**\n\t * The forced status of the Google Maps script.\n\t * @default 'idle'\n\t */\n\tstatus: oneOf(['idle', 'loading', 'ready', 'error']),\n\t/**\n\t * The callback function to pass to the Google Maps script.\n\t * @default () => {}\n\t */\n\tscriptCallback: func,\n\t/**\n\t * Prop to be passed on to google map api while loading the script such as region & language\n\t * e.g. {region: 'JP', language: 'ja'} can be used to localize map in japanese\n\t */\n\texternalApiParams: object,\n}\n\nexport default GoogleMap\n"],"names":["useScript","script","forcedStatus","src","attributes","callbacks","onLoadCallback","onErrorCallback","elementIdToAppend","undefined","_useState","useState","status","setStatus","useEffect","_script$callbacks","_script$callbacks2","scriptToAdd","document","querySelector","createElement","async","setAttribute","Object","entries","length","map","_ref","key","value","getElementById","appendChild","body","setAttributeFromEvent","event","type","addEventListener","currentScriptStatus","getAttribute","setStateFromEvent","_script$callbacks3","_script$callbacks4","removeEventListener","useGoogleMaps","_URLSearchParams","apiKey","_ref$libraries","libraries","_ref$loadScriptExtern","loadScriptExternally","_ref$status","externalApiParams","callback","window","googleMapsCallback","apiParams","URLSearchParams","toString","join","id","isArraysEqualEps","arrayA","arrayB","eps","i","Math","abs","useMemoCompare","next","compare","previousRef","useRef","previous","current","isEqual","getLatLng","LatLng","latLng","lat","lng","e","createOverlay","container","pane","position","maps","drag","Overlay","_maps$OverlayView","_inheritsLoose","_this","call","onAdd","that","_assertThisInitialized","draggable","addDomListener","get","getDiv","trigger","style","cursor","set","onDragStart","moveHandler","origin","left","clientX","top","clientY","pos","getProjection","fromLatLngToDivPixel","fromDivPixelToLatLng","Point","x","y","draw","onDrag","removeListener","onDragEnd","getPanes","classList","add","projection","point","transform","onRemove","parentNode","clearInstanceListeners","removeChild","OverlayView","propTypes","element","isRequired","string","shape","number","object","bool","func","zIndex","children","useMemo","div","overlay","childrenProps","props","prev","setMap","createPortal","defaultProps","node","noop","MapMarkers","markers","Children","child","isValidElement","_ref2","_ref2$draggable","_ref2$onDragStart","_ref2$onDrag","_ref2$onDragEnd","cloneElement","_extends","React","EPS","MapComponent","defaultCenter","defaultZoom","onGoogleApiLoaded","onChange","options","events","mapRef","prevBoundsRef","_useState2","setMaps","_useState3","googleApiCalled","setGoogleApiCalled","onIdle","useCallback","zoom","getZoom","bounds","getBounds","centerLatLng","getCenter","ne","getNorthEast","sw","getSouthWest","boundsArray","center","console","error","google","Map","ref","clearListeners","addListener","Fragment","className","reduce","acc","_temp","name","handler","width","height","margin","padding","oneOfType","arrayOf","GoogleMap","forwardRef","loadingContent","idleContent","errorContent","mapMinHeight","containerProps","scriptCallback","_objectWithoutPropertiesLoose","_excluded","renderers","ready","loading","idle","_status","overflow","minHeight","oneOf"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,IAAMA,SAAS,GAAG,SAAZA,SAASA,CACrBC,MAAM,EAMNC,YAAY,EACR;EAAA,IAPJD,MAAM;IAANA,MAAM,GAAG;MACRE,GAAG,EAAE,EAAE;MACPC,UAAU,EAAE,EAAE;MACdC,SAAS,EAAE;QAAEC,cAAc,EAAE,IAAI;QAAEC,eAAe,EAAE;OAAM;MAC1DC,iBAAiB,EAAE;KACnB;;EAAA,IACDN,YAAY;IAAZA,YAAY,GAAGO,SAAS;;EAGxB,IAAAC,SAAA,GAA4BC,QAAQ,CAACV,MAAM,CAACE,GAAG,GAAG,SAAS,GAAG,MAAM,CAAC;IAA9DS,MAAM,GAAAF,SAAA;IAAEG,SAAS,GAAAH,SAAA;EAExBI,SAAS,CACR,YAAM;IAAA,IAAAC,iBAAA,EAAAC,kBAAA;IACL,IAAId,YAAY,EAAE;MACjBW,SAAS,CAACX,YAAY,CAAC;MACvB,OAAO,YAAM,EAEZ;;IAIF,IAAI,CAACD,MAAM,CAACE,GAAG,EAAE;MAChBU,SAAS,CAAC,MAAM,CAAC;MACjB;;IAID,IAAII,WAAW,GAAGC,QAAQ,CAACC,aAAa,mBAAgBlB,MAAM,CAACE,GAAG,QAAI,CAAC;IACvE,IAA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CAAC/D,IAAI,CAAC,CAAC,CAAC;EAI1CkE,cAAc,EAAElE,IAAI;EAIpBmE,WAAW,EAAEnE,IAAI;EAIjBoE,YAAY,EAAEpE,IAAI;EAIlBqE,YAAY,EAAEP,SAAS,CAAC,CAAC7E,MAAM,EAAEF,MAAM,CAAC,CAAC;EAIzCuF,cAAc,EAAEpF,MAAM;EAOtBzF,oBAAoB,EAAE0F,IAAI;EAK1B/H,MAAM,EAAE6N,KAAK,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;EAKpDV,cAAc,EAAEnF,IAAI;EAKpBzF,iBAAiB,EAAEuF;AAAM,EACzB;;;;"}
|
|
1
|
+
{"version":3,"file":"index.modern.js","sources":["../src/hooks/useScript.js","../src/hooks/useGoogleMaps.js","../src/utils/utils.js","../src/hooks/useMemoCompare.js","../src/map/overlay.js","../src/map/overlay-view.js","../src/map/markers.js","../src/map/map.js","../src/google-map.js"],"sourcesContent":["/* eslint-disable no-unused-expressions */\nimport { useEffect, useState } from 'react'\n\n/**\n * @description Hook to load external script.\n * @param {Object} script - Script to load.\n * @param {string} script.src - Script source.\n * @param {Object} [script.attributes] - Attributes to add to the script tag.\n * @param {Object} [script.callbacks] - Callbacks executed on completion.\n * @param {Function} [script.callbacks.onLoadCallback] - Callback executed on completion in case of success.\n * @param {Function} [script.callbacks.onErrorCallback] - Callbacks executed on completion in case of error.\n * @param {string} [script.elementIdToAppend] - HTML element id to append the script to. Default is HTML HEAD.\n * @returns {\"idle\" | \"loading\" | \"ready\" | \"error\"} status\n *\n * @example\n * const status = useScript({\n * \t\tsrc: \"https://script-to-load.js\",\n * \t\tattributes: { id: \"scriptId\", class: \"script-class\" },\n * \t\tcallbacks: {\n * \t\t\tonLoadCallback: onLoadFunc,\n * \t\t\tonErrorCallback: onErrorFunc,\n * \t\t},\n * \t\telementIdToAppend: \"script-container\"\n * })\n */\n\nexport const useScript = (\n\tscript = {\n\t\tsrc: '',\n\t\tattributes: {},\n\t\tcallbacks: { onLoadCallback: null, onErrorCallback: null },\n\t\telementIdToAppend: null,\n\t},\n\tforcedStatus = undefined,\n) => {\n\t// Keep track of script status (\"idle\", \"loading\", \"ready\", \"error\")\n\tconst [status, setStatus] = useState(script.src ? 'loading' : 'idle')\n\n\tuseEffect(\n\t\t() => {\n\t\t\tif (forcedStatus) {\n\t\t\t\tsetStatus(forcedStatus)\n\t\t\t\treturn () => {\n\t\t\t\t\t// do nothing\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Allow falsy src value if waiting on other data needed for\n\t\t\t// constructing the script URL passed to this hook.\n\t\t\tif (!script.src) {\n\t\t\t\tsetStatus('idle')\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Fetch existing script element by src\n\t\t\t// It may have been added by another instance of this hook\n\t\t\tlet scriptToAdd = document.querySelector(`script[src=\"${script.src}\"]`)\n\t\t\tif (!scriptToAdd) {\n\t\t\t\t// Create script\n\t\t\t\tscriptToAdd = document.createElement('script')\n\t\t\t\tscriptToAdd.src = script.src\n\t\t\t\tscriptToAdd.async = true\n\t\t\t\tscriptToAdd.setAttribute('data-status', 'loading')\n\t\t\t\t// Add other script attributes, if they exist\n\t\t\t\tscript.attributes && Object.entries(script.attributes).length > 0\n\t\t\t\t\t? Object.entries(script.attributes).map(([key, value]) => scriptToAdd.setAttribute(key, value))\n\t\t\t\t\t: null\n\t\t\t\t// Add script to document body\n\t\t\t\tif (script.elementIdToAppend && document.getElementById(script.elementIdToAppend)) {\n\t\t\t\t\tdocument.getElementById(script.elementIdToAppend).appendChild(scriptToAdd)\n\t\t\t\t} else {\n\t\t\t\t\tdocument.body.appendChild(scriptToAdd)\n\t\t\t\t}\n\t\t\t\t// Store status in attribute on script\n\t\t\t\t// This can be read by other instances of this hook\n\t\t\t\tconst setAttributeFromEvent = (event) => {\n\t\t\t\t\tscriptToAdd.setAttribute('data-status', event.type === 'load' ? 'ready' : 'error')\n\t\t\t\t}\n\t\t\t\tscriptToAdd.addEventListener('load', setAttributeFromEvent)\n\t\t\t\tscriptToAdd.addEventListener('error', setAttributeFromEvent)\n\t\t\t} else {\n\t\t\t\t// Grab existing script status from attribute and set to state.\n\t\t\t\tconst currentScriptStatus = scriptToAdd.getAttribute('data-status')\n\t\t\t\tswitch (currentScriptStatus) {\n\t\t\t\t\tcase 'load':\n\t\t\t\t\tcase 'ready':\n\t\t\t\t\t\tscript.callbacks?.onLoadCallback ? script.callbacks.onLoadCallback() : null\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\tscript.callbacks?.onErrorCallback ? script.callbacks.onErrorCallback() : null\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// loading: do nothing\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tsetStatus(currentScriptStatus)\n\t\t\t}\n\t\t\t// Script event handler to update status in state\n\t\t\t// Note: Even if the script already exists we still need to add\n\t\t\t// event handlers to update the state for this hook instance.\n\t\t\tconst setStateFromEvent = (event) => {\n\t\t\t\tevent.type === 'load'\n\t\t\t\t\t? script.callbacks?.onLoadCallback\n\t\t\t\t\t\t? script.callbacks.onLoadCallback()\n\t\t\t\t\t\t: null\n\t\t\t\t\t: script.callbacks?.onErrorCallback\n\t\t\t\t\t? script.callbacks.onErrorCallback()\n\t\t\t\t\t: null\n\t\t\t\tsetStatus(event.type === 'load' ? 'ready' : 'error')\n\t\t\t}\n\t\t\t// Add event listeners\n\t\t\tscriptToAdd.addEventListener('load', setStateFromEvent)\n\t\t\tscriptToAdd.addEventListener('error', setStateFromEvent)\n\t\t\t// Remove event listeners on cleanup\n\t\t\treturn () => {\n\t\t\t\tif (scriptToAdd) {\n\t\t\t\t\tscriptToAdd.removeEventListener('load', setStateFromEvent)\n\t\t\t\t\tscriptToAdd.removeEventListener('error', setStateFromEvent)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Re-run useEffect if script changes\n\t\t[script, forcedStatus, status],\n\t)\n\n\treturn status\n}\n","import { useScript } from './useScript'\n\n/**\n * @returns {\"idle\" | \"loading\" | \"ready\" | \"error\"} status\n */\nexport const useGoogleMaps = ({\n\tapiKey,\n\tlibraries = [],\n\tloadScriptExternally = false,\n\tstatus = 'idle',\n\texternalApiParams,\n\tcallback,\n}) => {\n\t// eslint-disable-next-line no-undef\n\tif (typeof window !== 'undefined') window.googleMapsCallback = callback\n\tconst apiParams = new URLSearchParams(externalApiParams)?.toString()\n\tconst script = apiKey\n\t\t? {\n\t\t\t\tsrc: `https://maps.googleapis.com/maps/api/js?key=${apiKey}&callback=googleMapsCallback&libraries=${libraries?.join(\n\t\t\t\t\t',',\n\t\t\t\t)}${apiParams ? '&' + apiParams : ''}`,\n\t\t\t\tattributes: { id: 'googleMapsApi' },\n\t\t }\n\t\t: {\n\t\t\t\tsrc: `https://maps.googleapis.com/maps/api/js?callback=googleMapsCallback&libraries=${libraries?.join(',')}`,\n\t\t\t\tattributes: { id: 'googleMapsApi' },\n\t\t }\n\n\treturn useScript(script, loadScriptExternally ? status : undefined)\n}\n","export const isArraysEqualEps = (arrayA, arrayB, eps) => {\n\tif (arrayA && arrayB) {\n\t\tfor (let i = 0; i !== arrayA.length; ++i) {\n\t\t\tif (Math.abs(arrayA[i] - arrayB[i]) > eps) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n","import { useEffect, useRef } from 'react'\n\n/**\n * A hook that compares the previous and current values of a reference.\n * @param {any} value - the current value of the reference\n * @param {function} compare - a function that compares the previous and current values\n * @returns {any} the previous value of the reference\n * @ref https://usehooks.com/useMemoCompare/\n */\nconst useMemoCompare = (next, compare) => {\n\t// Ref for storing previous value\n\tconst previousRef = useRef()\n\tconst previous = previousRef.current\n\t// Pass previous and next value to compare function\n\t// to determine whether to consider them equal.\n\tconst isEqual = compare(previous, next)\n\t// If not equal update previousRef to next value.\n\t// We only update if not equal so that this hook continues to return\n\t// the same old value if compare keeps returning true.\n\tuseEffect(() => {\n\t\tif (!isEqual) {\n\t\t\tpreviousRef.current = next\n\t\t}\n\t})\n\t// Finally, if equal then return the previous value\n\treturn isEqual ? previous : next\n}\n\nexport default useMemoCompare\n","import { bool, element, func, number, object, shape, string } from 'prop-types'\n\n// return lat, lng from LatLngLiteral\nconst getLatLng = (LatLng) => {\n\ttry {\n\t\tconst latLng = { lat: LatLng.lat(), lng: LatLng.lng() }\n\t\treturn latLng\n\t} catch (e) {\n\t\treturn LatLng\n\t}\n}\n\n/**\n * @param {HTMLElement} container - The HTML container element for the overlay.\n * @param {google.maps.MapPanes} pane - The HTML container element for the overlay.\n * @param {google.maps.LatLng | google.maps.LatLngLiteral} position - The geographical location of the overlay.\n * @param {google.maps} maps - The Google Maps API.\n * @param {object} drag - The drag configuration of the overlay.\n * @param {boolean} drag.draggable - If true, the marker can be dragged. Default value is false.\n * @param {function} drag.onDragStart - This event is fired when the user starts dragging the marker.\n * @param {function} drag.onDrag - This event is repeatedly fired while the user drags the marker.\n * @param {function} drag.onDragEnd - This event is fired when the user stops dragging the marker.\n * @returns {void}\n */\nconst createOverlay = ({ container, pane, position, maps, drag }) => {\n\tclass Overlay extends maps.OverlayView {\n\t\tconstructor(container, pane, position) {\n\t\t\tsuper()\n\t\t\tthis.container = container\n\t\t\tthis.pane = pane\n\t\t\tthis.position = position\n\t\t}\n\n\t\t/**\n\t\t * onAdd is called when the map's panes are ready and the overlay has been\n\t\t * added to the map.\n\t\t */\n\t\tonAdd = () => {\n\t\t\tlet that = this\n\t\t\t// manage draggable\n\t\t\tif (drag?.draggable) {\n\t\t\t\tmaps.event.addDomListener(this.get('map').getDiv(), 'mouseleave', () => {\n\t\t\t\t\tmaps.event.trigger(container, 'mouseup')\n\t\t\t\t})\n\t\t\t\tmaps.event.addDomListener(this.container, 'mousedown', (e) => {\n\t\t\t\t\tthis.container.style.cursor = 'grabbing'\n\t\t\t\t\tthat.map.set('draggable', false)\n\t\t\t\t\tthat.set('origin', e)\n\n\t\t\t\t\tdrag.onDragStart(e, { latLng: getLatLng(this.position) })\n\n\t\t\t\t\tthat.moveHandler = maps.event.addDomListener(this.get('map').getDiv(), 'mousemove', (e) => {\n\t\t\t\t\t\tlet origin = that.get('origin'),\n\t\t\t\t\t\t\tleft = origin.clientX - e.clientX,\n\t\t\t\t\t\t\ttop = origin.clientY - e.clientY,\n\t\t\t\t\t\t\tpos = that.getProjection().fromLatLngToDivPixel(that.position),\n\t\t\t\t\t\t\tlatLng = that.getProjection().fromDivPixelToLatLng(new maps.Point(pos.x - left, pos.y - top))\n\t\t\t\t\t\tthat.set('position', latLng)\n\t\t\t\t\t\tthat.set('origin', e)\n\t\t\t\t\t\tthat.draw()\n\t\t\t\t\t\tdrag.onDrag(e, { latLng: getLatLng(latLng) })\n\t\t\t\t\t})\n\t\t\t\t})\n\n\t\t\t\tmaps.event.addDomListener(container, 'mouseup', (e) => {\n\t\t\t\t\tthat.map.set('draggable', true)\n\t\t\t\t\tthis.container.style.cursor = 'default'\n\t\t\t\t\tmaps.event.removeListener(that.moveHandler)\n\t\t\t\t\tdrag.onDragEnd(e, { latLng: getLatLng(that.position) })\n\t\t\t\t})\n\t\t\t}\n\t\t\t// Add the element to the pane.\n\t\t\tconst pane = this.getPanes()[this.pane]\n\t\t\tpane?.classList.add('google-map-markers-overlay')\n\t\t\tpane?.appendChild(this.container)\n\t\t}\n\n\t\tdraw = () => {\n\t\t\tconst projection = this.getProjection()\n\t\t\t// Computes the pixel coordinates of the given geographical location in the DOM element that holds the draggable map.\n\t\t\tconst point = projection.fromLatLngToDivPixel(this.position)\n\t\t\tif (point === null) return\n\t\t\tthis.container.style.transform = `translate(${point.x}px, ${point.y}px)`\n\t\t\tthis.container.style.width = '0px'\n\t\t\tthis.container.style.height = '0px'\n\t\t}\n\n\t\t/**\n\t\t * The onRemove() method will be called automatically from the API if\n\t\t * we ever set the overlay's map property to 'null'.\n\t\t */\n\t\tonRemove = () => {\n\t\t\tif (this.container.parentNode !== null) {\n\t\t\t\t// remove DOM listeners\n\t\t\t\tmaps.event.clearInstanceListeners(this.container)\n\t\t\t\tthis.container.parentNode.removeChild(this.container)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn new Overlay(container, pane, position)\n}\n\ncreateOverlay.propTypes = {\n\t/**\n\t * The HTML container element for the overlay.\n\t */\n\tcontainer: element.isRequired,\n\t/**\n\t * The HTML container element for the overlay.\n\t * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n\t * @default 'floatPane'\n\t * @type {google.maps.MapPanes}\n\t * @required\n\t */\n\tpane: string.isRequired,\n\t/**\n\t * The geographical location of the overlay.\n\t * @type {google.maps.LatLng | google.maps.LatLngLiteral}\n\t * @required\n\t * @ref [LatLng](https://developers.google.com/maps/documentation/javascript/reference/coordinates#LatLng)\n\t */\n\tposition: shape({\n\t\tlat: number.isRequired,\n\t\tlng: number.isRequired,\n\t}).isRequired,\n\t/**\n\t * The Google Maps API.\n\t */\n\tmaps: object.isRequired,\n\t/**\n\t * The draggable options of the overlay.\n\t * @type {object}\n\t * @default { draggable: false, onDragStart: noop, onDrag: noop, onDragEnd: noop }\n\t */\n\tdrag: shape({\n\t\tdraggable: bool,\n\t\tonDragStart: func,\n\t\tonDrag: func,\n\t\tonDragEnd: func,\n\t}),\n}\n\nexport default createOverlay\n","import { bool, func, node, number, object, shape, string } from 'prop-types'\nimport { useEffect, useMemo } from 'react'\nimport { createPortal } from 'react-dom'\nimport useMemoCompare from '../hooks/useMemoCompare'\nimport createOverlay from './overlay'\n\n/**\n * @param {google.maps.MapPanes} pane - The pane on which to display the overlay. This is the Pane name, not the Pane itself. Defaults to floatPane.\n * @param {google.maps.LatLng | google.maps.LatLngLiteral} position - The geographical location of the overlay.\n * @param {google.maps.Map} map - The map on which to display the overlay.\n * @param {google.maps} maps - The Google Maps API.\n * @param {number} zIndex - The z-index of the overlay.\n * @param {ReactNode} children - The children of the OverlayView - the Marker component.\n * @param {object} drag - The drag configuration of the overlay.\n * @param {boolean} drag.draggable - If true, the marker can be dragged. Default value is false.\n * @param {function} drag.onDragStart - This event is fired when the user starts dragging the marker.\n * @param {function} drag.onDrag - This event is repeatedly fired while the user drags the marker.\n * @param {function} drag.onDragEnd - This event is fired when the user stops dragging the marker.\n * @returns {void}\n * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n */\nconst OverlayView = ({ pane = 'floatPane', position, map, maps, zIndex = 0, children, drag }) => {\n\tconst container = useMemo(() => {\n\t\t// eslint-disable-next-line no-undef\n\t\tconst div = document.createElement('div')\n\t\tdiv.style.position = 'absolute'\n\t\treturn div\n\t}, [])\n\n\tconst overlay = useMemo(() => {\n\t\treturn createOverlay({ container, pane, position, maps, drag })\n\t}, [container, drag, maps, pane, position])\n\n\t// Because React does not do deep comparisons, a custom hook is used.\n\t// This fixes the issue where the overlay is not updated when the position changes.\n\tconst childrenProps = useMemoCompare(children?.props, (prev, next) => {\n\t\treturn prev && prev.lat === next.lat && prev.lng === next.lng\n\t})\n\n\tuseEffect(() => {\n\t\tif (!overlay.map) {\n\t\t\toverlay?.setMap(map)\n\t\t\treturn () => {\n\t\t\t\toverlay?.setMap(null)\n\t\t\t}\n\t\t}\n\t\t// overlay depends on map, so we don't need to add it to the dependency array\n\t\t// otherwise, it will re-render the overlay every time the map changes\n\t\t//? added childrenProps to the dependency array to re-render the overlay when the children props change.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [map, childrenProps])\n\n\t// to move the container to the foreground and background\n\tuseEffect(() => {\n\t\tcontainer.style.zIndex = `${zIndex}`\n\t}, [zIndex, container])\n\n\treturn createPortal(children, container)\n}\n\nOverlayView.propTypes = {\n\t/**\n\t * The HTML container element for the overlay.\n\t * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n\t * @default 'floatPane'\n\t * @type {google.maps.MapPanes}\n\t */\n\tpane: string,\n\t/**\n\t * The geographical location of the overlay.\n\t * @type {google.maps.LatLng | google.maps.LatLngLiteral}\n\t * @required\n\t * @ref [LatLng](https://developers.google.com/maps/documentation/javascript/reference/coordinates#LatLng)\n\t */\n\tposition: shape({\n\t\tlat: number.isRequired,\n\t\tlng: number.isRequired,\n\t}).isRequired,\n\t/**\n\t * The map on which to display the overlay.\n\t * @type {google.maps.Map}\n\t * @required\n\t * @ref [Map](https://developers.google.com/maps/documentation/javascript/reference/map#Map)\n\t */\n\tmap: object.isRequired,\n\t/**\n\t * The Google Maps API.\n\t * @type {object}\n\t * @required\n\t * @ref [Google Maps API](https://developers.google.com/maps/documentation/javascript/reference)\n\t */\n\tmaps: object.isRequired,\n\t/**\n\t * The z-index of the overlay.\n\t * @type {number}\n\t * @default 0\n\t */\n\tzIndex: number,\n\t/**\n\t * The children of the OverlayView.\n\t * @type {ReactNode}\n\t * @required\n\t * @ref [ReactNode](https://reactjs.org/docs/react-api.html#reactnode)\n\t */\n\tchildren: node.isRequired,\n\t/**\n\t * The drag configuration of the overlay.\n\t * @type {object}\n\t * @default { draggable: false, onDragStart: noop, onDrag: noop, onDragEnd: noop }\n\t */\n\tdrag: shape({\n\t\tdraggable: bool,\n\t\tonDragStart: func,\n\t\tonDrag: func,\n\t\tonDragEnd: func,\n\t}),\n}\n\nexport default OverlayView\n","import { node, object } from 'prop-types'\nimport React, { Children, cloneElement, isValidElement, useMemo } from 'react'\nimport OverlayView from './overlay-view'\n\nconst noop = () => {}\n\nconst MapMarkers = ({ children, map, maps }) => {\n\tconst markers = useMemo(() => {\n\t\tif (!map || !maps) return []\n\n\t\treturn Children.map(children, (child) => {\n\t\t\tif (isValidElement(child)) {\n\t\t\t\tconst latLng = { lat: child.props.lat, lng: child.props.lng }\n\t\t\t\tconst { zIndex, draggable = false, onDragStart = noop, onDrag = noop, onDragEnd = noop } = child.props || {}\n\n\t\t\t\t// clone child without draggable props\n\t\t\t\tchild = cloneElement(child, {\n\t\t\t\t\t...child.props,\n\t\t\t\t\tdraggable: undefined,\n\t\t\t\t\tonDragStart: undefined,\n\t\t\t\t\tonDrag: undefined,\n\t\t\t\t\tonDragEnd: undefined,\n\t\t\t\t})\n\n\t\t\t\treturn (\n\t\t\t\t\t<OverlayView\n\t\t\t\t\t\tposition={latLng}\n\t\t\t\t\t\tmap={map}\n\t\t\t\t\t\tmaps={maps}\n\t\t\t\t\t\tzIndex={zIndex}\n\t\t\t\t\t\tdrag={{\n\t\t\t\t\t\t\tdraggable,\n\t\t\t\t\t\t\tonDragStart,\n\t\t\t\t\t\t\tonDrag,\n\t\t\t\t\t\t\tonDragEnd,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{child}\n\t\t\t\t\t</OverlayView>\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t}, [children, map, maps])\n\n\treturn <div>{markers}</div>\n}\n\nMapMarkers.propTypes = {\n\t/**\n\t * The Markers on the Map.\n\t * @type {ReactNode}\n\t * @required\n\t */\n\tchildren: node.isRequired,\n\t/**\n\t * The Google Maps instance.\n\t * @type {object}\n\t * @required\n\t */\n\tmap: object,\n\t/**\n\t * The Google Maps API.\n\t * @type {object}\n\t * @required\n\t */\n\tmaps: object.isRequired,\n}\n\nexport default MapMarkers\n","import { arrayOf, func, node, number, object, oneOfType, shape, string } from 'prop-types'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { isArraysEqualEps } from '../utils/utils'\nimport MapMarkers from './markers'\n\nconst EPS = 0.00001\n\nconst MapComponent = ({\n\tchildren = null,\n\tstyle = {\n\t\twidth: '100%',\n\t\theight: '100%',\n\t\tleft: 0,\n\t\ttop: 0,\n\t\tmargin: 0,\n\t\tpadding: 0,\n\t\tposition: 'absolute',\n\t},\n\tdefaultCenter,\n\tdefaultZoom,\n\tonGoogleApiLoaded = () => {},\n\tonChange = () => {},\n\toptions = {},\n\tevents = [],\n}) => {\n\tconst mapRef = useRef(null)\n\tconst prevBoundsRef = useRef(null)\n\tconst [map, setMap] = useState(null)\n\tconst [maps, setMaps] = useState(null)\n\tconst [googleApiCalled, setGoogleApiCalled] = useState(false)\n\n\tconst onIdle = useCallback(() => {\n\t\ttry {\n\t\t\tconst zoom = map.getZoom()\n\t\t\tconst bounds = map.getBounds()\n\t\t\tconst centerLatLng = map.getCenter()\n\n\t\t\tconst ne = bounds.getNorthEast()\n\t\t\tconst sw = bounds.getSouthWest()\n\t\t\tconst boundsArray = [sw.lng(), sw.lat(), ne.lng(), ne.lat()]\n\n\t\t\tif (!isArraysEqualEps(boundsArray, prevBoundsRef.current, EPS)) {\n\t\t\t\tif (onChange) {\n\t\t\t\t\tonChange({\n\t\t\t\t\t\tzoom,\n\t\t\t\t\t\tcenter: [centerLatLng.lng(), centerLatLng.lat()],\n\t\t\t\t\t\tbounds,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tprevBoundsRef.current = boundsArray\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t}\n\t}, [map, onChange])\n\n\tuseEffect(() => {\n\t\tif (mapRef.current && !map) {\n\t\t\tsetMap(\n\t\t\t\tnew window.google.maps.Map(mapRef.current, {\n\t\t\t\t\tcenter: defaultCenter,\n\t\t\t\t\tzoom: defaultZoom,\n\t\t\t\t\t...options,\n\t\t\t\t}),\n\t\t\t)\n\t\t\tsetMaps(window.google.maps)\n\t\t}\n\t}, [defaultCenter, defaultZoom, map, mapRef, options])\n\n\tuseEffect(() => {\n\t\tif (map) {\n\t\t\tif (!googleApiCalled) {\n\t\t\t\tonGoogleApiLoaded({ map, maps, ref: mapRef.current })\n\t\t\t\tsetGoogleApiCalled(true)\n\t\t\t}\n\n\t\t\twindow.google.maps.event.clearListeners(map, 'idle')\n\t\t\t// Idle event is fired when the map becomes idle after panning or zooming.\n\t\t\twindow.google.maps.event.addListener(map, 'idle', onIdle)\n\t\t}\n\t}, [googleApiCalled, map, maps, onChange, onGoogleApiLoaded, onIdle])\n\n\tuseEffect(() => {\n\t\t// clear listeners on unmount\n\t\treturn () => {\n\t\t\tif (map) {\n\t\t\t\twindow.google.maps.event.clearListeners(map, 'idle')\n\t\t\t}\n\t\t}\n\t}, [map])\n\n\treturn (\n\t\t<React.Fragment>\n\t\t\t<div\n\t\t\t\tref={mapRef}\n\t\t\t\tstyle={style}\n\t\t\t\tclassName=\"google-map\"\n\t\t\t\t// spread the events as props\n\t\t\t\t{...events?.reduce((acc, { name, handler } = {}) => {\n\t\t\t\t\tacc[name] = handler\n\t\t\t\t\treturn acc\n\t\t\t\t}, {})}\n\t\t\t/>\n\t\t\t{children && map && maps && (\n\t\t\t\t<MapMarkers map={map} maps={maps}>\n\t\t\t\t\t{children}\n\t\t\t\t</MapMarkers>\n\t\t\t)}\n\t\t</React.Fragment>\n\t)\n}\n\nMapComponent.propTypes = {\n\t/**\n\t * The Markers on the Map.\n\t */\n\tchildren: oneOfType([arrayOf(node), node]),\n\tstyle: object,\n\tdefaultCenter: object.isRequired,\n\tdefaultZoom: number.isRequired,\n\tonGoogleApiLoaded: func,\n\tonChange: func,\n\toptions: object,\n\t/**\n\t * The events to pass to the Google Maps instance (`div`).\n\t * @type {Array}\n\t * @example\n\t * [\n\t * {\n\t * name: 'onClick',\n\t * handler: (event) => { ... }\n\t * }\n\t * ]\n\t */\n\tevents: arrayOf(\n\t\tshape({\n\t\t\tname: string.isRequired,\n\t\t\thandler: func.isRequired,\n\t\t}),\n\t),\n}\n\nexport default MapComponent\n","import { arrayOf, bool, func, node, number, object, oneOf, oneOfType, string } from 'prop-types'\nimport React, { forwardRef } from 'react'\nimport { useGoogleMaps } from './hooks/useGoogleMaps'\nimport MapComponent from './map/map'\n\nconst GoogleMap = forwardRef(function GoogleMap(\n\t{\n\t\tapiKey = '',\n\t\tlibraries = ['places', 'geometry'],\n\t\tchildren = null,\n\t\tloadingContent = 'Google Maps is loading',\n\t\tidleContent = 'Google Maps is on idle',\n\t\terrorContent = 'Google Maps is on error',\n\t\tmapMinHeight = 'unset',\n\t\tcontainerProps = {},\n\t\tloadScriptExternally = false,\n\t\tstatus = 'idle',\n\t\tscriptCallback = () => {},\n\t\texternalApiParams = {},\n\t\t...props\n\t},\n\tref,\n) {\n\tconst renderers = {\n\t\tready: <MapComponent {...props}>{children}</MapComponent>,\n\t\tloading: loadingContent,\n\t\tidle: idleContent,\n\t\terror: errorContent,\n\t}\n\n\tconst _status = useGoogleMaps({\n\t\tapiKey,\n\t\tlibraries,\n\t\tloadScriptExternally,\n\t\tstatus,\n\t\texternalApiParams,\n\t\tcallback: scriptCallback,\n\t})\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{ height: '100%', width: '100%', overflow: 'hidden', position: 'relative', minHeight: mapMinHeight }}\n\t\t\tref={ref}\n\t\t\t{...containerProps}\n\t\t>\n\t\t\t{renderers[_status] || null}\n\t\t</div>\n\t)\n})\n\nGoogleMap.propTypes = {\n\t...MapComponent.propTypes,\n\t/**\n\t * The Markers on the Map.\n\t */\n\tchildren: oneOfType([node, arrayOf(node)]),\n\t/**\n\t * Content to be displayed while the map is loading.\n\t */\n\tloadingContent: node,\n\t/**\n\t * Content to be displayed while the map is idle.\n\t */\n\tidleContent: node,\n\t/**\n\t * Content to be displayed when there is an error loading the map.\n\t */\n\terrorContent: node,\n\t/**\n\t * The minimum height of the map.\n\t */\n\tmapMinHeight: oneOfType([number, string]),\n\t/**\n\t * Props to be passed to the container div.\n\t */\n\tcontainerProps: object,\n\t/**\n\t * Whether to load the Google Maps script externally.\n\t * If true, the status prop will be used to control the loading of the script.\n\t * If false, the script will be loaded automatically.\n\t * @default false\n\t */\n\tloadScriptExternally: bool,\n\t/**\n\t * The forced status of the Google Maps script.\n\t * @default 'idle'\n\t */\n\tstatus: oneOf(['idle', 'loading', 'ready', 'error']),\n\t/**\n\t * The callback function to pass to the Google Maps script.\n\t * @default () => {}\n\t */\n\tscriptCallback: func,\n\t/**\n\t * Prop to be passed on to google map api while loading the script such as region & language\n\t * e.g. {region: 'JP', language: 'ja'} can be used to localize map in japanese\n\t */\n\texternalApiParams: object,\n}\n\nexport default GoogleMap\n"],"names":["useScript","script","forcedStatus","src","attributes","callbacks","onLoadCallback","onErrorCallback","elementIdToAppend","undefined","_useState","useState","status","setStatus","useEffect","_script$callbacks","_script$callbacks2","scriptToAdd","document","querySelector","createElement","async","setAttribute","Object","entries","length","map","_ref","key","value","getElementById","appendChild","body","setAttributeFromEvent","event","type","addEventListener","currentScriptStatus","getAttribute","setStateFromEvent","_script$callbacks3","_script$callbacks4","removeEventListener","useGoogleMaps","_URLSearchParams","apiKey","_ref$libraries","libraries","_ref$loadScriptExtern","loadScriptExternally","_ref$status","externalApiParams","callback","window","googleMapsCallback","apiParams","URLSearchParams","toString","join","id","isArraysEqualEps","arrayA","arrayB","eps","i","Math","abs","useMemoCompare","next","compare","previousRef","useRef","previous","current","isEqual","getLatLng","LatLng","latLng","lat","lng","e","createOverlay","container","pane","position","maps","drag","Overlay","_maps$OverlayView","_inheritsLoose","_this","call","onAdd","that","_assertThisInitialized","draggable","addDomListener","get","getDiv","trigger","style","cursor","set","onDragStart","moveHandler","origin","left","clientX","top","clientY","pos","getProjection","fromLatLngToDivPixel","fromDivPixelToLatLng","Point","x","y","draw","onDrag","removeListener","onDragEnd","getPanes","classList","add","projection","point","transform","width","height","onRemove","parentNode","clearInstanceListeners","removeChild","OverlayView","propTypes","element","isRequired","string","shape","number","object","bool","func","_ref$pane","_ref$zIndex","zIndex","children","useMemo","div","overlay","childrenProps","props","prev","setMap","createPortal","node","noop","MapMarkers","markers","Children","child","isValidElement","_ref2","_ref2$draggable","_ref2$onDragStart","_ref2$onDrag","_ref2$onDragEnd","cloneElement","_extends","React","EPS","MapComponent","_ref$children","_ref$style","margin","padding","defaultCenter","defaultZoom","_ref$onGoogleApiLoade","onGoogleApiLoaded","_ref$onChange","onChange","_ref$options","options","_ref$events","events","mapRef","prevBoundsRef","_useState2","setMaps","_useState3","googleApiCalled","setGoogleApiCalled","onIdle","useCallback","zoom","getZoom","bounds","getBounds","centerLatLng","getCenter","ne","getNorthEast","sw","getSouthWest","boundsArray","center","console","error","google","Map","ref","clearListeners","addListener","Fragment","className","reduce","acc","_temp","name","handler","oneOfType","arrayOf","GoogleMap","forwardRef","_ref$apiKey","_ref$loadingContent","loadingContent","_ref$idleContent","idleContent","_ref$errorContent","errorContent","_ref$mapMinHeight","mapMinHeight","_ref$containerProps","containerProps","_ref$scriptCallback","scriptCallback","_ref$externalApiParam","_objectWithoutPropertiesLoose","_excluded","renderers","ready","loading","idle","_status","overflow","minHeight","oneOf"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,IAAMA,SAAS,GAAG,SAAZA,SAASA,CACrBC,MAAM,EAMNC,YAAY,EACR;EAAA,IAPJD,MAAM;IAANA,MAAM,GAAG;MACRE,GAAG,EAAE,EAAE;MACPC,UAAU,EAAE,EAAE;MACdC,SAAS,EAAE;QAAEC,cAAc,EAAE,IAAI;QAAEC,eAAe,EAAE;OAAM;MAC1DC,iBAAiB,EAAE;KACnB;;EAAA,IACDN,YAAY;IAAZA,YAAY,GAAGO,SAAS;;EAGxB,IAAAC,SAAA,GAA4BC,QAAQ,CAACV,MAAM,CAACE,GAAG,GAAG,SAAS,GAAG,MAAM,CAAC;IAA9DS,MAAM,GAAAF,SAAA;IAAEG,SAAS,GAAAH,SAAA;EAExBI,SAAS,CACR,YAAM;IAAA,IAAAC,iBAAA,EAAAC,kBAAA;IACL,IAAId,YAAY,EAAE;MACjBW,SAAS,CAACX,YAAY,CAAC;MACvB,OAAO,YAAM,EAEZ;;IAIF,IAAI,CAACD,MAAM,CAACE,GAAG,EAAE;MAChBU,SAAS,CAAC,MAAM,CAAC;MACjB;;IAID,IAAII,WAAW,GAAGC,QAAQ,CAACC,aAAa,mBAAgBlB,MAAM,CAACE,GAAG,QAAI,CAAC;IACvE,IAAI,CAACc,WAAW,EAAE;MAEjBA,WAAW,GAAGC,QAAQ,CAACE,aAAa,CAAC,QAAQ,CAAC;MAC9CH,WAAW,CAACd,GAAG,GAAGF,MAAM,CA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,EAANA,MAAM;IACNuC,iBAAiB,EAAjBA,iBAAiB;IACjBC,QAAQ,EAAEyL;GACV,CAAC;EAEF,oBACCpE,KAAA,CAAArJ,aAAA,QAAAoJ,QAAA;IACCpE,KAAK,EAAE;MAAE4B,MAAM,EAAE,MAAM;MAAED,KAAK,EAAE,MAAM;MAAEuH,QAAQ,EAAE,QAAQ;MAAElK,QAAQ,EAAE,UAAU;MAAEmK,SAAS,EAAEd;KAAe;IAC5GtB,GAAG,EAAEA;KACDwB,cAAc,GAEjBM,SAAS,CAACI,OAAO,CAAC,IAAI,IACnB,CAAC;AAER,CAAC,CAAC;AAEFtB,SAAS,CAACzF,SAAS,GAAAkC,QAAA,KACfG,YAAY,CAACrC,SAAS;EAIzBY,QAAQ,EAAE2E,SAAS,CAAC,CAAClE,IAAI,EAAEmE,OAAO,CAACnE,IAAI,CAAC,CAAC,CAAC;EAI1CwE,cAAc,EAAExE,IAAI;EAIpB0E,WAAW,EAAE1E,IAAI;EAIjB4E,YAAY,EAAE5E,IAAI;EAIlB8E,YAAY,EAAEZ,SAAS,CAAC,CAAClF,MAAM,EAAEF,MAAM,CAAC,CAAC;EAIzCkG,cAAc,EAAE/F,MAAM;EAOtB3F,oBAAoB,EAAE4F,IAAI;EAK1BjI,MAAM,EAAE4O,KAAK,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;EAKpDX,cAAc,EAAE/F,IAAI;EAKpB3F,iBAAiB,EAAEyF;AAAM,EACzB;;;;"}
|
package/dist/map/map.d.ts
CHANGED
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
export default MapComponent;
|
|
2
|
-
declare function MapComponent({ children, style, defaultCenter, defaultZoom, onGoogleApiLoaded, onChange,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
declare function MapComponent({ children, style, defaultCenter, defaultZoom, onGoogleApiLoaded, onChange, options, events, }: {
|
|
3
|
+
children?: any;
|
|
4
|
+
style?: {
|
|
5
|
+
width: string;
|
|
6
|
+
height: string;
|
|
7
|
+
left: number;
|
|
8
|
+
top: number;
|
|
9
|
+
margin: number;
|
|
10
|
+
padding: number;
|
|
11
|
+
position: string;
|
|
12
|
+
};
|
|
6
13
|
defaultCenter: any;
|
|
7
14
|
defaultZoom: any;
|
|
8
|
-
onGoogleApiLoaded
|
|
9
|
-
onChange
|
|
15
|
+
onGoogleApiLoaded?: () => void;
|
|
16
|
+
onChange?: () => void;
|
|
17
|
+
options?: {};
|
|
18
|
+
events?: any[];
|
|
10
19
|
}): any;
|
|
11
20
|
declare namespace MapComponent {
|
|
12
|
-
namespace defaultProps {
|
|
13
|
-
namespace style {
|
|
14
|
-
const width: string;
|
|
15
|
-
const height: string;
|
|
16
|
-
const left: number;
|
|
17
|
-
const top: number;
|
|
18
|
-
const margin: number;
|
|
19
|
-
const padding: number;
|
|
20
|
-
const position: string;
|
|
21
|
-
}
|
|
22
|
-
function onGoogleApiLoaded(): void;
|
|
23
|
-
function onChange(): void;
|
|
24
|
-
}
|
|
25
21
|
namespace propTypes {
|
|
26
|
-
export
|
|
22
|
+
export let children: any;
|
|
27
23
|
export { object as style };
|
|
28
|
-
export
|
|
29
|
-
export
|
|
24
|
+
export let defaultCenter: any;
|
|
25
|
+
export let defaultZoom: any;
|
|
30
26
|
export { func as onGoogleApiLoaded };
|
|
31
27
|
export { func as onChange };
|
|
28
|
+
export { object as options };
|
|
29
|
+
export let events: any[];
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
32
|
//# sourceMappingURL=map.d.ts.map
|
package/dist/map/map.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/map/map.js"],"names":[],"mappings":";AAOA
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/map/map.js"],"names":[],"mappings":";AAOA;;;;;;;;;;;;;;;;;QAuGC"}
|
package/dist/map/markers.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ declare function MapMarkers({ children, map, maps }: {
|
|
|
6
6
|
}): any;
|
|
7
7
|
declare namespace MapMarkers {
|
|
8
8
|
namespace propTypes {
|
|
9
|
-
export
|
|
9
|
+
export let children: ReactNode;
|
|
10
10
|
export { object as map };
|
|
11
|
-
export
|
|
11
|
+
export let maps: object;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=markers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../src/map/markers.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../src/map/markers.js"],"names":[],"mappings":";AAMA;;;;QAuCC;;;;;yBAiBU,MAAM"}
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
export default OverlayView;
|
|
2
2
|
/**
|
|
3
|
-
* @param {HTMLElement} container
|
|
4
3
|
* @param {google.maps.MapPanes} pane - The pane on which to display the overlay. This is the Pane name, not the Pane itself. Defaults to floatPane.
|
|
5
|
-
* @param {google.maps.LatLng | google.maps.LatLngLiteral} position
|
|
4
|
+
* @param {google.maps.LatLng | google.maps.LatLngLiteral} position - The geographical location of the overlay.
|
|
5
|
+
* @param {google.maps.Map} map - The map on which to display the overlay.
|
|
6
|
+
* @param {google.maps} maps - The Google Maps API.
|
|
7
|
+
* @param {number} zIndex - The z-index of the overlay.
|
|
8
|
+
* @param {ReactNode} children - The children of the OverlayView - the Marker component.
|
|
9
|
+
* @param {object} drag - The drag configuration of the overlay.
|
|
10
|
+
* @param {boolean} drag.draggable - If true, the marker can be dragged. Default value is false.
|
|
11
|
+
* @param {function} drag.onDragStart - This event is fired when the user starts dragging the marker.
|
|
12
|
+
* @param {function} drag.onDrag - This event is repeatedly fired while the user drags the marker.
|
|
13
|
+
* @param {function} drag.onDragEnd - This event is fired when the user stops dragging the marker.
|
|
6
14
|
* @returns {void}
|
|
7
15
|
* @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)
|
|
8
16
|
*/
|
|
9
|
-
declare function OverlayView({
|
|
17
|
+
declare function OverlayView({ pane, position, map, maps, zIndex, children, drag }: google.maps.MapPanes): void;
|
|
10
18
|
declare namespace OverlayView {
|
|
11
|
-
namespace defaultProps {
|
|
12
|
-
const zIndex: number;
|
|
13
|
-
}
|
|
14
19
|
namespace propTypes {
|
|
15
20
|
export { string as pane };
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
21
|
+
export let position: google.maps.LatLng | google.maps.LatLngLiteral;
|
|
22
|
+
export let map: google.maps.Map;
|
|
23
|
+
export let maps: object;
|
|
19
24
|
export { number as zIndex };
|
|
20
|
-
export
|
|
25
|
+
export let children: ReactNode;
|
|
26
|
+
export let drag: object;
|
|
21
27
|
}
|
|
22
28
|
}
|
|
23
29
|
//# sourceMappingURL=overlay-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay-view.d.ts","sourceRoot":"","sources":["../../src/map/overlay-view.js"],"names":[],"mappings":";AAMA
|
|
1
|
+
{"version":3,"file":"overlay-view.d.ts","sourceRoot":"","sources":["../../src/map/overlay-view.js"],"names":[],"mappings":";AAMA;;;;;;;;;;;;;;GAcG;AACH,2GAHa,IAAI,CAwChB;;;;6BAYU,8CAA8C;;yBAiB9C,MAAM;;;yBAoBN,MAAM"}
|
package/dist/map/overlay.d.ts
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
export default createOverlay;
|
|
2
2
|
/**
|
|
3
|
-
* @param {HTMLElement} container
|
|
4
|
-
* @param {google.maps.MapPanes} pane
|
|
5
|
-
* @param {google.maps.LatLng | google.maps.LatLngLiteral} position
|
|
6
|
-
* @param {google.maps} maps
|
|
3
|
+
* @param {HTMLElement} container - The HTML container element for the overlay.
|
|
4
|
+
* @param {google.maps.MapPanes} pane - The HTML container element for the overlay.
|
|
5
|
+
* @param {google.maps.LatLng | google.maps.LatLngLiteral} position - The geographical location of the overlay.
|
|
6
|
+
* @param {google.maps} maps - The Google Maps API.
|
|
7
|
+
* @param {object} drag - The drag configuration of the overlay.
|
|
8
|
+
* @param {boolean} drag.draggable - If true, the marker can be dragged. Default value is false.
|
|
9
|
+
* @param {function} drag.onDragStart - This event is fired when the user starts dragging the marker.
|
|
10
|
+
* @param {function} drag.onDrag - This event is repeatedly fired while the user drags the marker.
|
|
11
|
+
* @param {function} drag.onDragEnd - This event is fired when the user stops dragging the marker.
|
|
7
12
|
* @returns {void}
|
|
8
13
|
*/
|
|
9
|
-
declare function createOverlay({ container, pane, position, maps }: HTMLElement): void;
|
|
14
|
+
declare function createOverlay({ container, pane, position, maps, drag }: HTMLElement): void;
|
|
10
15
|
declare namespace createOverlay {
|
|
11
16
|
namespace propTypes {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
let container: any;
|
|
18
|
+
let pane: google.maps.MapPanes;
|
|
19
|
+
let position: google.maps.LatLng | google.maps.LatLngLiteral;
|
|
20
|
+
let maps: any;
|
|
21
|
+
let drag: object;
|
|
16
22
|
}
|
|
17
23
|
}
|
|
18
24
|
//# sourceMappingURL=overlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/map/overlay.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/map/overlay.js"],"names":[],"mappings":";AAYA;;;;;;;;;;;GAWG;AACH,0EAXW,WAAW,GAST,IAAI,CA+EhB;;;;;sBAiBU,8CAA8C;;kBAc9C,MAAM"}
|