| 109 | self.children_for_m2.append((child, name, index)) |
| 110 | |
| 111 | def render(self, **kwargs): |
| 112 | super().render(**kwargs) |
| 113 | |
| 114 | for child, name, index in self.children_for_m2: |
| 115 | if child._id in self.children_for_m2_copied: |
| 116 | # This map has been rendered before, child was copied already. |
| 117 | continue |
| 118 | child_copy = deep_copy(child) |
| 119 | if isinstance(child_copy, LayerControl): |
| 120 | child_copy.reset() |
| 121 | self.m2.add_child(child_copy, name, index) |
| 122 | # m2 has already been rendered, so render the child here: |
| 123 | child_copy.render() |
| 124 | self.children_for_m2_copied.append(child._id) |
| 125 | |
| 126 | def fit_bounds(self, *args, **kwargs): |
| 127 | for m in (self.m1, self.m2): |