Skip to content

Commit

Permalink
Fix(throttling): change singleAddRemoveBufferDuration option default …
Browse files Browse the repository at this point in the history
…to 0

in order to avoid confusing app developer due to the fact that `addLayer` becomes asynchronous when this option is enabled (i.e. value >= 0).
Also updated the README API section accordingly.

Fixes #11
  • Loading branch information
ghybs committed Feb 6, 2018
1 parent f06ca96 commit f363f33
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ the Control, markers will automatically cluster / be removed.
### Options
| Option | Type | Default | Description |
| :------ | :-----| :------ | :---------- |
| **singleAddRemoveBufferDuration** | `Number` | `100` | Gathers all calls to `addLayer` and `removeLayer` single operations (on this MCG) that happen during the specified duration (in ms) for batch processing. Similar to throttling with execution on trailing edge only. Use `0` to disable throttling. |
| **singleAddRemoveBufferDuration** | `Number` | `0` | Gathers all calls to `addLayer` and `removeLayer` single operations (on this MCG) that happen during the specified duration (in ms) for batch processing. Similar to throttling with execution on trailing edge only. Use `0` to disable throttling. Disabled by default (see [#11](https://github.com/ghybs/Leaflet.MarkerCluster.LayerSupport/issues/11)) |


### Methods
Expand Down
2 changes: 1 addition & 1 deletion build/readme.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ the Control, markers will automatically cluster / be removed.
### Options
| Option | Type | Default | Description |
| :------ | :-----| :------ | :---------- |
| **singleAddRemoveBufferDuration** | `Number` | `100` | Gathers all calls to `addLayer` and `removeLayer` single operations (on this MCG) that happen during the specified duration (in ms) for batch processing. Similar to throttling with execution on trailing edge only. Use `0` to disable throttling. |
| **singleAddRemoveBufferDuration** | `Number` | `0` | Gathers all calls to `addLayer` and `removeLayer` single operations (on this MCG) that happen during the specified duration (in ms) for batch processing. Similar to throttling with execution on trailing edge only. Use `0` to disable throttling. Disabled by default (see [#11](https://github.com/ghybs/Leaflet.MarkerCluster.LayerSupport/issues/11)) |


### Methods
Expand Down
2 changes: 1 addition & 1 deletion src/layersupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ L.MarkerClusterGroup.LayerSupport = L.MarkerClusterGroup.extend({

options: {
// Buffer single addLayer and removeLayer requests for efficiency.
singleAddRemoveBufferDuration: 100 // in ms.
singleAddRemoveBufferDuration: 0 // in ms.
},

initialize: function (options) {
Expand Down

0 comments on commit f363f33

Please sign in to comment.