Skip to content

Commit b4b4c98

Browse files
authored
Update features.py
1 parent cffe7ab commit b4b4c98

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

folium/features.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,17 +756,18 @@ class MarkerCluster(Layer):
756756
Adds the layer as an optional overlay (True) or the base layer (False).
757757
control : bool, default True
758758
Whether the Layer will be included in LayerControls
759-
759+
icon_create_function : string, default None
760+
Override the default behaviour, making possible to customize markers colors and sizes
760761
"""
761-
def __init__(self, name=None, overlay=True, control=True, icon_create_function=""):
762+
def __init__(self, name=None, overlay=True, control=True, icon_create_function=None):
762763
super(MarkerCluster, self).__init__(name=name, overlay=overlay,
763764
control=control)
764765
self._name = 'MarkerCluster'
765766
self._icon_create_function = icon_create_function.strip()
766767
self._template = Template(u"""
767768
{% macro script(this, kwargs) %}
768769
var {{this.get_name()}} = L.markerClusterGroup({
769-
{% if this._icon_create_function != "" %}
770+
{% if this._icon_create_function %}
770771
iconCreateFunction: {{this._icon_create_function}}
771772
{% endif %}
772773
});

0 commit comments

Comments
 (0)