Skip to content

Commit 090c991

Browse files
committed
Tidy up docstrings
1 parent 4a07c76 commit 090c991

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

folium/plugins/fast_marker_cluster.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,31 @@
1212

1313

1414
class FastMarkerCluster(MarkerCluster):
15-
"""Creates a FasterMarkerCluster plugin to append into a map with
16-
FasterMarkerCluster(data, callback=create_marker).add_to(map)
17-
map.add_to(fig).
15+
"""Add marker clusters to a map using in-browser rendering"""
16+
def __init__(self, data, callback=None):
17+
"""Add marker clusters to a map using in-browser rendering.
18+
Using FastMarkerCluster it is possible to render 000's of
19+
points far quicker than the MarkerCluster class. Be aware
20+
that the FastMarkerCluster class does not retain a
21+
reference to any marker data, and therefore methods such as
22+
get_bounds() are not available when using it.
1823
1924
Parameters
2025
----------
21-
data: list of list or array of shape (n,2).
22-
Data points of the form [[lat, lng]].
26+
data: list
27+
List of list of shape [[], []]. Data points should be of
28+
the form [[lat, lng]].
2329
24-
callback: list of length n.
30+
callback: string, default None
31+
A string representation of a valid Javascript function
32+
that will be passed a lat, lon coordinate pair. See the
33+
FasterMarkerCluster for an example of a custom callback.
2534
26-
popup: popup for each marker
27-
"""
28-
def __init__(self, data, callback=None):
35+
"""
2936
super(FastMarkerCluster, self).__init__([])
30-
self._name = 'Script'
37+
self._name = 'FastMarkerCluster'
3138
self._data = data
39+
3240
if callback is None:
3341
self._callback = ('var callback;\n' +
3442
'callback = function (row) {\n' +

0 commit comments

Comments
 (0)