@vinctus/react-maplibre 1.3.1 → 1.3.2
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/Layer.js +3 -1
- package/package.json +1 -1
package/dist/Layer.js
CHANGED
|
@@ -80,7 +80,9 @@ export const Layer = ({ layer, source }) => {
|
|
|
80
80
|
}, [id, layerStructureString, sourceOptionsString, map, mapLoaded]);
|
|
81
81
|
useEffect(() => {
|
|
82
82
|
const current = applied.current;
|
|
83
|
-
|
|
83
|
+
// A replaced map is removed before the context hands out the new one, so this effect can run
|
|
84
|
+
// once more against the removed map.
|
|
85
|
+
if (!map || !mapLoaded || !current || map._removed) {
|
|
84
86
|
return;
|
|
85
87
|
}
|
|
86
88
|
// The source disappears when the map's style is replaced, so the source and layer are rebuilt
|