react-map-gl
Advanced tools
Comparing version 7.0.20 to 7.0.21
@@ -5,2 +5,6 @@ # CHANGELOG | ||
## 7.0.21 (Jan 7, 2023) | ||
- fix `reuseMaps` not removing map children (#2092) | ||
## 7.0.20 (Dec 2, 2022) | ||
@@ -7,0 +11,0 @@ |
@@ -130,3 +130,4 @@ "use strict"; | ||
var style = (0, react_1.useMemo)(function () { return (__assign({ position: 'relative', width: '100%', height: '100%' }, props.style)); }, [props.style]); | ||
return (React.createElement("div", { id: props.id, ref: containerRef, style: style }, mapInstance && (React.createElement(exports.MapContext.Provider, { value: contextValue }, props.children)))); | ||
return (React.createElement("div", { id: props.id, ref: containerRef, style: style }, mapInstance && (React.createElement(exports.MapContext.Provider, { value: contextValue }, | ||
React.createElement("div", { "mapboxgl-children": "" }, props.children))))); | ||
}); | ||
@@ -133,0 +134,0 @@ Map.displayName = 'Map'; |
@@ -295,2 +295,6 @@ "use strict"; | ||
Mapbox.prototype.recycle = function () { | ||
// Clean up unnecessary elements before storing for reuse. | ||
var container = this.map.getContainer(); | ||
var children = container.querySelector('[mapboxgl-children]'); | ||
children === null || children === void 0 ? void 0 : children.remove(); | ||
Mapbox.savedMaps.push(this); | ||
@@ -297,0 +301,0 @@ }; |
@@ -105,3 +105,4 @@ import * as React from 'react'; | ||
}), [props.style]); | ||
return (React.createElement("div", { id: props.id, ref: containerRef, style: style }, mapInstance && (React.createElement(MapContext.Provider, { value: contextValue }, props.children)))); | ||
return (React.createElement("div", { id: props.id, ref: containerRef, style: style }, mapInstance && (React.createElement(MapContext.Provider, { value: contextValue }, | ||
React.createElement("div", { "mapboxgl-children": "" }, props.children))))); | ||
}); | ||
@@ -108,0 +109,0 @@ Map.displayName = 'Map'; |
@@ -267,2 +267,6 @@ import { transformToViewState, applyViewStateToTransform, cloneTransform } from '../utils/transform'; | ||
recycle() { | ||
// Clean up unnecessary elements before storing for reuse. | ||
const container = this.map.getContainer(); | ||
const children = container.querySelector('[mapboxgl-children]'); | ||
children === null || children === void 0 ? void 0 : children.remove(); | ||
Mapbox.savedMaps.push(this); | ||
@@ -269,0 +273,0 @@ } |
{ | ||
"name": "react-map-gl", | ||
"description": "React components for Mapbox GL JS-compatible libraries", | ||
"version": "7.0.20", | ||
"version": "7.0.21", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "mapbox", |
@@ -590,2 +590,7 @@ import {transformToViewState, applyViewStateToTransform, cloneTransform} from '../utils/transform'; | ||
recycle() { | ||
// Clean up unnecessary elements before storing for reuse. | ||
const container = this.map.getContainer(); | ||
const children = container.querySelector('[mapboxgl-children]'); | ||
children?.remove(); | ||
Mapbox.savedMaps.push(this); | ||
@@ -592,0 +597,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
448329
7884