@vinctus/react-maplibre 0.2.22 → 0.2.23

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/Map.js +4 -1
  2. package/package.json +1 -1
package/dist/Map.js CHANGED
@@ -47,6 +47,9 @@ export const Map = React.forwardRef((_a, ref) => {
47
47
  const optionsString = JSON.stringify(options || {});
48
48
  useImperativeHandle(ref, () => map, [map]);
49
49
  useEffect(() => {
50
+ if (map) {
51
+ return;
52
+ }
50
53
  if (mapContainer.current) {
51
54
  const parsedOptions = JSON.parse(optionsString);
52
55
  const m = new maplibre.Map(Object.assign({ container: mapContainer.current, style: mapStyle, center: [longitude, latitude], zoom }, parsedOptions));
@@ -71,7 +74,7 @@ export const Map = React.forwardRef((_a, ref) => {
71
74
  return () => {
72
75
  m.remove(); // This destroys the map and cleans up all layers/sources
73
76
  mapInstanceRef.current = null;
74
- setMap(null);
77
+ // setMap(null)
75
78
  };
76
79
  }
77
80
  }, [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vinctus/react-maplibre",
3
- "version": "0.2.22",
3
+ "version": "0.2.23",
4
4
  "description": "Minimalist MapLibre GL JS React wrapper library",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",