@vinctus/react-maplibre 0.2.20 → 0.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Map.js +0 -2
- package/dist/Marker.js +3 -5
- package/package.json +1 -1
package/dist/Map.js
CHANGED
|
@@ -84,8 +84,6 @@ export const Map = React.forwardRef((_a, ref) => {
|
|
|
84
84
|
onLoad,
|
|
85
85
|
onMoveEnd,
|
|
86
86
|
onZoomEnd,
|
|
87
|
-
setMap,
|
|
88
|
-
setMapLoaded,
|
|
89
87
|
]);
|
|
90
88
|
const memoizedStyle = useMemo(() => (Object.assign({ position: 'relative', width: '100%', height: '100%' }, style)), [style]);
|
|
91
89
|
return (_jsx(ErrorBoundary, { fallback: fallback, children: _jsx("div", { id: id, ref: mapContainer, style: memoizedStyle, children: children }) }));
|
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
|
-
|
|
39
|
-
|
|
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,
|
|
87
|
+
}, [map, optionsString, children, longitude, latitude, popup, closeOnClick, closeButton, popupClassName]);
|
|
90
88
|
return result;
|
|
91
89
|
};
|