From ad597314ff69c06c2dfb3608656da50799c7e6d6 Mon Sep 17 00:00:00 2001 From: JP Meijers Date: Fri, 25 Oct 2019 09:13:15 +0200 Subject: [PATCH] Update README.md Describe manually showing and hiding loading indicator. --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 1587b0c..20ab462 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,21 @@ loading and `dataload` when you are finished loading. Please note that there is way this control tracks these events and that this will be re-worked in a future version. +In some cases the loading icon needs to be displayed when actions are performed +which are not directly related to the map. To manually show and hide the loading +indicator one can call `_showIndicator();` and `_hideIndicator();` as discussend +in [#44](https://github.com/ebrelsford/Leaflet.loading/issues/44). + +Example: +``` +var loadingControl = L.Control.loading({ separate: true, delayIndicator: 300 }); +map.addControl(this._loadingControl); +... +loadingControl._showIndicator(); +... +loadingControl._hideIndicator(); +``` + ### Options - **position**: (string) Where you want the control to show up on the map (standard