Skip to content

Commit 93c14b3

Browse files
committed
Document the add/remove/substitute changes in #982
1 parent beb5ed8 commit 93c14b3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ Here are some highlights of changes in this version. See the full list of change
1818
* `legend.positionnning` -> `legend.position`
1919

2020
The recommended way to create a LegendControl with a given title is to use the `title` parameter: `LegendControl({}, title='My Title')`. There is a backwards compatibility shim in place, so giving the title as `name` in the constructor still works, but is not recommended: `LegendControl({}, name='My Title')`
21+
* Deprecate layer and control-specific methods for maps, in favor of methods that work for both layers and controls [#982](https://github.com/jupyter-widgets/ipyleaflet/pull/982). Update your code with the following substitutions for a Map `map`:
22+
* `map.add_control(...)` or `map.add_layer(...)` -> `map.add(...)`
23+
* `map.remove_control(...)` or `map.remove_layer(...)` -> `map.remove(...)`
24+
* `map.remove_control(...)` or `map.remove_layer(...)` -> `map.remove(...)`
25+
* `map.substitute_control(...)` or `map.substitute_layer(...)` -> `map.substitute(...)`
26+
* `map.clear_controls(...)` or `map.clear_layers(...)` -> `map.clear(...)`
27+
28+
The inline operators still continue to work as before, such as `map += control` or `map -= layer`.
2129

2230
### Maintenance
2331

0 commit comments

Comments
 (0)