@vinctus/react-maplibre 1.3.3 → 1.3.4

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.
Files changed (2) hide show
  1. package/dist/Popup.js +8 -1
  2. package/package.json +1 -1
package/dist/Popup.js CHANGED
@@ -23,7 +23,14 @@ export const Popup = ({ children, longitude, latitude, className, closeOnClick,
23
23
  .setLngLat(coordinates)
24
24
  .setHTML(initialHtml)
25
25
  .addTo(map);
26
- const handleClose = () => { var _a; return (_a = onCloseRef.current) === null || _a === void 0 ? void 0 : _a.call(onCloseRef); };
26
+ // A popup also closes itself when its map is removed, such as when the map is rebuilt for a new
27
+ // style, and that is not a user closing it.
28
+ const handleClose = () => {
29
+ var _a;
30
+ if (!map._removed) {
31
+ (_a = onCloseRef.current) === null || _a === void 0 ? void 0 : _a.call(onCloseRef);
32
+ }
33
+ };
27
34
  popup.on('close', handleClose);
28
35
  popupInstance.current = popup;
29
36
  return () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vinctus/react-maplibre",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Minimalist MapLibre GL JS React wrapper library",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",