Skip to content

Commit 80b615f

Browse files
author
Martin Journois
committed
Take the occasion to do #246
1 parent 1957061 commit 80b615f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

folium/element.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ def get_bounds(self):
6767
return bounds
6868

6969
def add_children(self, child, name=None, index=None):
70+
"""Add a child."""
71+
return self.add_child(child, name=name, index=index)
72+
73+
def add_child(self, child, name=None, index=None):
7074
"""Add a child."""
7175
if name is None:
7276
name = child.get_name()
@@ -78,10 +82,12 @@ def add_children(self, child, name=None, index=None):
7882
items.insert(int(index), (name, child))
7983
self._children = items
8084
child._parent = self
85+
return self
8186

8287
def add_to(self, parent, name=None, index=None):
8388
"""Add element to a parent."""
8489
parent.add_children(self, name=name, index=index)
90+
return self
8591

8692
def to_dict(self, depth=-1, ordered=True, **kwargs):
8793
if ordered:

0 commit comments

Comments
 (0)