@vinctus/react-maplibre 0.2.20 → 0.2.21

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/Marker.js +3 -5
  2. package/package.json +1 -1
package/dist/Marker.js CHANGED
@@ -22,7 +22,6 @@ export const Marker = (_a) => {
22
22
  const popupRef = useRef(null);
23
23
  const cleanupRef = useRef(null);
24
24
  const optionsString = JSON.stringify(options || {});
25
- const popupString = JSON.stringify(popup || null);
26
25
  useEffect(() => {
27
26
  if (!map) {
28
27
  return;
@@ -35,9 +34,8 @@ export const Marker = (_a) => {
35
34
  marker.setLngLat([longitude, latitude]).addTo(map);
36
35
  markerRef.current = marker;
37
36
  // Handle popup manually if provided
38
- const parsedPopup = JSON.parse(popupString);
39
- if (parsedPopup) {
40
- const popupHTML = ReactDOMServer.renderToStaticMarkup(parsedPopup);
37
+ if (popup) {
38
+ const popupHTML = ReactDOMServer.renderToStaticMarkup(popup);
41
39
  const handleMarkerClick = (e) => {
42
40
  e.stopPropagation();
43
41
  // Close existing popup if any
@@ -86,6 +84,6 @@ export const Marker = (_a) => {
86
84
  markerRef.current = null;
87
85
  }
88
86
  };
89
- }, [map, optionsString, children, longitude, latitude, popupString, closeOnClick, closeButton, popupClassName]);
87
+ }, [map, optionsString, children, longitude, latitude, popup, closeOnClick, closeButton, popupClassName]);
90
88
  return result;
91
89
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vinctus/react-maplibre",
3
- "version": "0.2.20",
3
+ "version": "0.2.21",
4
4
  "description": "Minimalist MapLibre GL JS React wrapper library",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",