@planet/maps 8.0.0-dev.1666730533438 → 8.0.0-dev.1666881400968

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/package.json +1 -1
  2. package/renderer/render.js +10 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planet/maps",
3
- "version": "8.0.0-dev.1666730533438",
3
+ "version": "8.0.0-dev.1666881400968",
4
4
  "description": "Declarative mapping components for React",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -188,6 +188,15 @@ function removeChildFromContainer(map, child) {
188
188
  throw new Error(`Cannot remove child from the map: ${child}`);
189
189
  }
190
190
 
191
+ function removeChild(parent, child) {
192
+ // this happens with group layers
193
+ if (child instanceof BaseLayer && parent.getLayers) {
194
+ parent.getLayers().remove(child);
195
+ return;
196
+ }
197
+ throw new Error(`TODO: implement removeChild for ${parent} and ${child}`);
198
+ }
199
+
191
200
  function clearContainer(map) {
192
201
  map.getLayers().clear();
193
202
  // Need to leave the default controls and interactions.
@@ -243,10 +252,7 @@ const reconciler = ReactReconciler({
243
252
  commitUpdate,
244
253
  clearContainer,
245
254
  removeChildFromContainer,
246
-
247
- removeChild() {
248
- throw new Error('TODO: implement removeChild');
249
- },
255
+ removeChild,
250
256
 
251
257
  insertInContainerBefore,
252
258
  insertBefore,