|
12 | 12 |
|
13 | 13 |
|
14 | 14 | 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. |
18 | 23 |
|
19 | 24 | Parameters |
20 | 25 | ---------- |
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]]. |
23 | 29 |
|
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. |
25 | 34 |
|
26 | | - popup: popup for each marker |
27 | | - """ |
28 | | - def __init__(self, data, callback=None): |
| 35 | + """ |
29 | 36 | super(FastMarkerCluster, self).__init__([]) |
30 | | - self._name = 'Script' |
| 37 | + self._name = 'FastMarkerCluster' |
31 | 38 | self._data = data |
| 39 | + |
32 | 40 | if callback is None: |
33 | 41 | self._callback = ('var callback;\n' + |
34 | 42 | 'callback = function (row) {\n' + |
|
0 commit comments