google-maps-react-markers 1.0.10 → 1.1.1
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/LICENCE.md +21 -0
- package/README.md +75 -67
- package/dist/index.js +44 -15
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +45 -16
- package/dist/index.modern.js.map +1 -1
- package/package.json +13 -12
package/LICENCE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Giorgia Bosello
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
It supports a small set of the props of [Google Map React](https://github.com/google-map-react/google-map-react). Clustering also is possible.
|
|
6
6
|
The library implements [Google Maps Custom Overlays](https://developers.google.com/maps/documentation/javascript/customoverlays) official library.
|
|
7
7
|
|
|
8
|
-
[](https://www.npmjs.com/package/google-maps-react-markers)
|
|
8
|
+
[](https://www.npmjs.com/package/google-maps-react-markers)  [](https://github.com/giorgiabosello/google-maps-react-markers/blob/master/LICENCE.md) 
|
|
9
|
+
[](https://github.com/giorgiabosello/google-maps-react-markers/issues)
|
|
9
10
|
|
|
10
11
|
**If you like this library, please consider supporting me ❤️**
|
|
11
12
|
|
|
@@ -14,6 +15,12 @@ The library implements [Google Maps Custom Overlays](https://developers.google.c
|
|
|
14
15
|
|
|
15
16
|
## Install
|
|
16
17
|
|
|
18
|
+
```bash
|
|
19
|
+
pnpm add google-maps-react-markers
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
or
|
|
23
|
+
|
|
17
24
|
```bash
|
|
18
25
|
yarn add google-maps-react-markers
|
|
19
26
|
```
|
|
@@ -28,62 +35,65 @@ npm install --save google-maps-react-markers
|
|
|
28
35
|
|
|
29
36
|
```jsx
|
|
30
37
|
const App = () => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
38
|
+
const mapRef = useRef(null)
|
|
39
|
+
const [mapReady, setMapReady] = useState(false)
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @description This function is called when the map is ready
|
|
43
|
+
* @param {Object} map - reference to the map instance
|
|
44
|
+
* @param {Object} maps - reference to the maps library
|
|
45
|
+
*/
|
|
46
|
+
const onGoogleApiLoaded = ({ map, maps }) => {
|
|
47
|
+
mapRef.current = map
|
|
48
|
+
setMapReady(true)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const onMarkerClick = (markerId) => {
|
|
52
|
+
console.log('This is ->', markerId)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
{mapReady && <div>Map is ready. See for logs in developer console.</div>}
|
|
58
|
+
<GoogleMap
|
|
59
|
+
apiKey=""
|
|
60
|
+
defaultCenter={{ lat: 45.4046987, lng: 12.2472504 }}
|
|
61
|
+
defaultZoom={5}
|
|
62
|
+
options={mapOptions}
|
|
63
|
+
mapMinHeight="100vh"
|
|
64
|
+
onGoogleApiLoaded={onGoogleApiLoaded}
|
|
65
|
+
onChange={(map) => console.log('Map moved', map)}
|
|
66
|
+
>
|
|
67
|
+
{coordinates.map(({ lat, lng, name }, index) => (
|
|
68
|
+
<Marker key={index} lat={lat} lng={lng} markerId={name} onClick={onMarkerClick} />
|
|
69
|
+
))}
|
|
70
|
+
</GoogleMap>
|
|
71
|
+
</>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default App
|
|
68
76
|
```
|
|
69
77
|
|
|
70
78
|
## Props
|
|
71
79
|
|
|
72
|
-
| Prop
|
|
73
|
-
|
|
|
74
|
-
| apiKey
|
|
75
|
-
| defaultCenter
|
|
76
|
-
| defaultZoom
|
|
77
|
-
| libraries
|
|
78
|
-
| options
|
|
79
|
-
| onGoogleApiLoaded
|
|
80
|
-
| onChange
|
|
81
|
-
| children
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
80
|
+
| Prop | Type | Required | Default | Description |
|
|
81
|
+
| -------------------- | -------- | -------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
82
|
+
| apiKey | string | **yes** | `''` | Api Key to load Google Maps |
|
|
83
|
+
| defaultCenter | object | **yes** | `{ lat: 0, lng: 0 }` | Default center of the map |
|
|
84
|
+
| defaultZoom | number | **yes** | `1-20` | Default zoom of the map |
|
|
85
|
+
| libraries | array | no | `['places', 'geometry']` | Libraries to load |
|
|
86
|
+
| options | object | no | `{}` | Options for the map |
|
|
87
|
+
| onGoogleApiLoaded | function | no | `() => {}` | Callback when the map is loaded |
|
|
88
|
+
| onChange | function | no | `() => {}` | Callback when the map has changed |
|
|
89
|
+
| children | node | no | `null` | Markers of the map |
|
|
90
|
+
| 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 |
|
|
91
|
+
| 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`. |
|
|
92
|
+
| loadingContent | node | no | `'Google Maps is loading'` | Content to show while the map is loading |
|
|
93
|
+
| idleContent | node | no | `'Google Maps is on idle'` | Content to show when the map is idle |
|
|
94
|
+
| errorContent | node | no | `'Google Maps is on error'` | Content to show when the map has an error |
|
|
95
|
+
| mapMinHeight | string | no | `'unset'` | Min height of the map |
|
|
96
|
+
| containerProps | object | no | `{}` | Props for the div container of the map |
|
|
87
97
|
|
|
88
98
|
## Clustering
|
|
89
99
|
|
|
@@ -91,20 +101,18 @@ For clustering, follow this [guide](https://www.leighhalliday.com/google-maps-cl
|
|
|
91
101
|
|
|
92
102
|
```jsx
|
|
93
103
|
const onMapChange = ({ bounds, zoom }) => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
console.log("New bounds and zoom -> ", { bounds, zoom });
|
|
107
|
-
};
|
|
104
|
+
const ne = bounds.getNorthEast()
|
|
105
|
+
const sw = bounds.getSouthWest()
|
|
106
|
+
/**
|
|
107
|
+
* useSupercluster accepts bounds in the form of [westLng, southLat, eastLng, northLat]
|
|
108
|
+
* const { clusters, supercluster } = useSupercluster({
|
|
109
|
+
* points: points,
|
|
110
|
+
* bounds: mapBounds.bounds,
|
|
111
|
+
* zoom: mapBounds.zoom,
|
|
112
|
+
* })
|
|
113
|
+
*/
|
|
114
|
+
setMapBounds({ ...mapBounds, bounds: [sw.lng(), sw.lat(), ne.lng(), ne.lat()], zoom })
|
|
115
|
+
}
|
|
108
116
|
```
|
|
109
117
|
|
|
110
118
|
## License
|
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
44
44
|
return target;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
var useScript = function useScript(script) {
|
|
47
|
+
var useScript = function useScript(script, forcedStatus) {
|
|
48
48
|
if (script === void 0) {
|
|
49
49
|
script = {
|
|
50
50
|
src: '',
|
|
@@ -56,11 +56,19 @@ var useScript = function useScript(script) {
|
|
|
56
56
|
elementIdToAppend: null
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
+
if (forcedStatus === void 0) {
|
|
60
|
+
forcedStatus = undefined;
|
|
61
|
+
}
|
|
59
62
|
var _useState = React.useState(script.src ? 'loading' : 'idle'),
|
|
60
63
|
status = _useState[0],
|
|
61
64
|
setStatus = _useState[1];
|
|
62
65
|
React.useEffect(function () {
|
|
63
66
|
var _script$callbacks, _script$callbacks2;
|
|
67
|
+
if (forcedStatus) {
|
|
68
|
+
setStatus(forcedStatus);
|
|
69
|
+
return function () {
|
|
70
|
+
};
|
|
71
|
+
}
|
|
64
72
|
if (!script.src) {
|
|
65
73
|
setStatus('idle');
|
|
66
74
|
return;
|
|
@@ -113,26 +121,30 @@ var useScript = function useScript(script) {
|
|
|
113
121
|
}
|
|
114
122
|
};
|
|
115
123
|
},
|
|
116
|
-
[script]);
|
|
124
|
+
[script, forcedStatus, status]);
|
|
117
125
|
return status;
|
|
118
126
|
};
|
|
119
127
|
|
|
120
128
|
var useGoogleMaps = function useGoogleMaps(_ref) {
|
|
121
129
|
var apiKey = _ref.apiKey,
|
|
122
130
|
_ref$libraries = _ref.libraries,
|
|
123
|
-
libraries = _ref$libraries === void 0 ? [] : _ref$libraries
|
|
131
|
+
libraries = _ref$libraries === void 0 ? [] : _ref$libraries,
|
|
132
|
+
_ref$loadScriptExtern = _ref.loadScriptExternally,
|
|
133
|
+
loadScriptExternally = _ref$loadScriptExtern === void 0 ? false : _ref$loadScriptExtern,
|
|
134
|
+
_ref$status = _ref.status,
|
|
135
|
+
status = _ref$status === void 0 ? 'idle' : _ref$status;
|
|
124
136
|
var script = apiKey ? {
|
|
125
|
-
src: "https://maps.googleapis.com/maps/api/js?key=" + apiKey + "&libraries=" + (libraries === null || libraries === void 0 ? void 0 : libraries.join(
|
|
137
|
+
src: "https://maps.googleapis.com/maps/api/js?key=" + apiKey + "&libraries=" + (libraries === null || libraries === void 0 ? void 0 : libraries.join(',')),
|
|
126
138
|
attributes: {
|
|
127
|
-
id:
|
|
139
|
+
id: 'googleMapsApi'
|
|
128
140
|
}
|
|
129
141
|
} : {
|
|
130
|
-
src: "https://maps.googleapis.com/maps/api/js?libraries=" + (libraries === null || libraries === void 0 ? void 0 : libraries.join(
|
|
142
|
+
src: "https://maps.googleapis.com/maps/api/js?libraries=" + (libraries === null || libraries === void 0 ? void 0 : libraries.join(',')),
|
|
131
143
|
attributes: {
|
|
132
|
-
id:
|
|
144
|
+
id: 'googleMapsApi'
|
|
133
145
|
}
|
|
134
146
|
};
|
|
135
|
-
return useScript(script);
|
|
147
|
+
return useScript(script, loadScriptExternally ? status : undefined);
|
|
136
148
|
};
|
|
137
149
|
|
|
138
150
|
var isArraysEqualEps = function isArraysEqualEps(arrayA, arrayB, eps) {
|
|
@@ -271,10 +283,13 @@ var MapMarkers = function MapMarkers(_ref) {
|
|
|
271
283
|
lat: child.props.lat,
|
|
272
284
|
lng: child.props.lng
|
|
273
285
|
};
|
|
286
|
+
var zIndex = child.props.zIndex || undefined;
|
|
287
|
+
|
|
274
288
|
return /*#__PURE__*/React__default.createElement(OverlayView, {
|
|
275
289
|
position: latLng,
|
|
276
290
|
map: map,
|
|
277
|
-
maps: maps
|
|
291
|
+
maps: maps,
|
|
292
|
+
zIndex: zIndex
|
|
278
293
|
}, child);
|
|
279
294
|
}
|
|
280
295
|
});
|
|
@@ -388,7 +403,7 @@ MapComponent.propTypes = {
|
|
|
388
403
|
options: propTypes.object
|
|
389
404
|
};
|
|
390
405
|
|
|
391
|
-
var _excluded = ["apiKey", "libraries", "children", "loadingContent", "idleContent", "errorContent", "mapMinHeight", "containerProps"];
|
|
406
|
+
var _excluded = ["apiKey", "libraries", "children", "loadingContent", "idleContent", "errorContent", "mapMinHeight", "containerProps", "loadScriptExternally", "status"];
|
|
392
407
|
var GoogleMap = /*#__PURE__*/React.forwardRef(function GoogleMap(_ref, ref) {
|
|
393
408
|
var apiKey = _ref.apiKey,
|
|
394
409
|
libraries = _ref.libraries,
|
|
@@ -398,10 +413,20 @@ var GoogleMap = /*#__PURE__*/React.forwardRef(function GoogleMap(_ref, ref) {
|
|
|
398
413
|
errorContent = _ref.errorContent,
|
|
399
414
|
mapMinHeight = _ref.mapMinHeight,
|
|
400
415
|
containerProps = _ref.containerProps,
|
|
416
|
+
loadScriptExternally = _ref.loadScriptExternally,
|
|
417
|
+
status = _ref.status,
|
|
401
418
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
402
|
-
var
|
|
419
|
+
var renderers = {
|
|
420
|
+
ready: /*#__PURE__*/React__default.createElement(MapComponent, props, children),
|
|
421
|
+
loading: loadingContent,
|
|
422
|
+
idle: idleContent,
|
|
423
|
+
error: errorContent
|
|
424
|
+
};
|
|
425
|
+
var _status = useGoogleMaps({
|
|
403
426
|
apiKey: apiKey,
|
|
404
|
-
libraries: libraries
|
|
427
|
+
libraries: libraries,
|
|
428
|
+
loadScriptExternally: loadScriptExternally,
|
|
429
|
+
status: status
|
|
405
430
|
});
|
|
406
431
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
407
432
|
style: {
|
|
@@ -412,7 +437,7 @@ var GoogleMap = /*#__PURE__*/React.forwardRef(function GoogleMap(_ref, ref) {
|
|
|
412
437
|
minHeight: mapMinHeight
|
|
413
438
|
},
|
|
414
439
|
ref: ref
|
|
415
|
-
}, containerProps),
|
|
440
|
+
}, containerProps), renderers[_status] || null);
|
|
416
441
|
});
|
|
417
442
|
GoogleMap.defaultProps = _extends({}, MapComponent.defaultProps, {
|
|
418
443
|
loadingContent: 'Google Maps is loading',
|
|
@@ -420,7 +445,9 @@ GoogleMap.defaultProps = _extends({}, MapComponent.defaultProps, {
|
|
|
420
445
|
errorContent: 'Google Maps is on error',
|
|
421
446
|
mapMinHeight: 'unset',
|
|
422
447
|
apiKey: '',
|
|
423
|
-
libraries: ['places', 'geometry']
|
|
448
|
+
libraries: ['places', 'geometry'],
|
|
449
|
+
loadScriptExternally: false,
|
|
450
|
+
status: 'idle'
|
|
424
451
|
});
|
|
425
452
|
GoogleMap.propTypes = _extends({}, MapComponent.propTypes, {
|
|
426
453
|
children: propTypes.oneOfType([propTypes.node, propTypes.arrayOf(propTypes.node)]),
|
|
@@ -428,7 +455,9 @@ GoogleMap.propTypes = _extends({}, MapComponent.propTypes, {
|
|
|
428
455
|
idleContent: propTypes.node,
|
|
429
456
|
errorContent: propTypes.node,
|
|
430
457
|
mapMinHeight: propTypes.oneOfType([propTypes.number, propTypes.string]),
|
|
431
|
-
containerProps: propTypes.object
|
|
458
|
+
containerProps: propTypes.object,
|
|
459
|
+
loadScriptExternally: propTypes.bool,
|
|
460
|
+
status: propTypes.oneOf(['idle', 'loading', 'ready', 'error'])
|
|
432
461
|
});
|
|
433
462
|
|
|
434
463
|
module.exports = GoogleMap;
|
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 { useState, useEffect } 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) => {\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\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\t\t// Re-run useEffect if script changes\n\t\t[script]\n\t)\n\treturn status\n}\n","import { useScript } from \"./useScript\";\n\n/**\n * @returns {\"idle\" | \"loading\" | \"ready\" | \"error\"} status\n */\nexport const useGoogleMaps = ({ apiKey, libraries = [] }) => {\n\tconst script = apiKey\n\t\t? {\n\t\t\t\tsrc: `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=${libraries?.join(\",\")}`,\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?libraries=${libraries?.join(\",\")}`,\n\t\t\t\tattributes: { id: \"googleMapsApi\" },\n\t\t};\n\n\treturn useScript(script);\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\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}>\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, node, number, object, 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{ apiKey, libraries, children, loadingContent, idleContent, errorContent, mapMinHeight, containerProps, ...props },\n\tref\n) {\n\tconst status = useGoogleMaps({ apiKey, libraries })\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{status === 'ready' ? (\n\t\t\t\t<MapComponent {...props}>{children}</MapComponent>\n\t\t\t) : status === 'loading' ? (\n\t\t\t\tloadingContent\n\t\t\t) : status === 'idle' ? (\n\t\t\t\tidleContent\n\t\t\t) : status === 'error' ? (\n\t\t\t\terrorContent\n\t\t\t) : 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}\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}\n\nexport default GoogleMap\n"],"names":["useScript","script","src","attributes","callbacks","onLoadCallback","onErrorCallback","elementIdToAppend","useState","status","setStatus","useEffect","scriptToAdd","document","querySelector","createElement","async","setAttribute","Object","entries","length","map","key","value","getElementById","appendChild","body","setAttributeFromEvent","event","type","addEventListener","currentScriptStatus","getAttribute","setStateFromEvent","removeEventListener","useGoogleMaps","apiKey","libraries","join","id","isArraysEqualEps","arrayA","arrayB","eps","i","Math","abs","useMemoCompare","next","compare","previousRef","useRef","previous","current","isEqual","createOverlay","container","pane","position","maps","Overlay","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","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","setMaps","googleApiCalled","setGoogleApiCalled","onIdle","useCallback","zoom","getZoom","bounds","getBounds","centerLatLng","getCenter","ne","getNorthEast","sw","getSouthWest","boundsArray","center","window","google","Map","ref","clearListeners","addListener","width","height","left","top","margin","padding","oneOfType","arrayOf","func","GoogleMap","forwardRef","loadingContent","idleContent","errorContent","mapMinHeight","containerProps","overflow","minHeight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,IAAMA,SAAS,GAAG,SAAZA,SAAS,CACrBC,MAAM,EAMF;EAAA,IANJA,MAAM;IAANA,MAAM,GAAG;MACRC,GAAG,EAAE,EAAE;MACPC,UAAU,EAAE,EAAE;MACdC,SAAS,EAAE;QAAEC,cAAc,EAAE,IAAI;QAAEC,eAAe,EAAE;OAAM;MAC1DC,iBAAiB,EAAE;KACnB;;EAGD,gBAA4BC,cAAQ,CAACP,MAAM,CAACC,GAAG,GAAG,SAAS,GAAG,MAAM,CAAC;IAA9DO,MAAM;IAAEC,SAAS;EAExBC,eAAS,CACR,YAAM;IAAA;IAGL,IAAI,CAACV,MAAM,CAACC,GAAG,EAAE;MAChBQ,SAAS,CAAC,MAAM,CAAC;MACjB;;IAID,IAAIE,WAAW,GAAGC,QAAQ,CAACC,aAAa,mBAAgBb,MAAM,CAACC,GAAG,SAAK;IACvE,IAAI,CAACU,WAAW,EAAE;MAEjBA,WAAW,GAAGC,QAAQ,CAACE,aAAa,CAAC,QAAQ,CAAC;MAC9CH,WAAW,CAACV,GAAG,GAAGD,MAAM,CAACC,GAAG;MAC5BU,WAAW,CAACI,KAAK,GAAG,IAAI;MACxBJ,WAAW,CAACK,YAAY,CAAC,aAAa,EAAE,SAAS,CAAC;MAElDhB,MAAM,CAACE,UAAU,IAAIe,MAAM,CAACC,OAAO,CAAClB,MAAM,CAACE,UAAU,CAAC,CAACiB,MAAM,GAAG,CAAC,GAC9DF,MAAM,CAACC,OAAO,CAAClB,MAAM,CAACE,UAAU,CAAC,CAACkB,GAAG,CAAC;QAAA,IAAEC,GAAG;UAAEC,KAAK;QAAA,OAAMX,WAAW,CAACK,YAAY,CAACK,GAAG,EAAEC,KAAK,CAAC;QAAC,GAC7F,IAAI;MAEP,IAAItB,MAA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AI,CAAC,CAAC,CAAC;EAI1CmD,cAAc,EAAEnD,cAAI;EAIpBoD,WAAW,EAAEpD,cAAI;EAIjBqD,YAAY,EAAErD,cAAI;EAIlBsD,YAAY,EAAER,mBAAS,CAAC,CAAC5D,gBAAM,EAAEH,gBAAM,CAAC,CAAC;EAIzCwE,cAAc,EAAEnE;AAAM,EACtB;;;;"}
|
|
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' }) => {\n\tconst script = apiKey\n\t\t? {\n\t\t\t\tsrc: `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=${libraries?.join(',')}`,\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?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, 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\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 })\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}\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}\n\nexport default GoogleMap\n"],"names":["useScript","script","forcedStatus","src","attributes","callbacks","onLoadCallback","onErrorCallback","elementIdToAppend","undefined","useState","status","setStatus","useEffect","scriptToAdd","document","querySelector","createElement","async","setAttribute","Object","entries","length","map","key","value","getElementById","appendChild","body","setAttributeFromEvent","event","type","addEventListener","currentScriptStatus","getAttribute","setStateFromEvent","removeEventListener","useGoogleMaps","apiKey","libraries","loadScriptExternally","join","id","isArraysEqualEps","arrayA","arrayB","eps","i","Math","abs","useMemoCompare","next","compare","previousRef","useRef","previous","current","isEqual","createOverlay","container","pane","position","maps","Overlay","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","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","setMaps","googleApiCalled","setGoogleApiCalled","onIdle","useCallback","zoom","getZoom","bounds","getBounds","centerLatLng","getCenter","ne","getNorthEast","sw","getSouthWest","boundsArray","center","window","google","Map","ref","clearListeners","addListener","width","height","left","top","margin","padding","oneOfType","arrayOf","func","GoogleMap","forwardRef","loadingContent","idleContent","errorContent","mapMinHeight","containerProps","renderers","ready","loading","idle","error","_status","overflow","minHeight","bool","oneOf"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,IAAMA,SAAS,GAAG,SAAZA,SAAS,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,gBAA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gBACf6B,YAAY,CAAC7B,SAAS;EAIzBU,QAAQ,EAAEwD,mBAAS,CAAC,CAAC9C,cAAI,EAAE+C,iBAAO,CAAC/C,cAAI,CAAC,CAAC,CAAC;EAI1CmD,cAAc,EAAEnD,cAAI;EAIpBoD,WAAW,EAAEpD,cAAI;EAIjBqD,YAAY,EAAErD,cAAI;EAIlBsD,YAAY,EAAER,mBAAS,CAAC,CAAC5D,gBAAM,EAAEH,gBAAM,CAAC,CAAC;EAIzCwE,cAAc,EAAEnE,gBAAM;EAOtBjD,oBAAoB,EAAE6H,cAAI;EAK1B1J,MAAM,EAAE2J,eAAK,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC;AAAC,EACpD;;;;"}
|
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, string, shape, number, object, node, oneOfType, arrayOf, func } from 'prop-types';
|
|
1
|
+
import { element, string, shape, number, object, node, oneOfType, arrayOf, func, bool, oneOf } from 'prop-types';
|
|
2
2
|
import React, { useState, useEffect, useRef, useMemo, Children, isValidElement, useCallback, forwardRef } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
|
|
@@ -41,7 +41,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
41
41
|
return target;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
var useScript = function useScript(script) {
|
|
44
|
+
var useScript = function useScript(script, forcedStatus) {
|
|
45
45
|
if (script === void 0) {
|
|
46
46
|
script = {
|
|
47
47
|
src: '',
|
|
@@ -53,11 +53,19 @@ var useScript = function useScript(script) {
|
|
|
53
53
|
elementIdToAppend: null
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
+
if (forcedStatus === void 0) {
|
|
57
|
+
forcedStatus = undefined;
|
|
58
|
+
}
|
|
56
59
|
var _useState = useState(script.src ? 'loading' : 'idle'),
|
|
57
60
|
status = _useState[0],
|
|
58
61
|
setStatus = _useState[1];
|
|
59
62
|
useEffect(function () {
|
|
60
63
|
var _script$callbacks, _script$callbacks2;
|
|
64
|
+
if (forcedStatus) {
|
|
65
|
+
setStatus(forcedStatus);
|
|
66
|
+
return function () {
|
|
67
|
+
};
|
|
68
|
+
}
|
|
61
69
|
if (!script.src) {
|
|
62
70
|
setStatus('idle');
|
|
63
71
|
return;
|
|
@@ -110,26 +118,30 @@ var useScript = function useScript(script) {
|
|
|
110
118
|
}
|
|
111
119
|
};
|
|
112
120
|
},
|
|
113
|
-
[script]);
|
|
121
|
+
[script, forcedStatus, status]);
|
|
114
122
|
return status;
|
|
115
123
|
};
|
|
116
124
|
|
|
117
125
|
var useGoogleMaps = function useGoogleMaps(_ref) {
|
|
118
126
|
var apiKey = _ref.apiKey,
|
|
119
127
|
_ref$libraries = _ref.libraries,
|
|
120
|
-
libraries = _ref$libraries === void 0 ? [] : _ref$libraries
|
|
128
|
+
libraries = _ref$libraries === void 0 ? [] : _ref$libraries,
|
|
129
|
+
_ref$loadScriptExtern = _ref.loadScriptExternally,
|
|
130
|
+
loadScriptExternally = _ref$loadScriptExtern === void 0 ? false : _ref$loadScriptExtern,
|
|
131
|
+
_ref$status = _ref.status,
|
|
132
|
+
status = _ref$status === void 0 ? 'idle' : _ref$status;
|
|
121
133
|
var script = apiKey ? {
|
|
122
|
-
src: "https://maps.googleapis.com/maps/api/js?key=" + apiKey + "&libraries=" + (libraries === null || libraries === void 0 ? void 0 : libraries.join(
|
|
134
|
+
src: "https://maps.googleapis.com/maps/api/js?key=" + apiKey + "&libraries=" + (libraries === null || libraries === void 0 ? void 0 : libraries.join(',')),
|
|
123
135
|
attributes: {
|
|
124
|
-
id:
|
|
136
|
+
id: 'googleMapsApi'
|
|
125
137
|
}
|
|
126
138
|
} : {
|
|
127
|
-
src: "https://maps.googleapis.com/maps/api/js?libraries=" + (libraries === null || libraries === void 0 ? void 0 : libraries.join(
|
|
139
|
+
src: "https://maps.googleapis.com/maps/api/js?libraries=" + (libraries === null || libraries === void 0 ? void 0 : libraries.join(',')),
|
|
128
140
|
attributes: {
|
|
129
|
-
id:
|
|
141
|
+
id: 'googleMapsApi'
|
|
130
142
|
}
|
|
131
143
|
};
|
|
132
|
-
return useScript(script);
|
|
144
|
+
return useScript(script, loadScriptExternally ? status : undefined);
|
|
133
145
|
};
|
|
134
146
|
|
|
135
147
|
var isArraysEqualEps = function isArraysEqualEps(arrayA, arrayB, eps) {
|
|
@@ -268,10 +280,13 @@ var MapMarkers = function MapMarkers(_ref) {
|
|
|
268
280
|
lat: child.props.lat,
|
|
269
281
|
lng: child.props.lng
|
|
270
282
|
};
|
|
283
|
+
var zIndex = child.props.zIndex || undefined;
|
|
284
|
+
|
|
271
285
|
return /*#__PURE__*/React.createElement(OverlayView, {
|
|
272
286
|
position: latLng,
|
|
273
287
|
map: map,
|
|
274
|
-
maps: maps
|
|
288
|
+
maps: maps,
|
|
289
|
+
zIndex: zIndex
|
|
275
290
|
}, child);
|
|
276
291
|
}
|
|
277
292
|
});
|
|
@@ -385,7 +400,7 @@ MapComponent.propTypes = {
|
|
|
385
400
|
options: object
|
|
386
401
|
};
|
|
387
402
|
|
|
388
|
-
var _excluded = ["apiKey", "libraries", "children", "loadingContent", "idleContent", "errorContent", "mapMinHeight", "containerProps"];
|
|
403
|
+
var _excluded = ["apiKey", "libraries", "children", "loadingContent", "idleContent", "errorContent", "mapMinHeight", "containerProps", "loadScriptExternally", "status"];
|
|
389
404
|
var GoogleMap = /*#__PURE__*/forwardRef(function GoogleMap(_ref, ref) {
|
|
390
405
|
var apiKey = _ref.apiKey,
|
|
391
406
|
libraries = _ref.libraries,
|
|
@@ -395,10 +410,20 @@ var GoogleMap = /*#__PURE__*/forwardRef(function GoogleMap(_ref, ref) {
|
|
|
395
410
|
errorContent = _ref.errorContent,
|
|
396
411
|
mapMinHeight = _ref.mapMinHeight,
|
|
397
412
|
containerProps = _ref.containerProps,
|
|
413
|
+
loadScriptExternally = _ref.loadScriptExternally,
|
|
414
|
+
status = _ref.status,
|
|
398
415
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
399
|
-
var
|
|
416
|
+
var renderers = {
|
|
417
|
+
ready: /*#__PURE__*/React.createElement(MapComponent, props, children),
|
|
418
|
+
loading: loadingContent,
|
|
419
|
+
idle: idleContent,
|
|
420
|
+
error: errorContent
|
|
421
|
+
};
|
|
422
|
+
var _status = useGoogleMaps({
|
|
400
423
|
apiKey: apiKey,
|
|
401
|
-
libraries: libraries
|
|
424
|
+
libraries: libraries,
|
|
425
|
+
loadScriptExternally: loadScriptExternally,
|
|
426
|
+
status: status
|
|
402
427
|
});
|
|
403
428
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
404
429
|
style: {
|
|
@@ -409,7 +434,7 @@ var GoogleMap = /*#__PURE__*/forwardRef(function GoogleMap(_ref, ref) {
|
|
|
409
434
|
minHeight: mapMinHeight
|
|
410
435
|
},
|
|
411
436
|
ref: ref
|
|
412
|
-
}, containerProps),
|
|
437
|
+
}, containerProps), renderers[_status] || null);
|
|
413
438
|
});
|
|
414
439
|
GoogleMap.defaultProps = _extends({}, MapComponent.defaultProps, {
|
|
415
440
|
loadingContent: 'Google Maps is loading',
|
|
@@ -417,7 +442,9 @@ GoogleMap.defaultProps = _extends({}, MapComponent.defaultProps, {
|
|
|
417
442
|
errorContent: 'Google Maps is on error',
|
|
418
443
|
mapMinHeight: 'unset',
|
|
419
444
|
apiKey: '',
|
|
420
|
-
libraries: ['places', 'geometry']
|
|
445
|
+
libraries: ['places', 'geometry'],
|
|
446
|
+
loadScriptExternally: false,
|
|
447
|
+
status: 'idle'
|
|
421
448
|
});
|
|
422
449
|
GoogleMap.propTypes = _extends({}, MapComponent.propTypes, {
|
|
423
450
|
children: oneOfType([node, arrayOf(node)]),
|
|
@@ -425,7 +452,9 @@ GoogleMap.propTypes = _extends({}, MapComponent.propTypes, {
|
|
|
425
452
|
idleContent: node,
|
|
426
453
|
errorContent: node,
|
|
427
454
|
mapMinHeight: oneOfType([number, string]),
|
|
428
|
-
containerProps: object
|
|
455
|
+
containerProps: object,
|
|
456
|
+
loadScriptExternally: bool,
|
|
457
|
+
status: oneOf(['idle', 'loading', 'ready', 'error'])
|
|
429
458
|
});
|
|
430
459
|
|
|
431
460
|
export default GoogleMap;
|
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 { useState, useEffect } 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) => {\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\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\t\t// Re-run useEffect if script changes\n\t\t[script]\n\t)\n\treturn status\n}\n","import { useScript } from \"./useScript\";\n\n/**\n * @returns {\"idle\" | \"loading\" | \"ready\" | \"error\"} status\n */\nexport const useGoogleMaps = ({ apiKey, libraries = [] }) => {\n\tconst script = apiKey\n\t\t? {\n\t\t\t\tsrc: `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=${libraries?.join(\",\")}`,\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?libraries=${libraries?.join(\",\")}`,\n\t\t\t\tattributes: { id: \"googleMapsApi\" },\n\t\t};\n\n\treturn useScript(script);\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\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}>\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, node, number, object, 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{ apiKey, libraries, children, loadingContent, idleContent, errorContent, mapMinHeight, containerProps, ...props },\n\tref\n) {\n\tconst status = useGoogleMaps({ apiKey, libraries })\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{status === 'ready' ? (\n\t\t\t\t<MapComponent {...props}>{children}</MapComponent>\n\t\t\t) : status === 'loading' ? (\n\t\t\t\tloadingContent\n\t\t\t) : status === 'idle' ? (\n\t\t\t\tidleContent\n\t\t\t) : status === 'error' ? (\n\t\t\t\terrorContent\n\t\t\t) : 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}\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}\n\nexport default GoogleMap\n"],"names":["useScript","script","src","attributes","callbacks","onLoadCallback","onErrorCallback","elementIdToAppend","useState","status","setStatus","useEffect","scriptToAdd","document","querySelector","createElement","async","setAttribute","Object","entries","length","map","key","value","getElementById","appendChild","body","setAttributeFromEvent","event","type","addEventListener","currentScriptStatus","getAttribute","setStateFromEvent","removeEventListener","useGoogleMaps","apiKey","libraries","join","id","isArraysEqualEps","arrayA","arrayB","eps","i","Math","abs","useMemoCompare","next","compare","previousRef","useRef","previous","current","isEqual","createOverlay","container","pane","position","maps","Overlay","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","zIndex","children","useMemo","div","overlay","childrenProps","props","prev","setMap","createPortal","defaultProps","node","MapMarkers","markers","Children","child","isValidElement","latLng","EPS","MapComponent","defaultCenter","defaultZoom","onGoogleApiLoaded","onChange","options","mapRef","prevBoundsRef","setMaps","googleApiCalled","setGoogleApiCalled","onIdle","useCallback","zoom","getZoom","bounds","getBounds","centerLatLng","getCenter","ne","getNorthEast","sw","getSouthWest","boundsArray","center","window","google","Map","ref","clearListeners","addListener","width","height","left","top","margin","padding","oneOfType","arrayOf","func","GoogleMap","forwardRef","loadingContent","idleContent","errorContent","mapMinHeight","containerProps","overflow","minHeight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,IAAMA,SAAS,GAAG,SAAZA,SAAS,CACrBC,MAAM,EAMF;EAAA,IANJA,MAAM;IAANA,MAAM,GAAG;MACRC,GAAG,EAAE,EAAE;MACPC,UAAU,EAAE,EAAE;MACdC,SAAS,EAAE;QAAEC,cAAc,EAAE,IAAI;QAAEC,eAAe,EAAE;OAAM;MAC1DC,iBAAiB,EAAE;KACnB;;EAGD,gBAA4BC,QAAQ,CAACP,MAAM,CAACC,GAAG,GAAG,SAAS,GAAG,MAAM,CAAC;IAA9DO,MAAM;IAAEC,SAAS;EAExBC,SAAS,CACR,YAAM;IAAA;IAGL,IAAI,CAACV,MAAM,CAACC,GAAG,EAAE;MAChBQ,SAAS,CAAC,MAAM,CAAC;MACjB;;IAID,IAAIE,WAAW,GAAGC,QAAQ,CAACC,aAAa,mBAAgBb,MAAM,CAACC,GAAG,SAAK;IACvE,IAAI,CAACU,WAAW,EAAE;MAEjBA,WAAW,GAAGC,QAAQ,CAACE,aAAa,CAAC,QAAQ,CAAC;MAC9CH,WAAW,CAACV,GAAG,GAAGD,MAAM,CAACC,GAAG;MAC5BU,WAAW,CAACI,KAAK,GAAG,IAAI;MACxBJ,WAAW,CAACK,YAAY,CAAC,aAAa,EAAE,SAAS,CAAC;MAElDhB,MAAM,CAACE,UAAU,IAAIe,MAAM,CAACC,OAAO,CAAClB,MAAM,CAACE,UAAU,CAAC,CAACiB,MAAM,GAAG,CAAC,GAC9DF,MAAM,CAACC,OAAO,CAA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G,SAAS,CAACpE,SAAS,gBACf4B,YAAY,CAAC5B,SAAS;EAIzBU,QAAQ,EAAEuD,SAAS,CAAC,CAAC7C,IAAI,EAAE8C,OAAO,CAAC9C,IAAI,CAAC,CAAC,CAAC;EAI1CkD,cAAc,EAAElD,IAAI;EAIpBmD,WAAW,EAAEnD,IAAI;EAIjBoD,YAAY,EAAEpD,IAAI;EAIlBqD,YAAY,EAAER,SAAS,CAAC,CAAC3D,MAAM,EAAEH,MAAM,CAAC,CAAC;EAIzCuE,cAAc,EAAElE;AAAM,EACtB;;;;"}
|
|
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' }) => {\n\tconst script = apiKey\n\t\t? {\n\t\t\t\tsrc: `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=${libraries?.join(',')}`,\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?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, 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\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 })\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}\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}\n\nexport default GoogleMap\n"],"names":["useScript","script","forcedStatus","src","attributes","callbacks","onLoadCallback","onErrorCallback","elementIdToAppend","undefined","useState","status","setStatus","useEffect","scriptToAdd","document","querySelector","createElement","async","setAttribute","Object","entries","length","map","key","value","getElementById","appendChild","body","setAttributeFromEvent","event","type","addEventListener","currentScriptStatus","getAttribute","setStateFromEvent","removeEventListener","useGoogleMaps","apiKey","libraries","loadScriptExternally","join","id","isArraysEqualEps","arrayA","arrayB","eps","i","Math","abs","useMemoCompare","next","compare","previousRef","useRef","previous","current","isEqual","createOverlay","container","pane","position","maps","Overlay","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","zIndex","children","useMemo","div","overlay","childrenProps","props","prev","setMap","createPortal","defaultProps","node","MapMarkers","markers","Children","child","isValidElement","latLng","EPS","MapComponent","defaultCenter","defaultZoom","onGoogleApiLoaded","onChange","options","mapRef","prevBoundsRef","setMaps","googleApiCalled","setGoogleApiCalled","onIdle","useCallback","zoom","getZoom","bounds","getBounds","centerLatLng","getCenter","ne","getNorthEast","sw","getSouthWest","boundsArray","center","window","google","Map","ref","clearListeners","addListener","width","height","left","top","margin","padding","oneOfType","arrayOf","func","GoogleMap","forwardRef","loadingContent","idleContent","errorContent","mapMinHeight","containerProps","renderers","ready","loading","idle","error","_status","overflow","minHeight","bool","oneOf"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,IAAMA,SAAS,GAAG,SAAZA,SAAS,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,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oB,EAAE,KAAK;EAC3B7B,MAAM,EAAE;AAAM,EACd;AAED0I,SAAS,CAACpE,SAAS,gBACf4B,YAAY,CAAC5B,SAAS;EAIzBU,QAAQ,EAAEuD,SAAS,CAAC,CAAC7C,IAAI,EAAE8C,OAAO,CAAC9C,IAAI,CAAC,CAAC,CAAC;EAI1CkD,cAAc,EAAElD,IAAI;EAIpBmD,WAAW,EAAEnD,IAAI;EAIjBoD,YAAY,EAAEpD,IAAI;EAIlBqD,YAAY,EAAER,SAAS,CAAC,CAAC3D,MAAM,EAAEH,MAAM,CAAC,CAAC;EAIzCuE,cAAc,EAAElE,MAAM;EAOtBjD,oBAAoB,EAAE4H,IAAI;EAK1BzJ,MAAM,EAAE0J,KAAK,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC;AAAC,EACpD;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "google-maps-react-markers",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Google Maps library with markers as react components",
|
|
5
5
|
"author": "Giorgia Bosello",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,40 +43,41 @@
|
|
|
43
43
|
"react-dom": "^18.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@babel/core": "^7.20.
|
|
46
|
+
"@babel/core": "^7.20.12",
|
|
47
47
|
"@babel/eslint-parser": "^7.19.1",
|
|
48
48
|
"@babel/preset-env": "^7.20.2",
|
|
49
49
|
"@babel/preset-react": "^7.18.6",
|
|
50
50
|
"babel-eslint": "^10.0.3",
|
|
51
51
|
"cross-env": "^7.0.2",
|
|
52
|
-
"eslint": "^8.
|
|
53
|
-
"eslint-config-prettier": "^8.
|
|
52
|
+
"eslint": "^8.33.0",
|
|
53
|
+
"eslint-config-prettier": "^8.6.0",
|
|
54
54
|
"eslint-config-standard": "^17.0.0",
|
|
55
|
-
"eslint-config-standard-react": "^
|
|
56
|
-
"eslint-plugin-import": "^2.
|
|
57
|
-
"eslint-plugin-
|
|
55
|
+
"eslint-config-standard-react": "^13.0.0",
|
|
56
|
+
"eslint-plugin-import": "^2.27.5",
|
|
57
|
+
"eslint-plugin-jsx": "^0.1.0",
|
|
58
|
+
"eslint-plugin-n": "^15.6.1",
|
|
58
59
|
"eslint-plugin-node": "^11.0.0",
|
|
59
60
|
"eslint-plugin-prettier": "^4.2.1",
|
|
60
61
|
"eslint-plugin-promise": "^6.1.1",
|
|
61
|
-
"eslint-plugin-react": "^7.
|
|
62
|
+
"eslint-plugin-react": "^7.32.2",
|
|
62
63
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
63
64
|
"eslint-plugin-standard": "^5.0.0",
|
|
64
65
|
"eslint-plugin-typescript": "^0.14.0",
|
|
65
|
-
"gh-pages": "^
|
|
66
|
+
"gh-pages": "^5.0.0",
|
|
66
67
|
"microbundle-crl": "^0.13.10",
|
|
67
68
|
"npm-run-all": "^4.1.5",
|
|
68
|
-
"prettier": "^2.8.
|
|
69
|
+
"prettier": "^2.8.3",
|
|
69
70
|
"react": "^18.2.0",
|
|
70
71
|
"react-dom": "^18.2.0",
|
|
71
72
|
"react-scripts": "^5.0.1",
|
|
72
|
-
"typescript": "^4.9.
|
|
73
|
+
"typescript": "^4.9.5"
|
|
73
74
|
},
|
|
74
75
|
"files": [
|
|
75
76
|
"dist"
|
|
76
77
|
],
|
|
77
78
|
"dependencies": {
|
|
78
79
|
"@babel/plugin-syntax-flow": "^7.18.6",
|
|
79
|
-
"@babel/plugin-transform-react-jsx": "^7.
|
|
80
|
+
"@babel/plugin-transform-react-jsx": "^7.20.13",
|
|
80
81
|
"prop-types": "^15.8.1"
|
|
81
82
|
}
|
|
82
83
|
}
|