Skip to content

Commit e8831ee

Browse files
authored
Added docstring Example
1 parent b4b4c98 commit e8831ee

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

folium/features.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,18 @@ class MarkerCluster(Layer):
758758
Whether the Layer will be included in LayerControls
759759
icon_create_function : string, default None
760760
Override the default behaviour, making possible to customize markers colors and sizes
761+
762+
Example
763+
-------
764+
>>> icon_create_function = '''
765+
... function (cluster) {
766+
... var childCount = cluster.getChildCount();
767+
... var c = ' marker-cluster-small';
768+
... return new L.DivIcon({ html: '<div><span>' + childCount + '</span></div>',
769+
className: 'marker-cluster' + c,
770+
iconSize: new L.Point(40, 40) });
771+
... }
772+
... '''
761773
"""
762774
def __init__(self, name=None, overlay=True, control=True, icon_create_function=None):
763775
super(MarkerCluster, self).__init__(name=name, overlay=overlay,

0 commit comments

Comments
 (0)