forked from Snck3rs/contao-leaflet-libraries
Update leaflet loading to version 0.1.24
This commit is contained in:
@@ -4,19 +4,22 @@ Leaflet.loading
|
||||
Leaflet.loading is a simple loading control for [Leaflet][]. An unobtrusive
|
||||
loading indicator is added below the zoom control if one exists. The indicator
|
||||
is visible when tiles are loading or when other data is loading, as indicated by
|
||||
firing custom events on a map. The indicator can be an image, or a [spin.js][]
|
||||
firing custom events on a map. The indicator can be an image, or a [spin.js][]
|
||||
spinner (image-less).
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Leaflet.loading is only tested on Leaflet version 0.6 or greater. It will almost
|
||||
certainly not work with older versions of Leaflet.
|
||||
certainly not work with older versions of Leaflet. Of course we intend to
|
||||
support Leaflet 1.0, and we have tested against the latest release (beta 2).
|
||||
Please create an issue if you find that any part of this project is not
|
||||
compatible with Leaflet 1.0.
|
||||
|
||||
Include `Control.Loading.js` and `Control.Loading.css`, then create a map with
|
||||
`loadingControl: true` in its options.
|
||||
Include `Control.Loading.js` and `Control.Loading.css`, then create a map with
|
||||
`loadingControl: true` in its options.
|
||||
|
||||
By default, Leaflet.loading includes a base64-encoded animagted loading image in
|
||||
By default, Leaflet.loading includes a base64-encoded animagted loading image in
|
||||
`Control.Loading.css`. You can customize this by changing `background-image` for
|
||||
the selector `.leaflet-control-loading`. The simplest case would be adding a 16
|
||||
x 16 loading gif in `.leaflet-control-loading`.
|
||||
@@ -28,13 +31,14 @@ initializing the control.
|
||||
Whichever method you use, make sure you only use one.
|
||||
|
||||
Once the above is complete you will have a loading indicator that only appears
|
||||
when tiles are loading.
|
||||
when tiles are loading.
|
||||
|
||||
If you want to show the loading indicator while other AJAX requests or something
|
||||
else is occurring, simply fire the `dataloading` event on your map when you
|
||||
begin loading and `dataload` when you are finished loading. The control tracks
|
||||
the number of concurrent loaders, so it is your responsibility to ensure that
|
||||
the `dataloading` and `dataload` are called symmetrically.
|
||||
else is occurring, fire the `dataloading` event on your map when you begin
|
||||
loading and `dataload` when you are finished loading. Please note that there is
|
||||
[an issue](https://github.com/ebrelsford/Leaflet.loading/issues/26) with the
|
||||
way this control tracks these events and that this will be re-worked in a
|
||||
future version.
|
||||
|
||||
### Options
|
||||
|
||||
@@ -43,20 +47,22 @@ the `dataloading` and `dataload` are called symmetrically.
|
||||
- **separate**: (boolean) Whether the control should be separate from the zoom
|
||||
control or not, defaults to false.
|
||||
- **zoomControl**: (L.Control.Zoom) The zoom control that the control should be
|
||||
added to. This is only necessary when adding a loading control to a zoom
|
||||
added to. This is only necessary when adding a loading control to a zoom
|
||||
control that you added manually and do not want a separate loading control.
|
||||
- **spinjs**: (boolean) Enable the use of [spin.js][]. Optional, defaults to
|
||||
- **delayIndicator**: (float) The number of milliseconds to wait before
|
||||
showing the loading indicator. Defaults to `null` (no delay).
|
||||
- **spinjs**: (boolean) Enable the use of [spin.js][]. Optional, defaults to
|
||||
`false`
|
||||
- **spin**: (object) A [spin.js][] options object. Optional, defaults to
|
||||
- **spin**: (object) A [spin.js][] options object. Optional, defaults to
|
||||
|
||||
```
|
||||
{
|
||||
{
|
||||
lines: 7,
|
||||
length: 3,
|
||||
width: 3,
|
||||
radius: 5,
|
||||
rotate: 13,
|
||||
top: "83%"
|
||||
top: "83%"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user