google-maps-react-markers 1.2.0 → 1.2.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/README.md +33 -19
- package/dist/index.js +36 -20
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +36 -20
- package/dist/index.modern.js.map +1 -1
- package/package.json +15 -20
package/README.md
CHANGED
|
@@ -75,8 +75,12 @@ const App = () => {
|
|
|
75
75
|
setMapReady(true)
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
const onMarkerClick = (markerId) => {
|
|
78
|
+
const onMarkerClick = (e, { markerId, lat, lng }) => {
|
|
79
79
|
console.log('This is ->', markerId)
|
|
80
|
+
|
|
81
|
+
// inside the map instance you can call any google maps method
|
|
82
|
+
mapRef.current.setCenter({ lat, lng })
|
|
83
|
+
// rif. https://developers.google.com/maps/documentation/javascript/reference?hl=it
|
|
80
84
|
}
|
|
81
85
|
|
|
82
86
|
return (
|
|
@@ -104,24 +108,34 @@ export default App
|
|
|
104
108
|
|
|
105
109
|
## 🧐 Props
|
|
106
110
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
111
|
+
### GoogleMap component
|
|
112
|
+
|
|
113
|
+
| Prop | Type | Required | Default | Description |
|
|
114
|
+
| -------------------- | -------- | -------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
115
|
+
| **apiKey** | string | **yes** | `''` | API Key to load Google Maps |
|
|
116
|
+
| **defaultCenter** | object | **yes** | `{ lat: 0, lng: 0 }` | Default center of the map |
|
|
117
|
+
| **defaultZoom** | number | **yes** | `1-20` | Default zoom of the map |
|
|
118
|
+
| libraries | array | no | `['places', 'geometry']` | Libraries to load |
|
|
119
|
+
| options | object | no | `{}` | Options for the map |
|
|
120
|
+
| onGoogleApiLoaded | function | no | `() => {}` | Callback when the map is loaded |
|
|
121
|
+
| onChange | function | no | `() => {}` | Callback when the map has changed |
|
|
122
|
+
| events | array | no | `[]` | Array of objects name/handler of [DOM events](https://en.wikipedia.org/wiki/DOM_event) to pass down to the `div` overlay. Example: `events: [{ name: 'onClick', handler: () => {} }]` |
|
|
123
|
+
| children | node | no | `null` | Markers of the map |
|
|
124
|
+
| loadScriptExternally | bool | no | `false` | Whether to load the Google Maps script externally.<br>If `true`, the `status` prop is required and it will be used to control the loading of the script |
|
|
125
|
+
| status | string | no | `idle` | The forced status of the Google Maps script. Depends on `loadScriptExternally`.<br>It can be one of `idle`, `loading`, `ready`, `error` |
|
|
126
|
+
| loadingContent | node | no | `'Google Maps is loading'` | Content to show while the map is loading |
|
|
127
|
+
| idleContent | node | no | `'Google Maps is on idle'` | Content to show when the map is idle |
|
|
128
|
+
| errorContent | node | no | `'Google Maps is on error'` | Content to show when the map has an error |
|
|
129
|
+
| mapMinHeight | string | no | `'unset'` | Min height of the map |
|
|
130
|
+
| containerProps | object | no | `{}` | Props for the div container of the map |
|
|
131
|
+
| scriptCallback | function | no | `() => {}` | window global callback passed to the Google Script |
|
|
132
|
+
|
|
133
|
+
### Markers
|
|
134
|
+
|
|
135
|
+
| Prop | Type | Required | Default | Description |
|
|
136
|
+
| ------- | ------ | -------- | ----------- | ----------------------- |
|
|
137
|
+
| **lat** | number | **yes** | `undefined` | Latitude of the marker |
|
|
138
|
+
| **lng** | number | **yes** | `undefined` | Longitude of the marker |
|
|
125
139
|
|
|
126
140
|
## 📍 Clustering
|
|
127
141
|
|
package/dist/index.js
CHANGED
|
@@ -132,7 +132,7 @@ var useGoogleMaps = function useGoogleMaps(_ref) {
|
|
|
132
132
|
_ref$status = _ref.status,
|
|
133
133
|
status = _ref$status === void 0 ? 'idle' : _ref$status,
|
|
134
134
|
callback = _ref.callback;
|
|
135
|
-
if (typeof window !==
|
|
135
|
+
if (typeof window !== 'undefined') window.googleMapsCallback = callback;
|
|
136
136
|
var script = apiKey ? {
|
|
137
137
|
src: "https://maps.googleapis.com/maps/api/js?key=" + apiKey + "&callback=googleMapsCallback&libraries=" + (libraries === null || libraries === void 0 ? void 0 : libraries.join(',')),
|
|
138
138
|
attributes: {
|
|
@@ -306,7 +306,8 @@ var MapComponent = function MapComponent(_ref) {
|
|
|
306
306
|
defaultZoom = _ref.defaultZoom,
|
|
307
307
|
onGoogleApiLoaded = _ref.onGoogleApiLoaded,
|
|
308
308
|
onChange = _ref.onChange,
|
|
309
|
-
options = _ref.options
|
|
309
|
+
options = _ref.options,
|
|
310
|
+
events = _ref.events;
|
|
310
311
|
var mapRef = React.useRef(null);
|
|
311
312
|
var prevBoundsRef = React.useRef(null);
|
|
312
313
|
var _useState = React.useState(null),
|
|
@@ -319,21 +320,25 @@ var MapComponent = function MapComponent(_ref) {
|
|
|
319
320
|
googleApiCalled = _useState3[0],
|
|
320
321
|
setGoogleApiCalled = _useState3[1];
|
|
321
322
|
var onIdle = React.useCallback(function () {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
if (
|
|
330
|
-
onChange
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
323
|
+
try {
|
|
324
|
+
var zoom = map.getZoom();
|
|
325
|
+
var bounds = map.getBounds();
|
|
326
|
+
var centerLatLng = map.getCenter();
|
|
327
|
+
var ne = bounds.getNorthEast();
|
|
328
|
+
var sw = bounds.getSouthWest();
|
|
329
|
+
var boundsArray = [sw.lng(), sw.lat(), ne.lng(), ne.lat()];
|
|
330
|
+
if (!isArraysEqualEps(boundsArray, prevBoundsRef.current, EPS)) {
|
|
331
|
+
if (onChange) {
|
|
332
|
+
onChange({
|
|
333
|
+
zoom: zoom,
|
|
334
|
+
center: [centerLatLng.lng(), centerLatLng.lat()],
|
|
335
|
+
bounds: bounds
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
prevBoundsRef.current = boundsArray;
|
|
335
339
|
}
|
|
336
|
-
|
|
340
|
+
} catch (e) {
|
|
341
|
+
console.error(e);
|
|
337
342
|
}
|
|
338
343
|
}, [map, onChange]);
|
|
339
344
|
React.useEffect(function () {
|
|
@@ -366,11 +371,17 @@ var MapComponent = function MapComponent(_ref) {
|
|
|
366
371
|
}
|
|
367
372
|
};
|
|
368
373
|
}, [map]);
|
|
369
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
374
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", _extends({
|
|
370
375
|
ref: mapRef,
|
|
371
376
|
style: style,
|
|
372
377
|
className: "google-map"
|
|
373
|
-
}
|
|
378
|
+
}, events === null || events === void 0 ? void 0 : events.reduce(function (acc, _temp) {
|
|
379
|
+
var _ref2 = _temp === void 0 ? {} : _temp,
|
|
380
|
+
name = _ref2.name,
|
|
381
|
+
handler = _ref2.handler;
|
|
382
|
+
acc[name] = handler;
|
|
383
|
+
return acc;
|
|
384
|
+
}, {}))), children && map && maps && /*#__PURE__*/React__default.createElement(MapMarkers, {
|
|
374
385
|
map: map,
|
|
375
386
|
maps: maps
|
|
376
387
|
}, children));
|
|
@@ -387,7 +398,8 @@ MapComponent.defaultProps = {
|
|
|
387
398
|
},
|
|
388
399
|
onGoogleApiLoaded: function onGoogleApiLoaded() {},
|
|
389
400
|
onChange: function onChange() {},
|
|
390
|
-
options: {}
|
|
401
|
+
options: {},
|
|
402
|
+
events: []
|
|
391
403
|
};
|
|
392
404
|
MapComponent.propTypes = {
|
|
393
405
|
children: propTypes.oneOfType([propTypes.arrayOf(propTypes.node), propTypes.node]),
|
|
@@ -396,7 +408,11 @@ MapComponent.propTypes = {
|
|
|
396
408
|
defaultZoom: propTypes.number.isRequired,
|
|
397
409
|
onGoogleApiLoaded: propTypes.func,
|
|
398
410
|
onChange: propTypes.func,
|
|
399
|
-
options: propTypes.object
|
|
411
|
+
options: propTypes.object,
|
|
412
|
+
events: propTypes.arrayOf(propTypes.shape({
|
|
413
|
+
name: propTypes.string.isRequired,
|
|
414
|
+
handler: propTypes.func.isRequired
|
|
415
|
+
}))
|
|
400
416
|
};
|
|
401
417
|
|
|
402
418
|
var _excluded = ["apiKey", "libraries", "children", "loadingContent", "idleContent", "errorContent", "mapMinHeight", "containerProps", "loadScriptExternally", "status", "scriptCallback"];
|
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 = ({ apiKey, libraries = [], loadScriptExternally = false, status = 'idle', callback }) => {\n\t// eslint-disable-next-line no-undef\n\tif (typeof window !== \"undefined\") window.googleMapsCallback = callback\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)}`,\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 { element, number, object, shape, string } from 'prop-types'\n\n/**\n * @param {HTMLElement} container\n * @param {google.maps.MapPanes} pane\n * @param {google.maps.LatLng | google.maps.LatLngLiteral} position\n * @param {google.maps} maps\n * @returns {void}\n */\nconst createOverlay = ({ container, pane, position, maps }) => {\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\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\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}\n\nexport default createOverlay\n","import { 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 {HTMLElement} container\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\n * @returns {void}\n * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n */\nconst OverlayView = ({ position, pane = 'floatPane', map, maps, zIndex, children }) => {\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 })\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\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}\n\nexport default OverlayView\n","import { node, object } from 'prop-types'\nimport React, { Children, isValidElement, useMemo } from 'react'\nimport OverlayView from './overlay-view'\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 = child.props.zIndex || undefined\n\n\t\t\t\t// set the map prop on the child component\n\t\t\t\treturn (\n\t\t\t\t\t<OverlayView position={latLng} map={map} maps={maps} zIndex={zIndex}>\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 } 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 = ({ children, style, defaultCenter, defaultZoom, onGoogleApiLoaded, onChange, options }) => {\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\tconst zoom = map.getZoom()\n\t\tconst bounds = map.getBounds()\n\t\tconst centerLatLng = map.getCenter()\n\n\t\tconst ne = bounds.getNorthEast()\n\t\tconst sw = bounds.getSouthWest()\n\t\tconst boundsArray = [sw.lng(), sw.lat(), ne.lng(), ne.lat()]\n\n\t\tif (!isArraysEqualEps(boundsArray, prevBoundsRef.current, EPS)) {\n\t\t\tif (onChange) {\n\t\t\t\tonChange({\n\t\t\t\t\tzoom,\n\t\t\t\t\tcenter: [centerLatLng.lng(), centerLatLng.lat()],\n\t\t\t\t\tbounds,\n\t\t\t\t})\n\t\t\t}\n\t\t\tprevBoundsRef.current = boundsArray\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 ref={mapRef} style={style} className=\"google-map\" />\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}\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}\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\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({ apiKey, libraries, loadScriptExternally, status, callback: scriptCallback })\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}\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","apiKey","_ref$libraries","libraries","_ref$loadScriptExtern","loadScriptExternally","_ref$status","callback","window","googleMapsCallback","join","id","isArraysEqualEps","arrayA","arrayB","eps","i","Math","abs","useMemoCompare","next","compare","previousRef","useRef","previous","current","isEqual","createOverlay","container","pane","position","maps","Overlay","_maps$OverlayView","_inheritsLoose","_this","call","onAdd","getPanes","classList","add","draw","projection","getProjection","point","fromLatLngToDivPixel","style","transform","x","y","onRemove","parentNode","removeChild","OverlayView","propTypes","element","isRequired","string","shape","lat","number","lng","object","_ref$pane","zIndex","children","useMemo","div","overlay","childrenProps","props","prev","setMap","createPortal","defaultProps","node","MapMarkers","markers","Children","child","isValidElement","latLng","React","EPS","MapComponent","defaultCenter","defaultZoom","onGoogleApiLoaded","onChange","options","mapRef","prevBoundsRef","_useState2","setMaps","_useState3","googleApiCalled","setGoogleApiCalled","onIdle","useCallback","zoom","getZoom","bounds","getBounds","centerLatLng","getCenter","ne","getNorthEast","sw","getSouthWest","boundsArray","center","google","Map","_extends","ref","clearListeners","addListener","Fragment","className","width","height","left","top","margin","padding","oneOfType","arrayOf","func","GoogleMap","forwardRef","loadingContent","idleContent","errorContent","mapMinHeight","containerProps","scriptCallback","_objectWithoutPropertiesLoose","_excluded","renderers","ready","loading","idle","error","_status","overflow","minHeight","bool","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,GAAG,GAAG,SAAS,GAAG,MAAM,CAAC;IAA9DS,MAAM,GAAAF,SAAA;IAAEG,SAAS,GAAAH,SAAA;EAExBI,eAAS,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,SAAK;IACvE,IAAI,CAACc,WAAW,EAAE;MAEjBA,WAAW,GAAGC,QAAQ,CAACE,aAAa,CAAC,QAAQ,CAAC;MAC9CH,WAAW,CAACd,GAAG,GAAGF,MAAM,CAACE,GAAG;MAC5Bc,WAAW,CAACI,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;EACdsK,cAAc,EAAE,SAAAA,iBAAM;AAAE,EACxB;AAEDP,SAAS,CAAC1E,SAAS,GAAA2D,QAAA,KACf7B,YAAY,CAAC9B,SAAS;EAIzBW,QAAQ,EAAE4D,mBAAS,CAAC,CAAClD,cAAI,EAAEmD,iBAAO,CAACnD,cAAI,CAAC,CAAC,CAAC;EAI1CuD,cAAc,EAAEvD,cAAI;EAIpBwD,WAAW,EAAExD,cAAI;EAIjByD,YAAY,EAAEzD,cAAI;EAIlB0D,YAAY,EAAER,mBAAS,CAAC,CAACjE,gBAAM,EAAEH,gBAAM,CAAC,CAAC;EAIzC6E,cAAc,EAAExE,gBAAM;EAOtBzD,oBAAoB,EAAE6I,cAAI;EAK1BjL,MAAM,EAAEkL,eAAK,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;EAKpDZ,cAAc,EAAER;AAAI,EACpB;;;;"}
|
|
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 = ({ apiKey, libraries = [], loadScriptExternally = false, status = 'idle', callback }) => {\n\t// eslint-disable-next-line no-undef\n\tif (typeof window !== 'undefined') window.googleMapsCallback = callback\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)}`,\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 { element, number, object, shape, string } from 'prop-types'\n\n/**\n * @param {HTMLElement} container\n * @param {google.maps.MapPanes} pane\n * @param {google.maps.LatLng | google.maps.LatLngLiteral} position\n * @param {google.maps} maps\n * @returns {void}\n */\nconst createOverlay = ({ container, pane, position, maps }) => {\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\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\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}\n\nexport default createOverlay\n","import { 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 {HTMLElement} container\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\n * @returns {void}\n * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n */\nconst OverlayView = ({ position, pane = 'floatPane', map, maps, zIndex, children }) => {\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 })\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\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}\n\nexport default OverlayView\n","import { node, object } from 'prop-types'\nimport React, { Children, isValidElement, useMemo } from 'react'\nimport OverlayView from './overlay-view'\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 = child.props.zIndex || undefined\n\n\t\t\t\t// set the map prop on the child component\n\t\t\t\treturn (\n\t\t\t\t\t<OverlayView position={latLng} map={map} maps={maps} zIndex={zIndex}>\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\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({ apiKey, libraries, loadScriptExternally, status, callback: scriptCallback })\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}\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","apiKey","_ref$libraries","libraries","_ref$loadScriptExtern","loadScriptExternally","_ref$status","callback","window","googleMapsCallback","join","id","isArraysEqualEps","arrayA","arrayB","eps","i","Math","abs","useMemoCompare","next","compare","previousRef","useRef","previous","current","isEqual","createOverlay","container","pane","position","maps","Overlay","_maps$OverlayView","_inheritsLoose","_this","call","onAdd","getPanes","classList","add","draw","projection","getProjection","point","fromLatLngToDivPixel","style","transform","x","y","onRemove","parentNode","removeChild","OverlayView","propTypes","element","isRequired","string","shape","lat","number","lng","object","_ref$pane","zIndex","children","useMemo","div","overlay","childrenProps","props","prev","setMap","createPortal","defaultProps","node","MapMarkers","markers","Children","child","isValidElement","latLng","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","e","console","error","google","Map","_extends","ref","clearListeners","addListener","Fragment","className","reduce","acc","_temp","_ref2","name","handler","width","height","left","top","margin","padding","oneOfType","arrayOf","func","GoogleMap","forwardRef","loadingContent","idleContent","errorContent","mapMinHeight","containerProps","scriptCallback","_objectWithoutPropertiesLoose","_excluded","renderers","ready","loading","idle","_status","overflow","minHeight","bool","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,EA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AAE,EAAE;EACVE,SAAS,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;EACjCE,oBAAoB,EAAE,KAAK;EAC3BpC,MAAM,EAAE,MAAM;EACdgL,cAAc,EAAE,SAAAA,iBAAM;AAAE,EACxB;AAEDP,SAAS,CAACpF,SAAS,GAAA+D,QAAA,KACfjC,YAAY,CAAC9B,SAAS;EAIzBW,QAAQ,EAAEsE,mBAAS,CAAC,CAAC5D,cAAI,EAAE6D,iBAAO,CAAC7D,cAAI,CAAC,CAAC,CAAC;EAI1CiE,cAAc,EAAEjE,cAAI;EAIpBkE,WAAW,EAAElE,cAAI;EAIjBmE,YAAY,EAAEnE,cAAI;EAIlBoE,YAAY,EAAER,mBAAS,CAAC,CAAC3E,gBAAM,EAAEH,gBAAM,CAAC,CAAC;EAIzCuF,cAAc,EAAElF,gBAAM;EAOtBzD,oBAAoB,EAAEsJ,cAAI;EAK1B1L,MAAM,EAAE2L,eAAK,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;EAKpDX,cAAc,EAAER;AAAI,EACpB;;;;"}
|
package/dist/index.modern.js
CHANGED
|
@@ -129,7 +129,7 @@ var useGoogleMaps = function useGoogleMaps(_ref) {
|
|
|
129
129
|
_ref$status = _ref.status,
|
|
130
130
|
status = _ref$status === void 0 ? 'idle' : _ref$status,
|
|
131
131
|
callback = _ref.callback;
|
|
132
|
-
if (typeof window !==
|
|
132
|
+
if (typeof window !== 'undefined') window.googleMapsCallback = callback;
|
|
133
133
|
var script = apiKey ? {
|
|
134
134
|
src: "https://maps.googleapis.com/maps/api/js?key=" + apiKey + "&callback=googleMapsCallback&libraries=" + (libraries === null || libraries === void 0 ? void 0 : libraries.join(',')),
|
|
135
135
|
attributes: {
|
|
@@ -303,7 +303,8 @@ var MapComponent = function MapComponent(_ref) {
|
|
|
303
303
|
defaultZoom = _ref.defaultZoom,
|
|
304
304
|
onGoogleApiLoaded = _ref.onGoogleApiLoaded,
|
|
305
305
|
onChange = _ref.onChange,
|
|
306
|
-
options = _ref.options
|
|
306
|
+
options = _ref.options,
|
|
307
|
+
events = _ref.events;
|
|
307
308
|
var mapRef = useRef(null);
|
|
308
309
|
var prevBoundsRef = useRef(null);
|
|
309
310
|
var _useState = useState(null),
|
|
@@ -316,21 +317,25 @@ var MapComponent = function MapComponent(_ref) {
|
|
|
316
317
|
googleApiCalled = _useState3[0],
|
|
317
318
|
setGoogleApiCalled = _useState3[1];
|
|
318
319
|
var onIdle = useCallback(function () {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
if (
|
|
327
|
-
onChange
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
320
|
+
try {
|
|
321
|
+
var zoom = map.getZoom();
|
|
322
|
+
var bounds = map.getBounds();
|
|
323
|
+
var centerLatLng = map.getCenter();
|
|
324
|
+
var ne = bounds.getNorthEast();
|
|
325
|
+
var sw = bounds.getSouthWest();
|
|
326
|
+
var boundsArray = [sw.lng(), sw.lat(), ne.lng(), ne.lat()];
|
|
327
|
+
if (!isArraysEqualEps(boundsArray, prevBoundsRef.current, EPS)) {
|
|
328
|
+
if (onChange) {
|
|
329
|
+
onChange({
|
|
330
|
+
zoom: zoom,
|
|
331
|
+
center: [centerLatLng.lng(), centerLatLng.lat()],
|
|
332
|
+
bounds: bounds
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
prevBoundsRef.current = boundsArray;
|
|
332
336
|
}
|
|
333
|
-
|
|
337
|
+
} catch (e) {
|
|
338
|
+
console.error(e);
|
|
334
339
|
}
|
|
335
340
|
}, [map, onChange]);
|
|
336
341
|
useEffect(function () {
|
|
@@ -363,11 +368,17 @@ var MapComponent = function MapComponent(_ref) {
|
|
|
363
368
|
}
|
|
364
369
|
};
|
|
365
370
|
}, [map]);
|
|
366
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
371
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
|
|
367
372
|
ref: mapRef,
|
|
368
373
|
style: style,
|
|
369
374
|
className: "google-map"
|
|
370
|
-
}
|
|
375
|
+
}, events === null || events === void 0 ? void 0 : events.reduce(function (acc, _temp) {
|
|
376
|
+
var _ref2 = _temp === void 0 ? {} : _temp,
|
|
377
|
+
name = _ref2.name,
|
|
378
|
+
handler = _ref2.handler;
|
|
379
|
+
acc[name] = handler;
|
|
380
|
+
return acc;
|
|
381
|
+
}, {}))), children && map && maps && /*#__PURE__*/React.createElement(MapMarkers, {
|
|
371
382
|
map: map,
|
|
372
383
|
maps: maps
|
|
373
384
|
}, children));
|
|
@@ -384,7 +395,8 @@ MapComponent.defaultProps = {
|
|
|
384
395
|
},
|
|
385
396
|
onGoogleApiLoaded: function onGoogleApiLoaded() {},
|
|
386
397
|
onChange: function onChange() {},
|
|
387
|
-
options: {}
|
|
398
|
+
options: {},
|
|
399
|
+
events: []
|
|
388
400
|
};
|
|
389
401
|
MapComponent.propTypes = {
|
|
390
402
|
children: oneOfType([arrayOf(node), node]),
|
|
@@ -393,7 +405,11 @@ MapComponent.propTypes = {
|
|
|
393
405
|
defaultZoom: number.isRequired,
|
|
394
406
|
onGoogleApiLoaded: func,
|
|
395
407
|
onChange: func,
|
|
396
|
-
options: object
|
|
408
|
+
options: object,
|
|
409
|
+
events: arrayOf(shape({
|
|
410
|
+
name: string.isRequired,
|
|
411
|
+
handler: func.isRequired
|
|
412
|
+
}))
|
|
397
413
|
};
|
|
398
414
|
|
|
399
415
|
var _excluded = ["apiKey", "libraries", "children", "loadingContent", "idleContent", "errorContent", "mapMinHeight", "containerProps", "loadScriptExternally", "status", "scriptCallback"];
|
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 = ({ apiKey, libraries = [], loadScriptExternally = false, status = 'idle', callback }) => {\n\t// eslint-disable-next-line no-undef\n\tif (typeof window !== \"undefined\") window.googleMapsCallback = callback\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)}`,\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 { element, number, object, shape, string } from 'prop-types'\n\n/**\n * @param {HTMLElement} container\n * @param {google.maps.MapPanes} pane\n * @param {google.maps.LatLng | google.maps.LatLngLiteral} position\n * @param {google.maps} maps\n * @returns {void}\n */\nconst createOverlay = ({ container, pane, position, maps }) => {\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\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\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}\n\nexport default createOverlay\n","import { 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 {HTMLElement} container\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\n * @returns {void}\n * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n */\nconst OverlayView = ({ position, pane = 'floatPane', map, maps, zIndex, children }) => {\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 })\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\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}\n\nexport default OverlayView\n","import { node, object } from 'prop-types'\nimport React, { Children, isValidElement, useMemo } from 'react'\nimport OverlayView from './overlay-view'\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 = child.props.zIndex || undefined\n\n\t\t\t\t// set the map prop on the child component\n\t\t\t\treturn (\n\t\t\t\t\t<OverlayView position={latLng} map={map} maps={maps} zIndex={zIndex}>\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 } 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 = ({ children, style, defaultCenter, defaultZoom, onGoogleApiLoaded, onChange, options }) => {\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\tconst zoom = map.getZoom()\n\t\tconst bounds = map.getBounds()\n\t\tconst centerLatLng = map.getCenter()\n\n\t\tconst ne = bounds.getNorthEast()\n\t\tconst sw = bounds.getSouthWest()\n\t\tconst boundsArray = [sw.lng(), sw.lat(), ne.lng(), ne.lat()]\n\n\t\tif (!isArraysEqualEps(boundsArray, prevBoundsRef.current, EPS)) {\n\t\t\tif (onChange) {\n\t\t\t\tonChange({\n\t\t\t\t\tzoom,\n\t\t\t\t\tcenter: [centerLatLng.lng(), centerLatLng.lat()],\n\t\t\t\t\tbounds,\n\t\t\t\t})\n\t\t\t}\n\t\t\tprevBoundsRef.current = boundsArray\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 ref={mapRef} style={style} className=\"google-map\" />\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}\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}\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\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({ apiKey, libraries, loadScriptExternally, status, callback: scriptCallback })\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}\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","apiKey","_ref$libraries","libraries","_ref$loadScriptExtern","loadScriptExternally","_ref$status","callback","window","googleMapsCallback","join","id","isArraysEqualEps","arrayA","arrayB","eps","i","Math","abs","useMemoCompare","next","compare","previousRef","useRef","previous","current","isEqual","createOverlay","container","pane","position","maps","Overlay","_maps$OverlayView","_inheritsLoose","_this","call","onAdd","getPanes","classList","add","draw","projection","getProjection","point","fromLatLngToDivPixel","style","transform","x","y","onRemove","parentNode","removeChild","OverlayView","propTypes","element","isRequired","string","shape","lat","number","lng","object","_ref$pane","zIndex","children","useMemo","div","overlay","childrenProps","props","prev","setMap","createPortal","defaultProps","node","MapMarkers","markers","Children","child","isValidElement","latLng","React","EPS","MapComponent","defaultCenter","defaultZoom","onGoogleApiLoaded","onChange","options","mapRef","prevBoundsRef","_useState2","setMaps","_useState3","googleApiCalled","setGoogleApiCalled","onIdle","useCallback","zoom","getZoom","bounds","getBounds","centerLatLng","getCenter","ne","getNorthEast","sw","getSouthWest","boundsArray","center","google","Map","_extends","ref","clearListeners","addListener","Fragment","className","width","height","left","top","margin","padding","oneOfType","arrayOf","func","GoogleMap","forwardRef","loadingContent","idleContent","errorContent","mapMinHeight","containerProps","scriptCallback","_objectWithoutPropertiesLoose","_excluded","renderers","ready","loading","idle","error","_status","overflow","minHeight","bool","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,c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DZ,cAAc,EAAER;AAAI,EACpB;;;;"}
|
|
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 = ({ apiKey, libraries = [], loadScriptExternally = false, status = 'idle', callback }) => {\n\t// eslint-disable-next-line no-undef\n\tif (typeof window !== 'undefined') window.googleMapsCallback = callback\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)}`,\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 { element, number, object, shape, string } from 'prop-types'\n\n/**\n * @param {HTMLElement} container\n * @param {google.maps.MapPanes} pane\n * @param {google.maps.LatLng | google.maps.LatLngLiteral} position\n * @param {google.maps} maps\n * @returns {void}\n */\nconst createOverlay = ({ container, pane, position, maps }) => {\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\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\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}\n\nexport default createOverlay\n","import { 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 {HTMLElement} container\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\n * @returns {void}\n * @ref [MapPanes](https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes)\n */\nconst OverlayView = ({ position, pane = 'floatPane', map, maps, zIndex, children }) => {\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 })\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\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}\n\nexport default OverlayView\n","import { node, object } from 'prop-types'\nimport React, { Children, isValidElement, useMemo } from 'react'\nimport OverlayView from './overlay-view'\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 = child.props.zIndex || undefined\n\n\t\t\t\t// set the map prop on the child component\n\t\t\t\treturn (\n\t\t\t\t\t<OverlayView position={latLng} map={map} maps={maps} zIndex={zIndex}>\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\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({ apiKey, libraries, loadScriptExternally, status, callback: scriptCallback })\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}\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","apiKey","_ref$libraries","libraries","_ref$loadScriptExtern","loadScriptExternally","_ref$status","callback","window","googleMapsCallback","join","id","isArraysEqualEps","arrayA","arrayB","eps","i","Math","abs","useMemoCompare","next","compare","previousRef","useRef","previous","current","isEqual","createOverlay","container","pane","position","maps","Overlay","_maps$OverlayView","_inheritsLoose","_this","call","onAdd","getPanes","classList","add","draw","projection","getProjection","point","fromLatLngToDivPixel","style","transform","x","y","onRemove","parentNode","removeChild","OverlayView","propTypes","element","isRequired","string","shape","lat","number","lng","object","_ref$pane","zIndex","children","useMemo","div","overlay","childrenProps","props","prev","setMap","createPortal","defaultProps","node","MapMarkers","markers","Children","child","isValidElement","latLng","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","e","console","error","google","Map","_extends","ref","clearListeners","addListener","Fragment","className","reduce","acc","_temp","_ref2","name","handler","width","height","left","top","margin","padding","oneOfType","arrayOf","func","GoogleMap","forwardRef","loadingContent","idleContent","errorContent","mapMinHeight","containerProps","scriptCallback","_objectWithoutPropertiesLoose","_excluded","renderers","ready","loading","idle","_status","overflow","minHeight","bool","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,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E2L,KAAK,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;EAKpDX,cAAc,EAAER;AAAI,EACpB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "google-maps-react-markers",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Google Maps library with markers as react components",
|
|
5
5
|
"author": "Giorgia Bosello",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,11 +30,7 @@
|
|
|
30
30
|
"build": "microbundle-crl --no-compress --format modern,cjs",
|
|
31
31
|
"dev": "microbundle-crl watch --no-compress --format modern,cjs",
|
|
32
32
|
"prepare": "run-s build",
|
|
33
|
-
"
|
|
34
|
-
"test:build": "run-s build",
|
|
35
|
-
"test:lint": "eslint .",
|
|
36
|
-
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom",
|
|
37
|
-
"test:watch": "react-scripts test --env=jsdom",
|
|
33
|
+
"lint:fix": "eslint --fix src",
|
|
38
34
|
"predeploy": "cd docs && yarn install && yarn build",
|
|
39
35
|
"deploy": "gh-pages -d docs/build",
|
|
40
36
|
"publish": "yarn build && npm publish"
|
|
@@ -44,20 +40,19 @@
|
|
|
44
40
|
"react-dom": "^18.0.0"
|
|
45
41
|
},
|
|
46
42
|
"devDependencies": {
|
|
47
|
-
"@babel/core": "^7.
|
|
48
|
-
"@babel/eslint-parser": "^7.
|
|
49
|
-
"@babel/preset-env": "^7.
|
|
43
|
+
"@babel/core": "^7.21.4",
|
|
44
|
+
"@babel/eslint-parser": "^7.21.3",
|
|
45
|
+
"@babel/preset-env": "^7.21.5",
|
|
50
46
|
"@babel/preset-react": "^7.18.6",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"eslint": "^8.
|
|
54
|
-
"eslint-config-prettier": "^8.6.0",
|
|
47
|
+
"cross-env": "^7.0.3",
|
|
48
|
+
"eslint": "^8.39.0",
|
|
49
|
+
"eslint-config-prettier": "^8.8.0",
|
|
55
50
|
"eslint-config-standard": "^17.0.0",
|
|
56
51
|
"eslint-config-standard-react": "^13.0.0",
|
|
57
52
|
"eslint-plugin-import": "^2.27.5",
|
|
58
53
|
"eslint-plugin-jsx": "^0.1.0",
|
|
59
|
-
"eslint-plugin-n": "^15.
|
|
60
|
-
"eslint-plugin-node": "^11.
|
|
54
|
+
"eslint-plugin-n": "^15.7.0",
|
|
55
|
+
"eslint-plugin-node": "^11.1.0",
|
|
61
56
|
"eslint-plugin-prettier": "^4.2.1",
|
|
62
57
|
"eslint-plugin-promise": "^6.1.1",
|
|
63
58
|
"eslint-plugin-react": "^7.32.2",
|
|
@@ -65,20 +60,20 @@
|
|
|
65
60
|
"eslint-plugin-standard": "^5.0.0",
|
|
66
61
|
"eslint-plugin-typescript": "^0.14.0",
|
|
67
62
|
"gh-pages": "^5.0.0",
|
|
68
|
-
"microbundle-crl": "^0.13.
|
|
63
|
+
"microbundle-crl": "^0.13.11",
|
|
69
64
|
"npm-run-all": "^4.1.5",
|
|
70
|
-
"prettier": "^2.8.
|
|
65
|
+
"prettier": "^2.8.8",
|
|
71
66
|
"react": "^18.2.0",
|
|
72
67
|
"react-dom": "^18.2.0",
|
|
73
68
|
"react-scripts": "^5.0.1",
|
|
74
|
-
"typescript": "^5.0.
|
|
69
|
+
"typescript": "^5.0.4"
|
|
75
70
|
},
|
|
76
71
|
"files": [
|
|
77
72
|
"dist"
|
|
78
73
|
],
|
|
79
74
|
"dependencies": {
|
|
80
|
-
"@babel/plugin-syntax-flow": "^7.
|
|
81
|
-
"@babel/plugin-transform-react-jsx": "^7.
|
|
75
|
+
"@babel/plugin-syntax-flow": "^7.21.4",
|
|
76
|
+
"@babel/plugin-transform-react-jsx": "^7.21.5",
|
|
82
77
|
"prop-types": "^15.8.1"
|
|
83
78
|
}
|
|
84
79
|
}
|