@planet/maps 8.0.0-dev.1666848816234 → 8.0.0-dev.1666966232856
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/package.json +1 -1
- package/renderer/render.js +11 -5
package/package.json
CHANGED
package/renderer/render.js
CHANGED
|
@@ -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.
|
|
@@ -214,7 +223,7 @@ function insertInContainerBefore(map, child, beforeChild) {
|
|
|
214
223
|
} else if (child instanceof Control) {
|
|
215
224
|
collection = map.getControls();
|
|
216
225
|
} else if (child instanceof Interaction) {
|
|
217
|
-
collection = map.
|
|
226
|
+
collection = map.getInteractions();
|
|
218
227
|
} else if (child instanceof BaseLayer) {
|
|
219
228
|
collection = map.getLayers();
|
|
220
229
|
}
|
|
@@ -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,
|